summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRitesh Harjani <riteshh@codeaurora.org>2015-10-27 11:51:25 +0530
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:28:01 -0700
commit2f69844aa86701a0a4c1ea8ca8fa8e55506a1329 (patch)
treef1a09a0804462de619cf152a062f4b49b10a17cb /include/linux
parent68393ba3719348673f17a0b999f695bb572e0ec3 (diff)
mmc: cmdq_hci: Helper API/info in cmdq for halt
This patch adds following helper API/info - 1. cmdq_halt_poll to halt the controller using polling method. This is to be mainly used in case of an error from cmdq_irq context. 2. Adds num_cq_slots & dcmd_cq_slot info to mmc_host structure. This can be useful info for mmc host structure like in case of handling of multiple error requests 3. Adds CMDQ_STATE_CQ_DISABLE for cmdq host. In case of an error if halt also fails, CQE error handling code will disable CQ. So block layer needs to know - to not pull any requests in such case. Change-Id: I8e9a8d5094db82336917fcca4361ce84316c34ef Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org> [subhashj@codeaurora.org: fixed merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mmc/host.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index cd79dd903a8b..4743f46bf9b3 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -257,6 +257,7 @@ struct mmc_cmdq_context_info {
#define CMDQ_STATE_ERR 0
#define CMDQ_STATE_DCMD_ACTIVE 1
#define CMDQ_STATE_HALT 2
+#define CMDQ_STATE_CQ_DISABLE 3
wait_queue_head_t queue_empty_wq;
wait_queue_head_t wait;
int active_small_sector_read_reqs;
@@ -569,6 +570,8 @@ struct mmc_host {
enum dev_state dev_status;
bool wakeup_on_idle;
struct mmc_cmdq_context_info cmdq_ctx;
+ int num_cq_slots;
+ int dcmd_cq_slot;
bool cmdq_thist_enabled;
/*
* several cmdq supporting host controllers are extensions
@@ -717,6 +720,21 @@ static inline int mmc_host_halt(struct mmc_host *host)
return test_bit(CMDQ_STATE_HALT, &host->cmdq_ctx.curr_state);
}
+static inline void mmc_host_set_cq_disable(struct mmc_host *host)
+{
+ set_bit(CMDQ_STATE_CQ_DISABLE, &host->cmdq_ctx.curr_state);
+}
+
+static inline void mmc_host_clr_cq_disable(struct mmc_host *host)
+{
+ clear_bit(CMDQ_STATE_CQ_DISABLE, &host->cmdq_ctx.curr_state);
+}
+
+static inline int mmc_host_cq_disable(struct mmc_host *host)
+{
+ return test_bit(CMDQ_STATE_CQ_DISABLE, &host->cmdq_ctx.curr_state);
+}
+
#ifdef CONFIG_MMC_CLKGATE
void mmc_host_clk_hold(struct mmc_host *host);
void mmc_host_clk_release(struct mmc_host *host);