stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Bart Van Assche <Bart.VanAssche@wdc.com>,
	Tomas Janousek <tomi@nomi.cz>, Przemek Socha <soprwa@gmail.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	stable@vger.kernel.org
Subject: Re: [PATCH] block: really disable runtime-pm for blk-mq
Date: Mon, 30 Jul 2018 16:50:33 +0200	[thread overview]
Message-ID: <20180730145033.GA1696@xps> (raw)
In-Reply-To: <20180730120219.24164-1-ming.lei@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1641 bytes --]

On Mon, Jul 30, 2018 at 08:02:19PM +0800, Ming Lei wrote:
> Runtime PM isn't ready for blk-mq yet, and commit 765e40b675a9 ("block:
> disable runtime-pm for blk-mq") tried to disable it. Unfortunately,
> it can't take effect in that way since user space still can switch
> it on via 'echo auto > /sys/block/sdN/device/power/control'.
> 
> This patch disables runtime-pm for blk-mq really by pm_runtime_disable()
> and fixes all kinds of PM related kernel crash.

I can confirm that this patch fixes the kernel panics I've seen.
For what it's worth, the USB hotplugging issues didn't
re-surface, either. Thanks!

> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Patrick Steinhardt <ps@pks.im>
> Cc: Bart Van Assche <Bart.VanAssche@wdc.com>
> Cc: Tomas Janousek <tomi@nomi.cz>
> Cc: Przemek Socha <soprwa@gmail.com>
> Cc: Alan Stern <stern@rowland.harvard.edu>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> ---
>  block/blk-core.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/block/blk-core.c b/block/blk-core.c
> index 03a4ea93a5f3..090b782df129 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -3769,9 +3769,11 @@ EXPORT_SYMBOL(blk_finish_plug);
>   */
>  void blk_pm_runtime_init(struct request_queue *q, struct device *dev)
>  {
> -	/* not support for RQF_PM and ->rpm_status in blk-mq yet */
> -	if (q->mq_ops)
> +	/* Don't enable runtime PM for blk-mq until it is ready */
> +	if (q->mq_ops) {
> +		pm_runtime_disable(dev);
>  		return;
> +	}
>  
>  	q->dev = dev;
>  	q->rpm_status = RPM_ACTIVE;
> -- 
> 2.9.5
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-07-30 16:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-30 12:02 [PATCH] block: really disable runtime-pm for blk-mq Ming Lei
2018-07-30 14:50 ` Patrick Steinhardt [this message]
2018-07-30 15:14 ` Przemek Socha
2018-07-30 20:43 ` Bart Van Assche
2018-08-01 14:55 ` Christoph Hellwig
2018-08-02 16:36 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180730145033.GA1696@xps \
    --to=ps@pks.im \
    --cc=Bart.VanAssche@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=soprwa@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=tomi@nomi.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).