summaryrefslogtreecommitdiff
path: root/include/linux/mmc
diff options
context:
space:
mode:
authorAsutosh Das <asutoshd@codeaurora.org>2012-07-27 18:10:19 +0530
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:25:34 -0700
commitfd7c52accff9a54a6ce2e82f06fb50ad22d775e2 (patch)
tree5fa562c58e7f44227b69c1764098537488d9e9d4 /include/linux/mmc
parent883e57df750022f9197aad5134873c50ae5af6d9 (diff)
mmc: block: do not query the sd card if a fault is injected
When the fault injection framework introduces an error to the data block, the current code queries the SD card to find the number of blocks actually programmed. This value would be as requested by the generic block layer. So the entire request would be completed. Say, request 0 is pulled from queue and submitted. When this is being processed, request 1 is pulled from queue and prepared. Request 0 though is successful, fault-injection framework injects an error and modifies the bytes_xferred variable to a random value less than requested transfer. Request 1 is not processed and during the handling of error, the SD card is queried for the actual bytes programmed. This would be the correct value. Thus blk_end_request would complete this request and the control would return to fetch request 2. In this process, request 1 is not processed at all and the application waits indefinitely for request 1 to be processed. No further requests are issued to the queue. This patch identifies, if the fault injection-framework has inserted an error to this request and doesn't query the card and uses bytes_xferred to complete the request. Change-Id: I496802e244745bc7550402027a594d967cf7b756 Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Diffstat (limited to 'include/linux/mmc')
-rw-r--r--include/linux/mmc/core.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index c5f305249919..0c2f98ba1d84 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -93,6 +93,7 @@ struct mmc_data {
int sg_count; /* mapped sg entries */
struct scatterlist *sg; /* I/O scatter list */
s32 host_cookie; /* host private data */
+ bool fault_injected; /* fault injected */
};
struct mmc_host;