From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com ([74.125.82.67]:51967 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727020AbeG3QvE (ORCPT ); Mon, 30 Jul 2018 12:51:04 -0400 Received: by mail-wm0-f67.google.com with SMTP id y2-v6so118820wma.1 for ; Mon, 30 Jul 2018 08:15:36 -0700 (PDT) From: Przemek Socha To: Ming Lei Reply-To: soprwa@gmail.com Cc: Christoph Hellwig , Patrick Steinhardt , Bart Van Assche , Tomas Janousek , Alan Stern , stable@vger.kernel.org Subject: Re: [PATCH] block: really disable runtime-pm for blk-mq Date: Mon, 30 Jul 2018 17:14:03 +0200 Message-ID: <2191598.hWjFyhWQyz@eclipse> In-Reply-To: <20180730120219.24164-1-ming.lei@redhat.com> References: <20180730120219.24164-1-ming.lei@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Sender: stable-owner@vger.kernel.org List-ID: Dnia poniedzia=C5=82ek, 30 lipca 2018 14:02:19 CEST piszesz: > 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'. >=20 > This patch disables runtime-pm for blk-mq really by pm_runtime_disable() > and fixes all kinds of PM related kernel crash. >=20 > Cc: Christoph Hellwig > Cc: Patrick Steinhardt > Cc: Bart Van Assche > Cc: Tomas Janousek > Cc: Przemek Socha > Cc: Alan Stern > Cc: > Signed-off-by: Ming Lei > --- > block/blk-core.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > 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; > + } >=20 > q->dev =3D dev; > q->rpm_status =3D RPM_ACTIVE; This patch works perfectly with SATA ssd. I have checked "resume" with all= =20 schedulers and with kernel command line "scsi_mod.use_blk_mq=3D1" option (= bfq,=20 kyber, deadline-mq). There is no more kernel oops with NULL pointer=20 dereference, and machine can resume successfully. When this patch will get = to=20 stable tree i will close that bug report : https://bugzilla.kernel.org/ show_bug.cgi?id=3D200435. Thank you very much, Przemek.