From: Greg Kroah-Hartman Date: Sun, 19 Apr 2020 07:21:03 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v4.19.117~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5312d329f78d1e6b8be4c7160ceb0a20d74b2dbd;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: drm-amd-powerplay-force-the-trim-of-the-mclk-dpm_levels-if-od-is-enabled.patch drm-amdgpu-fix-the-hw-hang-during-perform-system-reboot-and-reset.patch i2c-designware-platdrv-remove-dpm_flag_smart_suspend-flag-on-byt-and-cht.patch --- diff --git a/queue-5.4/drm-amd-powerplay-force-the-trim-of-the-mclk-dpm_levels-if-od-is-enabled.patch b/queue-5.4/drm-amd-powerplay-force-the-trim-of-the-mclk-dpm_levels-if-od-is-enabled.patch new file mode 100644 index 00000000000..2e043092352 --- /dev/null +++ b/queue-5.4/drm-amd-powerplay-force-the-trim-of-the-mclk-dpm_levels-if-od-is-enabled.patch @@ -0,0 +1,41 @@ +From 8c7f0a44b4b4ef16df8f44fbaee6d1f5d1593c83 Mon Sep 17 00:00:00 2001 +From: Sergei Lopatin +Date: Wed, 26 Jun 2019 14:56:59 +0500 +Subject: drm/amd/powerplay: force the trim of the mclk dpm_levels if OD is enabled + +From: Sergei Lopatin + +commit 8c7f0a44b4b4ef16df8f44fbaee6d1f5d1593c83 upstream. + +Should prevent flicker if PP_OVERDRIVE_MASK is set. + +bug: https://bugs.freedesktop.org/show_bug.cgi?id=102646 +bug: https://bugs.freedesktop.org/show_bug.cgi?id=108941 +bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1088 +bug: https://gitlab.freedesktop.org/drm/amd/-/issues/628 + +Signed-off-by: Sergei Lopatin +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c ++++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +@@ -3805,9 +3805,12 @@ static int smu7_trim_single_dpm_states(s + { + uint32_t i; + ++ /* force the trim if mclk_switching is disabled to prevent flicker */ ++ bool force_trim = (low_limit == high_limit); + for (i = 0; i < dpm_table->count; i++) { + /*skip the trim if od is enabled*/ +- if (!hwmgr->od_enabled && (dpm_table->dpm_levels[i].value < low_limit ++ if ((!hwmgr->od_enabled || force_trim) ++ && (dpm_table->dpm_levels[i].value < low_limit + || dpm_table->dpm_levels[i].value > high_limit)) + dpm_table->dpm_levels[i].enabled = false; + else diff --git a/queue-5.4/drm-amdgpu-fix-the-hw-hang-during-perform-system-reboot-and-reset.patch b/queue-5.4/drm-amdgpu-fix-the-hw-hang-during-perform-system-reboot-and-reset.patch new file mode 100644 index 00000000000..50d8f6216da --- /dev/null +++ b/queue-5.4/drm-amdgpu-fix-the-hw-hang-during-perform-system-reboot-and-reset.patch @@ -0,0 +1,37 @@ +From b2a7e9735ab2864330be9d00d7f38c961c28de5d Mon Sep 17 00:00:00 2001 +From: Prike Liang +Date: Mon, 13 Apr 2020 21:41:14 +0800 +Subject: drm/amdgpu: fix the hw hang during perform system reboot and reset + +From: Prike Liang + +commit b2a7e9735ab2864330be9d00d7f38c961c28de5d upstream. + +The system reboot failed as some IP blocks enter power gate before perform +hw resource destory. Meanwhile use unify interface to set device CGPG to ungate +state can simplify the amdgpu poweroff or reset ungate guard. + +Fixes: 487eca11a321ef ("drm/amdgpu: fix gfx hang during suspend with video playback (v2)") +Signed-off-by: Prike Liang +Tested-by: Mengbing Wang +Tested-by: Paul Menzel +Acked-by: Alex Deucher +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +@@ -2176,6 +2176,8 @@ static int amdgpu_device_ip_suspend_phas + { + int i, r; + ++ amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE); ++ amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE); + + for (i = adev->num_ip_blocks - 1; i >= 0; i--) { + if (!adev->ip_blocks[i].status.valid) diff --git a/queue-5.4/i2c-designware-platdrv-remove-dpm_flag_smart_suspend-flag-on-byt-and-cht.patch b/queue-5.4/i2c-designware-platdrv-remove-dpm_flag_smart_suspend-flag-on-byt-and-cht.patch new file mode 100644 index 00000000000..75dd40dd89c --- /dev/null +++ b/queue-5.4/i2c-designware-platdrv-remove-dpm_flag_smart_suspend-flag-on-byt-and-cht.patch @@ -0,0 +1,108 @@ +From d79294d0de12ddd1420110813626d691f440b86f Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 7 Apr 2020 20:11:16 +0200 +Subject: i2c: designware: platdrv: Remove DPM_FLAG_SMART_SUSPEND flag on BYT and CHT + +From: Hans de Goede + +commit d79294d0de12ddd1420110813626d691f440b86f upstream. + +We already set DPM_FLAG_SMART_PREPARE, so we completely skip all +callbacks (other then prepare) where possible, quoting from +dw_i2c_plat_prepare(): + + /* + * If the ACPI companion device object is present for this device, it + * may be accessed during suspend and resume of other devices via I2C + * operation regions, so tell the PM core and middle layers to avoid + * skipping system suspend/resume callbacks for it in that case. + */ + return !has_acpi_companion(dev); + +Also setting the DPM_FLAG_SMART_SUSPEND will cause acpi_subsys_suspend() +to leave the controller runtime-suspended even if dw_i2c_plat_prepare() +returned 0. + +Leaving the controller runtime-suspended normally, when the I2C controller +is suspended during the suspend_late phase, is not an issue because +the pm_runtime_get_sync() done by i2c_dw_xfer() will (runtime-)resume it. + +But for dw I2C controllers on Bay- and Cherry-Trail devices acpi_lpss.c +leaves the controller alive until the suspend_noirq phase, because it may +be used by the _PS3 ACPI methods of PCI devices and PCI devices are left +powered on until the suspend_noirq phase. + +Between the suspend_late and resume_early phases runtime-pm is disabled. +So for any ACPI I2C OPRegion accesses done after the suspend_late phase, +the pm_runtime_get_sync() done by i2c_dw_xfer() is a no-op and the +controller is left runtime-suspended. + +i2c_dw_xfer() has a check to catch this condition (rather then waiting +for the I2C transfer to timeout because the controller is suspended). +acpi_subsys_suspend() leaving the controller runtime-suspended in +combination with an ACPI I2C OPRegion access done after the suspend_late +phase triggers this check, leading to the following error being logged +on a Bay Trail based Lenovo Thinkpad 8 tablet: + +[ 93.275882] i2c_designware 80860F41:00: Transfer while suspended +[ 93.275993] WARNING: CPU: 0 PID: 412 at drivers/i2c/busses/i2c-designware-master.c:429 i2c_dw_xfer+0x239/0x280 +... +[ 93.276252] Workqueue: kacpi_notify acpi_os_execute_deferred +[ 93.276267] RIP: 0010:i2c_dw_xfer+0x239/0x280 +... +[ 93.276340] Call Trace: +[ 93.276366] __i2c_transfer+0x121/0x520 +[ 93.276379] i2c_transfer+0x4c/0x100 +[ 93.276392] i2c_acpi_space_handler+0x219/0x510 +[ 93.276408] ? up+0x40/0x60 +[ 93.276419] ? i2c_acpi_notify+0x130/0x130 +[ 93.276433] acpi_ev_address_space_dispatch+0x1e1/0x252 +... + +So since on BYT and CHT platforms we want ACPI I2c OPRegion accesses +to work until the suspend_noirq phase, we need the controller to be +runtime-resumed during the suspend phase if it is runtime-suspended +suspended at that time. This means that we must not set the +DPM_FLAG_SMART_SUSPEND on these platforms. + +On BYT and CHT we already have a special ACCESS_NO_IRQ_SUSPEND flag +to make sure the controller stays functional until the suspend_noirq +phase. This commit makes the driver not set the DPM_FLAG_SMART_SUSPEND +flag when that flag is set. + +Cc: stable@vger.kernel.org +Fixes: b30f2f65568f ("i2c: designware: Set IRQF_NO_SUSPEND flag for all BYT and CHT controllers") +Signed-off-by: Hans de Goede +Reviewed-by: Andy Shevchenko +Acked-by: Rafael J. Wysocki +Acked-by: Jarkko Nikula +Signed-off-by: Wolfram Sang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/i2c/busses/i2c-designware-platdrv.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +--- a/drivers/i2c/busses/i2c-designware-platdrv.c ++++ b/drivers/i2c/busses/i2c-designware-platdrv.c +@@ -370,10 +370,16 @@ static int dw_i2c_plat_probe(struct plat + adap->dev.of_node = pdev->dev.of_node; + adap->nr = -1; + +- dev_pm_set_driver_flags(&pdev->dev, +- DPM_FLAG_SMART_PREPARE | +- DPM_FLAG_SMART_SUSPEND | +- DPM_FLAG_LEAVE_SUSPENDED); ++ if (dev->flags & ACCESS_NO_IRQ_SUSPEND) { ++ dev_pm_set_driver_flags(&pdev->dev, ++ DPM_FLAG_SMART_PREPARE | ++ DPM_FLAG_LEAVE_SUSPENDED); ++ } else { ++ dev_pm_set_driver_flags(&pdev->dev, ++ DPM_FLAG_SMART_PREPARE | ++ DPM_FLAG_SMART_SUSPEND | ++ DPM_FLAG_LEAVE_SUSPENDED); ++ } + + /* The code below assumes runtime PM to be disabled. */ + WARN_ON(pm_runtime_enabled(&pdev->dev)); diff --git a/queue-5.4/series b/queue-5.4/series index 1759031690a..4ddf0ca180c 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -48,3 +48,6 @@ mac80211_hwsim-use-kstrndup-in-place-of-kasprintf.patch net-mlx5e-encapsulate-updating-netdev-queues-into-a-.patch net-mlx5e-rename-hw_modify-to-preactivate.patch net-mlx5e-use-preactivate-hook-to-set-the-indirectio.patch +drm-amd-powerplay-force-the-trim-of-the-mclk-dpm_levels-if-od-is-enabled.patch +drm-amdgpu-fix-the-hw-hang-during-perform-system-reboot-and-reset.patch +i2c-designware-platdrv-remove-dpm_flag_smart_suspend-flag-on-byt-and-cht.patch