mmc: block: Fix tag condition with packed writes
authorShawn Lin <shawn.lin@rock-chips.com>
Thu, 16 Jun 2016 07:31:33 +0000 (15:31 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Fri, 17 Jun 2016 08:40:30 +0000 (16:40 +0800)
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().

Change-Id: I721c02d7a937844ecedeb6c24d8439f8a9c29fef
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
drivers/mmc/card/block.c

index 67f44aed500030df7f0190d8323143d76d1f4b63..17d94b61c8f4c7f5e55cb4fe9aa714d3350496a5 100644 (file)
@@ -2041,8 +2041,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)] =
                        (do_rel_wr ? MMC_CMD23_ARG_REL_WR : 0) |