aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorKonstantin Dorfman <kdorfman@codeaurora.org>2013-01-14 14:28:17 -0500
committerChris Ball <cjb@laptop.org>2013-02-11 13:28:49 -0500
commit2220eedfd7aea69008173a224975e10284fbe854 (patch)
tree71906c2638d2e0052b15a40e71310f6984f3ee8f /include/linux
parent369d321ed1baa7748e770aaaae4d8effad699633 (diff)
mmc: fix async request mechanism for sequential read scenarios
When current request is running on the bus and if next request fetched by mmcqd is NULL, mmc context (mmcqd thread) gets blocked until the current request completes. This means that if new request comes in while the mmcqd thread is blocked, this new request can not be prepared in parallel to current ongoing request. This may result in delaying the new request execution and increase it's latency. This change allows to wake up the MMC thread on new request arrival. Now once the MMC thread is woken up, a new request can be fetched and prepared in parallel to the current running request which means this new request can be started immediately after the current running request completes. With this change read throughput is improved by 16%. Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org> Reviewed-by: Seungwon Jeon <tgih.jun@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mmc/card.h12
-rw-r--r--include/linux/mmc/core.h3
-rw-r--r--include/linux/mmc/host.h17
3 files changed, 31 insertions, 1 deletions
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 5c69315d60cc..be2500a49925 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -187,6 +187,18 @@ struct sdio_func_tuple;
187 187
188#define SDIO_MAX_FUNCS 7 188#define SDIO_MAX_FUNCS 7
189 189
190enum mmc_blk_status {
191 MMC_BLK_SUCCESS = 0,
192 MMC_BLK_PARTIAL,
193 MMC_BLK_CMD_ERR,
194 MMC_BLK_RETRY,
195 MMC_BLK_ABORT,
196 MMC_BLK_DATA_ERR,
197 MMC_BLK_ECC_ERR,
198 MMC_BLK_NOMEDIUM,
199 MMC_BLK_NEW_REQUEST,
200};
201
190/* The number of MMC physical partitions. These consist of: 202/* The number of MMC physical partitions. These consist of:
191 * boot partitions (2), general purpose partitions (4) in MMC v4.4. 203 * boot partitions (2), general purpose partitions (4) in MMC v4.4.
192 */ 204 */
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 5bf7c2274fcb..495d1336149c 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -120,6 +120,7 @@ struct mmc_data {
120 s32 host_cookie; /* host private data */ 120 s32 host_cookie; /* host private data */
121}; 121};
122 122
123struct mmc_host;
123struct mmc_request { 124struct mmc_request {
124 struct mmc_command *sbc; /* SET_BLOCK_COUNT for multiblock */ 125 struct mmc_command *sbc; /* SET_BLOCK_COUNT for multiblock */
125 struct mmc_command *cmd; 126 struct mmc_command *cmd;
@@ -128,9 +129,9 @@ struct mmc_request {
128 129
129 struct completion completion; 130 struct completion completion;
130 void (*done)(struct mmc_request *);/* completion function */ 131 void (*done)(struct mmc_request *);/* completion function */
132 struct mmc_host *host;
131}; 133};
132 134
133struct mmc_host;
134struct mmc_card; 135struct mmc_card;
135struct mmc_async_req; 136struct mmc_async_req;
136 137
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index c89a1bb87fa5..523d570f58ad 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -170,6 +170,22 @@ struct mmc_slot {
170 void *handler_priv; 170 void *handler_priv;
171}; 171};
172 172
173/**
174 * mmc_context_info - synchronization details for mmc context
175 * @is_done_rcv wake up reason was done request
176 * @is_new_req wake up reason was new request
177 * @is_waiting_last_req mmc context waiting for single running request
178 * @wait wait queue
179 * @lock lock to protect data fields
180 */
181struct mmc_context_info {
182 bool is_done_rcv;
183 bool is_new_req;
184 bool is_waiting_last_req;
185 wait_queue_head_t wait;
186 spinlock_t lock;
187};
188
173struct regulator; 189struct regulator;
174 190
175struct mmc_supply { 191struct mmc_supply {
@@ -331,6 +347,7 @@ struct mmc_host {
331 struct dentry *debugfs_root; 347 struct dentry *debugfs_root;
332 348
333 struct mmc_async_req *areq; /* active async req */ 349 struct mmc_async_req *areq; /* active async req */
350 struct mmc_context_info context_info; /* async synchronization info */
334 351
335#ifdef CONFIG_FAIL_MMC_REQUEST 352#ifdef CONFIG_FAIL_MMC_REQUEST
336 struct fault_attr fail_mmc_request; 353 struct fault_attr fail_mmc_request;