summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAsutosh Das <asutoshd@codeaurora.org>2015-05-20 16:52:04 +0530
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:26:32 -0700
commit444223d88485b28d8b4f02906c314c3081c8aa96 (patch)
tree0804c9fc448a335fff673196da8f285f2cb3a427 /include/linux
parent99b730eb035d2f1057f558928471c8b78d56371e (diff)
mmc: block: Add error handling to command queue host
On error, the CMDQ engine stops processing requests. It is then halted and error handled. The error have been categorized as below: 1. Command error a. time-out - invalidate all pending tags & requeue - reset both card & controller b. crc - end the error mrq - tune - unhalt 2. Data error a. time-out - invalidate all pending tags & requeue - reset both card and controller b. crc - end the error mrq - tune - unhalt 3. RED error This is device specific error and is not recoverable. The card and controller are reset in this case and all pending tags are invalidated and requeued. Change-Id: I791d05f6b31d8f9b35a56fe85007b320c14e8b46 Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mmc/core.h1
-rw-r--r--include/linux/mmc/host.h7
-rw-r--r--include/linux/mmc/mmc.h5
3 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 8bf192d6a7d4..59d9196250c1 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -116,6 +116,7 @@ struct mmc_card;
struct mmc_async_req;
struct mmc_cmdq_req;
+extern int mmc_cmdq_discard_queue(struct mmc_host *host, u32 tasks);
extern int mmc_cmdq_halt(struct mmc_host *host, bool enable);
extern void mmc_cmdq_post_req(struct mmc_host *host, struct mmc_request *mrq,
int err);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 4e555b99223e..18d041f85f95 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -95,6 +95,7 @@ struct mmc_cmdq_host_ops {
void (*post_req)(struct mmc_host *host, struct mmc_request *mrq,
int err);
int (*halt)(struct mmc_host *host, bool halt);
+ void (*reset)(struct mmc_host *host, bool soft);
};
struct mmc_host_ops {
@@ -193,6 +194,11 @@ struct mmc_cmdq_req {
#define DAT_TAG (1 << 5)
#define FORCED_PRG (1 << 6)
unsigned int cmdq_req_flags;
+
+ unsigned int resp_idx;
+ unsigned int resp_arg;
+ unsigned int dev_pend_tasks;
+ bool resp_err;
int tag; /* used for command queuing */
u8 ctx_id;
};
@@ -549,6 +555,7 @@ struct mmc_host {
* controller.
*/
void *cmdq_private;
+ struct mmc_request *err_mrq;
unsigned long private[0] ____cacheline_aligned;
};
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 71b5c75a0995..07b04c6e5c64 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -26,6 +26,11 @@
#include <uapi/linux/mmc/mmc.h>
+/* class 11 */
+#define MMC_CMDQ_TASK_MGMT 48 /* ac [31:0] task ID R1b */
+#define DISCARD_QUEUE 0x1
+#define DISCARD_TASK 0x2
+
static inline bool mmc_op_multi(u32 opcode)
{
return opcode == MMC_WRITE_MULTIPLE_BLOCK ||