diff options
-rw-r--r-- | drivers/mmc/mmc.c | 2 | ||||
-rw-r--r-- | drivers/mmc/mmc_block.c | 6 | ||||
-rw-r--r-- | include/linux/mmc/card.h | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index da6ddd910fc5..05aa4d6b4f24 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c | |||
@@ -549,6 +549,7 @@ static void mmc_decode_csd(struct mmc_card *card) | |||
549 | csd->read_partial = UNSTUFF_BITS(resp, 79, 1); | 549 | csd->read_partial = UNSTUFF_BITS(resp, 79, 1); |
550 | csd->write_misalign = UNSTUFF_BITS(resp, 78, 1); | 550 | csd->write_misalign = UNSTUFF_BITS(resp, 78, 1); |
551 | csd->read_misalign = UNSTUFF_BITS(resp, 77, 1); | 551 | csd->read_misalign = UNSTUFF_BITS(resp, 77, 1); |
552 | csd->r2w_factor = UNSTUFF_BITS(resp, 26, 3); | ||
552 | csd->write_blkbits = UNSTUFF_BITS(resp, 22, 4); | 553 | csd->write_blkbits = UNSTUFF_BITS(resp, 22, 4); |
553 | csd->write_partial = UNSTUFF_BITS(resp, 21, 1); | 554 | csd->write_partial = UNSTUFF_BITS(resp, 21, 1); |
554 | } else { | 555 | } else { |
@@ -583,6 +584,7 @@ static void mmc_decode_csd(struct mmc_card *card) | |||
583 | csd->read_partial = UNSTUFF_BITS(resp, 79, 1); | 584 | csd->read_partial = UNSTUFF_BITS(resp, 79, 1); |
584 | csd->write_misalign = UNSTUFF_BITS(resp, 78, 1); | 585 | csd->write_misalign = UNSTUFF_BITS(resp, 78, 1); |
585 | csd->read_misalign = UNSTUFF_BITS(resp, 77, 1); | 586 | csd->read_misalign = UNSTUFF_BITS(resp, 77, 1); |
587 | csd->r2w_factor = UNSTUFF_BITS(resp, 26, 3); | ||
586 | csd->write_blkbits = UNSTUFF_BITS(resp, 22, 4); | 588 | csd->write_blkbits = UNSTUFF_BITS(resp, 22, 4); |
587 | csd->write_partial = UNSTUFF_BITS(resp, 21, 1); | 589 | csd->write_partial = UNSTUFF_BITS(resp, 21, 1); |
588 | } | 590 | } |
diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c index 8eb2a2ede64b..06bd1f4cb9b1 100644 --- a/drivers/mmc/mmc_block.c +++ b/drivers/mmc/mmc_block.c | |||
@@ -187,6 +187,12 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) | |||
187 | brq.cmd.opcode = MMC_WRITE_BLOCK; | 187 | brq.cmd.opcode = MMC_WRITE_BLOCK; |
188 | brq.data.flags |= MMC_DATA_WRITE; | 188 | brq.data.flags |= MMC_DATA_WRITE; |
189 | brq.data.blocks = 1; | 189 | brq.data.blocks = 1; |
190 | |||
191 | /* | ||
192 | * Scale up the timeout by the r2w factor | ||
193 | */ | ||
194 | brq.data.timeout_ns <<= card->csd.r2w_factor; | ||
195 | brq.data.timeout_clks <<= card->csd.r2w_factor; | ||
190 | } | 196 | } |
191 | 197 | ||
192 | if (brq.data.blocks > 1) { | 198 | if (brq.data.blocks > 1) { |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 30dd978c1ec8..991a37382a22 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -28,6 +28,7 @@ struct mmc_csd { | |||
28 | unsigned short cmdclass; | 28 | unsigned short cmdclass; |
29 | unsigned short tacc_clks; | 29 | unsigned short tacc_clks; |
30 | unsigned int tacc_ns; | 30 | unsigned int tacc_ns; |
31 | unsigned int r2w_factor; | ||
31 | unsigned int max_dtr; | 32 | unsigned int max_dtr; |
32 | unsigned int read_blkbits; | 33 | unsigned int read_blkbits; |
33 | unsigned int write_blkbits; | 34 | unsigned int write_blkbits; |