diff mbox series

[4.4,5/6] mmc: block: Fix tag condition with packed writes

Message ID 20191127072124.30445-5-lee.jones@linaro.org
State New
Headers show
Series [4.4,1/6] can: dev: can_dellink(): remove return at end of void function | expand

Commit Message

Lee Jones Nov. 27, 2019, 7:21 a.m. UTC
From: Adrian Hunter <adrian.hunter@intel.com>


[ Upstream commit d806b46e5f496a6335ebd7f8432d2533507ce9a2 ]

Apparently a cut-and-paste error, 'do_data_tag' is using 'brq' for data
size even though 'brq' has not been set up. Instead use blk_rq_sectors().

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>

Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Signed-off-by: Lee Jones <lee.jones@linaro.org>

---
 drivers/mmc/card/block.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

-- 
2.24.0
diff mbox series

Patch

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index f600bdcaf5b4..07592e428755 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1772,8 +1772,7 @@  static void mmc_blk_packed_hdr_wrq_prep(struct mmc_queue_req *mqrq,
 		do_data_tag = (card->ext_csd.data_tag_unit_size) &&
 			(prq->cmd_flags & REQ_META) &&
 			(rq_data_dir(prq) == WRITE) &&
-			((brq->data.blocks * brq->data.blksz) >=
-			 card->ext_csd.data_tag_unit_size);
+			blk_rq_bytes(prq) >= card->ext_csd.data_tag_unit_size;
 		/* Argument of CMD23 */
 		packed_cmd_hdr[(i * 2)] = cpu_to_le32(
 			(do_rel_wr ? MMC_CMD23_ARG_REL_WR : 0) |