From 8131366d14ffba251c53ee5965baef7b0455f5aa Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 5 Aug 2018 23:12:11 +0800 Subject: [PATCH] block: really disable runtime-pm for blk-mq (Closes: #904441) --- debian/changelog | 1 + ...really-disable-runtime-pm-for-blk-mq.patch | 44 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 46 insertions(+) create mode 100644 debian/patches/bugfix/all/block-really-disable-runtime-pm-for-blk-mq.patch diff --git a/debian/changelog b/debian/changelog index 342dae539..b10dcf21e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ linux (4.17.8-2) UNRELEASED; urgency=medium - gpu: host1x: Fix compiler errors by converting to dma_addr_t * [ia64] sched: Disable SCHED_STACK_END_CHECK (Closes: #905461) * mtd: powernv_flash: set of_node in mtd's dev (Closes: #904380) + * block: really disable runtime-pm for blk-mq (Closes: #904441) -- Ben Hutchings Sun, 05 Aug 2018 19:37:24 +0800 diff --git a/debian/patches/bugfix/all/block-really-disable-runtime-pm-for-blk-mq.patch b/debian/patches/bugfix/all/block-really-disable-runtime-pm-for-blk-mq.patch new file mode 100644 index 000000000..b06f1fd79 --- /dev/null +++ b/debian/patches/bugfix/all/block-really-disable-runtime-pm-for-blk-mq.patch @@ -0,0 +1,44 @@ +From: Ming Lei +Subject: block: really disable runtime-pm for blk-mq +Date: Mon, 30 Jul 2018 20:02:19 +0800 +Origin: https://patchwork.kernel.org/patch/10548975/ +Bug-Debian: https://bugs.debian.org/904441 + +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. + +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 +Reviewed-by: Bart Van Assche +Reviewed-by: Christoph Hellwig +--- + block/blk-core.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/block/blk-core.c ++++ b/block/blk-core.c +@@ -3784,9 +3784,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; diff --git a/debian/patches/series b/debian/patches/series index 9f715e8a9..60b9c3932 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -95,6 +95,7 @@ bugfix/all/kbuild-include-addtree-remove-quotes-before-matching-path.patch debian/revert-objtool-fix-config_stack_validation-y-warning.patch bugfix/all/i40e-build-for-64-bit-targets-only.patch bugfix/all/ib-fix-rdma_rxe-and-infiniband_rdmavt-dependencies-f.patch +bugfix/all/block-really-disable-runtime-pm-for-blk-mq.patch # Miscellaneous features features/all/kbuild-add-build-salt-to-the-kernel-and-modules.patch