From: Christoph Hellwig Date: Fri, 7 Feb 2014 18:22:38 +0000 (-0800) Subject: blk-mq: handle dma_drain_size X-Git-Tag: upstream/snapshot3+hdmi~3430^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f7f418c4835d3ce1b66d00502df41f324d13ec0;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git blk-mq: handle dma_drain_size Make blk-mq handle the dma_drain_size field the same way as the old request path. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe --- diff --git a/block/blk-mq.c b/block/blk-mq.c index c9306e3..a99bea4 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -582,6 +582,16 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) list_del_init(&rq->queuelist); blk_mq_start_request(rq); + if (q->dma_drain_size && blk_rq_bytes(rq)) { + /* + * make sure space for the drain appears we + * know we can do this because max_hw_segments + * has been adjusted to be one fewer than the + * device can handle + */ + rq->nr_phys_segments++; + } + /* * Last request in the series. Flag it as such, this * enables drivers to know when IO should be kicked off,