Re: [PATCH 1/2] blk-mq: add blk_mq_stop_hw_queues
From: Jens Axboe
Date: Fri Oct 25 2013 - 09:44:20 EST
On Fri, Oct 25 2013, Christoph Hellwig wrote:
> Add a helper to iterate over all hw queues and stop them. This is useful
> for driver that implement PM suspend functionality.
>
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> ---
> block/blk-mq.c | 12 ++++++++++++
> include/linux/blk-mq.h | 1 +
> 2 files changed, 13 insertions(+)
>
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index f21ec96..04050a3 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -679,6 +679,18 @@ void blk_mq_start_hw_queue(struct blk_mq_hw_ctx *hctx)
> }
> EXPORT_SYMBOL(blk_mq_start_hw_queue);
>
> +void blk_mq_stop_hw_queues(struct request_queue *q)
> +{
> + struct blk_mq_hw_ctx *hctx;
> + int i;
> +
> + queue_for_each_hw_ctx(q, hctx, i) {
> + cancel_delayed_work(&hctx->delayed_work);
> + set_bit(BLK_MQ_S_STOPPED, &hctx->state);
> + }
I changed this to call blk_mq_stop_hw_queue() instead.
--
Jens Axboe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/