diff options
-rw-r--r-- | drivers/mmc/card/block.c | 4 | ||||
-rw-r--r-- | drivers/mmc/core/core.c | 8 | ||||
-rw-r--r-- | drivers/mmc/core/mmc_ops.c | 2 | ||||
-rw-r--r-- | drivers/mmc/core/sd_ops.c | 4 | ||||
-rw-r--r-- | include/linux/mmc/core.h | 2 |
5 files changed, 9 insertions, 11 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 0da341acf32b..9abf29f8435b 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -229,8 +229,6 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) | |||
229 | if (brq.data.blocks > card->host->max_blk_count) | 229 | if (brq.data.blocks > card->host->max_blk_count) |
230 | brq.data.blocks = card->host->max_blk_count; | 230 | brq.data.blocks = card->host->max_blk_count; |
231 | 231 | ||
232 | mmc_set_data_timeout(&brq.data, card, rq_data_dir(req) != READ); | ||
233 | |||
234 | /* | 232 | /* |
235 | * If the host doesn't support multiple block writes, force | 233 | * If the host doesn't support multiple block writes, force |
236 | * block writes to single block. SD cards are excepted from | 234 | * block writes to single block. SD cards are excepted from |
@@ -261,6 +259,8 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) | |||
261 | brq.data.flags |= MMC_DATA_WRITE; | 259 | brq.data.flags |= MMC_DATA_WRITE; |
262 | } | 260 | } |
263 | 261 | ||
262 | mmc_set_data_timeout(&brq.data, card); | ||
263 | |||
264 | brq.data.sg = mq->sg; | 264 | brq.data.sg = mq->sg; |
265 | brq.data.sg_len = mmc_queue_map_sg(mq); | 265 | brq.data.sg_len = mmc_queue_map_sg(mq); |
266 | 266 | ||
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 63b67296e92d..51e611f2f33d 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -220,13 +220,11 @@ EXPORT_SYMBOL(mmc_wait_for_cmd); | |||
220 | * mmc_set_data_timeout - set the timeout for a data command | 220 | * mmc_set_data_timeout - set the timeout for a data command |
221 | * @data: data phase for command | 221 | * @data: data phase for command |
222 | * @card: the MMC card associated with the data transfer | 222 | * @card: the MMC card associated with the data transfer |
223 | * @write: flag to differentiate reads from writes | ||
224 | * | 223 | * |
225 | * Computes the data timeout parameters according to the | 224 | * Computes the data timeout parameters according to the |
226 | * correct algorithm given the card type. | 225 | * correct algorithm given the card type. |
227 | */ | 226 | */ |
228 | void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card, | 227 | void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card) |
229 | int write) | ||
230 | { | 228 | { |
231 | unsigned int mult; | 229 | unsigned int mult; |
232 | 230 | ||
@@ -239,7 +237,7 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card, | |||
239 | * Scale up the multiplier (and therefore the timeout) by | 237 | * Scale up the multiplier (and therefore the timeout) by |
240 | * the r2w factor for writes. | 238 | * the r2w factor for writes. |
241 | */ | 239 | */ |
242 | if (write) | 240 | if (data->flags & MMC_DATA_WRITE) |
243 | mult <<= card->csd.r2w_factor; | 241 | mult <<= card->csd.r2w_factor; |
244 | 242 | ||
245 | data->timeout_ns = card->csd.tacc_ns * mult; | 243 | data->timeout_ns = card->csd.tacc_ns * mult; |
@@ -255,7 +253,7 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card, | |||
255 | timeout_us += data->timeout_clks * 1000 / | 253 | timeout_us += data->timeout_clks * 1000 / |
256 | (card->host->ios.clock / 1000); | 254 | (card->host->ios.clock / 1000); |
257 | 255 | ||
258 | if (write) | 256 | if (data->flags & MMC_DATA_WRITE) |
259 | limit_us = 250000; | 257 | limit_us = 250000; |
260 | else | 258 | else |
261 | limit_us = 100000; | 259 | limit_us = 100000; |
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index 15cd575effaa..39567f91a4b8 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c | |||
@@ -214,7 +214,7 @@ int mmc_send_ext_csd(struct mmc_card *card, u8 *ext_csd) | |||
214 | 214 | ||
215 | sg_init_one(&sg, ext_csd, 512); | 215 | sg_init_one(&sg, ext_csd, 512); |
216 | 216 | ||
217 | mmc_set_data_timeout(&data, card, 0); | 217 | mmc_set_data_timeout(&data, card); |
218 | 218 | ||
219 | mmc_wait_for_req(card->host, &mrq); | 219 | mmc_wait_for_req(card->host, &mrq); |
220 | 220 | ||
diff --git a/drivers/mmc/core/sd_ops.c b/drivers/mmc/core/sd_ops.c index b4d43bd0fedd..491e0306b1b4 100644 --- a/drivers/mmc/core/sd_ops.c +++ b/drivers/mmc/core/sd_ops.c | |||
@@ -252,7 +252,7 @@ int mmc_app_send_scr(struct mmc_card *card, u32 *scr) | |||
252 | 252 | ||
253 | sg_init_one(&sg, scr, 8); | 253 | sg_init_one(&sg, scr, 8); |
254 | 254 | ||
255 | mmc_set_data_timeout(&data, card, 0); | 255 | mmc_set_data_timeout(&data, card); |
256 | 256 | ||
257 | mmc_wait_for_req(card->host, &mrq); | 257 | mmc_wait_for_req(card->host, &mrq); |
258 | 258 | ||
@@ -302,7 +302,7 @@ int mmc_sd_switch(struct mmc_card *card, int mode, int group, | |||
302 | 302 | ||
303 | sg_init_one(&sg, resp, 64); | 303 | sg_init_one(&sg, resp, 64); |
304 | 304 | ||
305 | mmc_set_data_timeout(&data, card, 0); | 305 | mmc_set_data_timeout(&data, card); |
306 | 306 | ||
307 | mmc_wait_for_req(card->host, &mrq); | 307 | mmc_wait_for_req(card->host, &mrq); |
308 | 308 | ||
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index a2b79518f051..2a03f8b9cdfb 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -111,7 +111,7 @@ extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); | |||
111 | extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, | 111 | extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *, |
112 | struct mmc_command *, int); | 112 | struct mmc_command *, int); |
113 | 113 | ||
114 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *, int); | 114 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); |
115 | 115 | ||
116 | extern void mmc_claim_host(struct mmc_host *host); | 116 | extern void mmc_claim_host(struct mmc_host *host); |
117 | extern void mmc_release_host(struct mmc_host *host); | 117 | extern void mmc_release_host(struct mmc_host *host); |