From c97b1bf8effd008b9c404f59b5e778d0c42a9161 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 4 Oct 2020 12:59:30 +0200 Subject: [PATCH] 5.4-stable patches added patches: drm-amdgpu-restore-proper-ref-count-in-amdgpu_display_crtc_set_config.patch ftrace-move-rcu-is-watching-check-after-recursion-check.patch i2c-i801-exclude-device-from-suspend-direct-complete-optimization.patch iio-adc-qcom-spmi-adc5-fix-driver-name.patch input-i8042-add-nopnp-quirk-for-acer-aspire-5-a515.patch memstick-skip-allocating-card-when-removing-host.patch --- ...nt-in-amdgpu_display_crtc_set_config.patch | 43 +++++++++++++ ...watching-check-after-recursion-check.patch | 55 +++++++++++++++++ ...suspend-direct-complete-optimization.patch | 39 ++++++++++++ ...o-adc-qcom-spmi-adc5-fix-driver-name.patch | 33 ++++++++++ ...d-nopnp-quirk-for-acer-aspire-5-a515.patch | 45 ++++++++++++++ ...p-allocating-card-when-removing-host.patch | 60 +++++++++++++++++++ queue-5.4/series | 6 ++ 7 files changed, 281 insertions(+) create mode 100644 queue-5.4/drm-amdgpu-restore-proper-ref-count-in-amdgpu_display_crtc_set_config.patch create mode 100644 queue-5.4/ftrace-move-rcu-is-watching-check-after-recursion-check.patch create mode 100644 queue-5.4/i2c-i801-exclude-device-from-suspend-direct-complete-optimization.patch create mode 100644 queue-5.4/iio-adc-qcom-spmi-adc5-fix-driver-name.patch create mode 100644 queue-5.4/input-i8042-add-nopnp-quirk-for-acer-aspire-5-a515.patch create mode 100644 queue-5.4/memstick-skip-allocating-card-when-removing-host.patch diff --git a/queue-5.4/drm-amdgpu-restore-proper-ref-count-in-amdgpu_display_crtc_set_config.patch b/queue-5.4/drm-amdgpu-restore-proper-ref-count-in-amdgpu_display_crtc_set_config.patch new file mode 100644 index 00000000000..f69be2799c7 --- /dev/null +++ b/queue-5.4/drm-amdgpu-restore-proper-ref-count-in-amdgpu_display_crtc_set_config.patch @@ -0,0 +1,43 @@ +From a39d0d7bdf8c21ac7645c02e9676b5cb2b804c31 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Mon, 28 Sep 2020 11:10:37 +0200 +Subject: drm/amdgpu: restore proper ref count in amdgpu_display_crtc_set_config + +From: Jean Delvare + +commit a39d0d7bdf8c21ac7645c02e9676b5cb2b804c31 upstream. + +A recent attempt to fix a ref count leak in +amdgpu_display_crtc_set_config() turned out to be doing too much and +"fixed" an intended decrease as if it were a leak. Undo that part to +restore the proper balance. This is the very nature of this function +to increase or decrease the power reference count depending on the +situation. + +Consequences of this bug is that the power reference would +eventually get down to 0 while the display was still in use, +resulting in that display switching off unexpectedly. + +Signed-off-by: Jean Delvare +Fixes: e008fa6fb415 ("drm/amdgpu: fix ref count leak in amdgpu_display_crtc_set_config") +Cc: stable@vger.kernel.org +Cc: Navid Emamdoost +Cc: Alex Deucher +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +@@ -297,7 +297,7 @@ int amdgpu_display_crtc_set_config(struc + take the current one */ + if (active && !adev->have_disp_power_ref) { + adev->have_disp_power_ref = true; +- goto out; ++ return ret; + } + /* if we have no active crtcs, then drop the power ref + we got before */ diff --git a/queue-5.4/ftrace-move-rcu-is-watching-check-after-recursion-check.patch b/queue-5.4/ftrace-move-rcu-is-watching-check-after-recursion-check.patch new file mode 100644 index 00000000000..c36b419c04c --- /dev/null +++ b/queue-5.4/ftrace-move-rcu-is-watching-check-after-recursion-check.patch @@ -0,0 +1,55 @@ +From b40341fad6cc2daa195f8090fd3348f18fff640a Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (VMware)" +Date: Tue, 29 Sep 2020 12:40:31 -0400 +Subject: ftrace: Move RCU is watching check after recursion check + +From: Steven Rostedt (VMware) + +commit b40341fad6cc2daa195f8090fd3348f18fff640a upstream. + +The first thing that the ftrace function callback helper functions should do +is to check for recursion. Peter Zijlstra found that when +"rcu_is_watching()" had its notrace removed, it caused perf function tracing +to crash. This is because the call of rcu_is_watching() is tested before +function recursion is checked and and if it is traced, it will cause an +infinite recursion loop. + +rcu_is_watching() should still stay notrace, but to prevent this should +never had crashed in the first place. The recursion prevention must be the +first thing done in callback functions. + +Link: https://lore.kernel.org/r/20200929112541.GM2628@hirez.programming.kicks-ass.net + +Cc: stable@vger.kernel.org +Cc: Paul McKenney +Fixes: c68c0fa293417 ("ftrace: Have ftrace_ops_get_func() handle RCU and PER_CPU flags too") +Acked-by: Peter Zijlstra (Intel) +Reported-by: Peter Zijlstra (Intel) +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/trace/ftrace.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/kernel/trace/ftrace.c ++++ b/kernel/trace/ftrace.c +@@ -6382,16 +6382,14 @@ static void ftrace_ops_assist_func(unsig + { + int bit; + +- if ((op->flags & FTRACE_OPS_FL_RCU) && !rcu_is_watching()) +- return; +- + bit = trace_test_and_set_recursion(TRACE_LIST_START, TRACE_LIST_MAX); + if (bit < 0) + return; + + preempt_disable_notrace(); + +- op->func(ip, parent_ip, op, regs); ++ if (!(op->flags & FTRACE_OPS_FL_RCU) || rcu_is_watching()) ++ op->func(ip, parent_ip, op, regs); + + preempt_enable_notrace(); + trace_clear_recursion(bit); diff --git a/queue-5.4/i2c-i801-exclude-device-from-suspend-direct-complete-optimization.patch b/queue-5.4/i2c-i801-exclude-device-from-suspend-direct-complete-optimization.patch new file mode 100644 index 00000000000..e7906903e8e --- /dev/null +++ b/queue-5.4/i2c-i801-exclude-device-from-suspend-direct-complete-optimization.patch @@ -0,0 +1,39 @@ +From 845b89127bc5458d0152a4d63f165c62a22fcb70 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Thu, 10 Sep 2020 11:57:08 +0200 +Subject: i2c: i801: Exclude device from suspend direct complete optimization +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Jean Delvare + +commit 845b89127bc5458d0152a4d63f165c62a22fcb70 upstream. + +By default, PCI drivers with runtime PM enabled will skip the calls +to suspend and resume on system PM. For this driver, we don't want +that, as we need to perform additional steps for system PM to work +properly on all systems. So instruct the PM core to not skip these +calls. + +Fixes: a9c8088c7988 ("i2c: i801: Don't restore config registers on runtime PM") +Reported-by: Volker Rümelin +Signed-off-by: Jean Delvare +Cc: stable@vger.kernel.org +Signed-off-by: Wolfram Sang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/i2c/busses/i2c-i801.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/i2c/busses/i2c-i801.c ++++ b/drivers/i2c/busses/i2c-i801.c +@@ -1891,6 +1891,7 @@ static int i801_probe(struct pci_dev *de + + pci_set_drvdata(dev, priv); + ++ dev_pm_set_driver_flags(&dev->dev, DPM_FLAG_NO_DIRECT_COMPLETE); + pm_runtime_set_autosuspend_delay(&dev->dev, 1000); + pm_runtime_use_autosuspend(&dev->dev); + pm_runtime_put_autosuspend(&dev->dev); diff --git a/queue-5.4/iio-adc-qcom-spmi-adc5-fix-driver-name.patch b/queue-5.4/iio-adc-qcom-spmi-adc5-fix-driver-name.patch new file mode 100644 index 00000000000..c403d9bb6ca --- /dev/null +++ b/queue-5.4/iio-adc-qcom-spmi-adc5-fix-driver-name.patch @@ -0,0 +1,33 @@ +From fdb29f4de1374483291232ae7515e5e7bb464762 Mon Sep 17 00:00:00 2001 +From: Dmitry Baryshkov +Date: Thu, 10 Sep 2020 16:59:51 +0300 +Subject: iio: adc: qcom-spmi-adc5: fix driver name + +From: Dmitry Baryshkov + +commit fdb29f4de1374483291232ae7515e5e7bb464762 upstream. + +Remove superfluous '.c' from qcom-spmi-adc5 device driver name. +Fixes: e13d757279bb ("iio: adc: Add QCOM SPMI PMIC5 ADC driver") +Signed-off-by: Dmitry Baryshkov +Acked-by: Manivannan Sadhasivam +Cc: +Link: https://lore.kernel.org/r/20200910140000.324091-2-dmitry.baryshkov@linaro.org +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/adc/qcom-spmi-adc5.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/adc/qcom-spmi-adc5.c ++++ b/drivers/iio/adc/qcom-spmi-adc5.c +@@ -786,7 +786,7 @@ static int adc5_probe(struct platform_de + + static struct platform_driver adc5_driver = { + .driver = { +- .name = "qcom-spmi-adc5.c", ++ .name = "qcom-spmi-adc5", + .of_match_table = adc5_match_table, + }, + .probe = adc5_probe, diff --git a/queue-5.4/input-i8042-add-nopnp-quirk-for-acer-aspire-5-a515.patch b/queue-5.4/input-i8042-add-nopnp-quirk-for-acer-aspire-5-a515.patch new file mode 100644 index 00000000000..7f81a77ab7e --- /dev/null +++ b/queue-5.4/input-i8042-add-nopnp-quirk-for-acer-aspire-5-a515.patch @@ -0,0 +1,45 @@ +From 5fc27b098dafb8e30794a9db0705074c7d766179 Mon Sep 17 00:00:00 2001 +From: Jiri Kosina +Date: Mon, 28 Sep 2020 16:21:17 -0700 +Subject: Input: i8042 - add nopnp quirk for Acer Aspire 5 A515 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Jiri Kosina + +commit 5fc27b098dafb8e30794a9db0705074c7d766179 upstream. + +Touchpad on this laptop is not detected properly during boot, as PNP +enumerates (wrongly) AUX port as disabled on this machine. + +Fix that by adding this board (with admittedly quite funny DMI +identifiers) to nopnp quirk list. + +Reported-by: Andrés Barrantes Silman +Signed-off-by: Jiri Kosina +Link: https://lore.kernel.org/r/nycvar.YFH.7.76.2009252337340.3336@cbobk.fhfr.pm +Cc: stable@vger.kernel.org +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/input/serio/i8042-x86ia64io.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/input/serio/i8042-x86ia64io.h ++++ b/drivers/input/serio/i8042-x86ia64io.h +@@ -721,6 +721,13 @@ static const struct dmi_system_id __init + DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"), + }, + }, ++ { ++ /* Acer Aspire 5 A515 */ ++ .matches = { ++ DMI_MATCH(DMI_BOARD_NAME, "Grumpy_PK"), ++ DMI_MATCH(DMI_BOARD_VENDOR, "PK"), ++ }, ++ }, + { } + }; + diff --git a/queue-5.4/memstick-skip-allocating-card-when-removing-host.patch b/queue-5.4/memstick-skip-allocating-card-when-removing-host.patch new file mode 100644 index 00000000000..354d1f04541 --- /dev/null +++ b/queue-5.4/memstick-skip-allocating-card-when-removing-host.patch @@ -0,0 +1,60 @@ +From 62c59a8786e6bb75569cee91dab66e9da3ff4b68 Mon Sep 17 00:00:00 2001 +From: Kai-Heng Feng +Date: Fri, 25 Sep 2020 16:49:51 +0800 +Subject: memstick: Skip allocating card when removing host + +From: Kai-Heng Feng + +commit 62c59a8786e6bb75569cee91dab66e9da3ff4b68 upstream. + +After commit 6827ca573c03 ("memstick: rtsx_usb_ms: Support runtime power +management"), removing module rtsx_usb_ms will be stuck. + +The deadlock is caused by powering on and powering off at the same time, +the former one is when memstick_check() is flushed, and the later is called +by memstick_remove_host(). + +Soe let's skip allocating card to prevent this issue. + +Fixes: 6827ca573c03 ("memstick: rtsx_usb_ms: Support runtime power management") +Signed-off-by: Kai-Heng Feng +Link: https://lore.kernel.org/r/20200925084952.13220-1-kai.heng.feng@canonical.com +Cc: stable@vger.kernel.org +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/memstick/core/memstick.c | 4 ++++ + include/linux/memstick.h | 1 + + 2 files changed, 5 insertions(+) + +--- a/drivers/memstick/core/memstick.c ++++ b/drivers/memstick/core/memstick.c +@@ -441,6 +441,9 @@ static void memstick_check(struct work_s + } else if (host->card->stop) + host->card->stop(host->card); + ++ if (host->removing) ++ goto out_power_off; ++ + card = memstick_alloc_card(host); + + if (!card) { +@@ -545,6 +548,7 @@ EXPORT_SYMBOL(memstick_add_host); + */ + void memstick_remove_host(struct memstick_host *host) + { ++ host->removing = 1; + flush_workqueue(workqueue); + mutex_lock(&host->lock); + if (host->card) +--- a/include/linux/memstick.h ++++ b/include/linux/memstick.h +@@ -281,6 +281,7 @@ struct memstick_host { + + struct memstick_dev *card; + unsigned int retries; ++ bool removing; + + /* Notify the host that some requests are pending. */ + void (*request)(struct memstick_host *host); diff --git a/queue-5.4/series b/queue-5.4/series index 1dd20bb24a7..420e5497cb5 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -8,3 +8,9 @@ clk-socfpga-stratix10-fix-the-divider-for-the-emac_ptp_free_clk.patch vsock-virtio-add-transport-parameter-to-the-virtio_t.patch net-virtio_vsock-enhance-connection-semantics.patch xfs-trim-io-to-found-cow-extent-limit.patch +i2c-i801-exclude-device-from-suspend-direct-complete-optimization.patch +input-i8042-add-nopnp-quirk-for-acer-aspire-5-a515.patch +iio-adc-qcom-spmi-adc5-fix-driver-name.patch +ftrace-move-rcu-is-watching-check-after-recursion-check.patch +memstick-skip-allocating-card-when-removing-host.patch +drm-amdgpu-restore-proper-ref-count-in-amdgpu_display_crtc_set_config.patch -- 2.47.3