From: Sasha Levin Date: Sat, 5 Mar 2022 20:55:48 +0000 (-0500) Subject: Fixes for 5.10 X-Git-Tag: v4.9.305~41^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=531391f80babff0e992796554a47654ca766ce89;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.10 Signed-off-by: Sasha Levin --- diff --git a/queue-5.10/arm-dts-switch-timer-config-to-common-devkit8000-dev.patch b/queue-5.10/arm-dts-switch-timer-config-to-common-devkit8000-dev.patch new file mode 100644 index 00000000000..31a77d8dc87 --- /dev/null +++ b/queue-5.10/arm-dts-switch-timer-config-to-common-devkit8000-dev.patch @@ -0,0 +1,109 @@ +From fc1d75b403303878166af66f774b6c157a934835 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 25 Jan 2022 20:11:38 +0100 +Subject: ARM: dts: switch timer config to common devkit8000 devicetree + +From: Anthoine Bourgeois + +[ Upstream commit 64324ef337d0caa5798fa8fa3f6bbfbd3245868a ] + +This patch allow lcd43 and lcd70 flavors to benefit from timer +evolution. + +Fixes: e428e250fde6 ("ARM: dts: Configure system timers for omap3") +Signed-off-by: Anthoine Bourgeois +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + .../arm/boot/dts/omap3-devkit8000-common.dtsi | 33 +++++++++++++++++++ + arch/arm/boot/dts/omap3-devkit8000.dts | 33 ------------------- + 2 files changed, 33 insertions(+), 33 deletions(-) + +diff --git a/arch/arm/boot/dts/omap3-devkit8000-common.dtsi b/arch/arm/boot/dts/omap3-devkit8000-common.dtsi +index 2c19d6e255bd..0df2b1dd07f6 100644 +--- a/arch/arm/boot/dts/omap3-devkit8000-common.dtsi ++++ b/arch/arm/boot/dts/omap3-devkit8000-common.dtsi +@@ -158,6 +158,39 @@ + status = "disabled"; + }; + ++/* Unusable as clocksource because of unreliable oscillator */ ++&counter32k { ++ status = "disabled"; ++}; ++ ++/* Unusable as clockevent because if unreliable oscillator, allow to idle */ ++&timer1_target { ++ /delete-property/ti,no-reset-on-init; ++ /delete-property/ti,no-idle; ++ timer@0 { ++ /delete-property/ti,timer-alwon; ++ }; ++}; ++ ++/* Preferred always-on timer for clocksource */ ++&timer12_target { ++ ti,no-reset-on-init; ++ ti,no-idle; ++ timer@0 { ++ /* Always clocked by secure_32k_fck */ ++ }; ++}; ++ ++/* Preferred timer for clockevent */ ++&timer2_target { ++ ti,no-reset-on-init; ++ ti,no-idle; ++ timer@0 { ++ assigned-clocks = <&gpt2_fck>; ++ assigned-clock-parents = <&sys_ck>; ++ }; ++}; ++ + &twl_gpio { + ti,use-leds; + /* +diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts +index c2995a280729..162d0726b008 100644 +--- a/arch/arm/boot/dts/omap3-devkit8000.dts ++++ b/arch/arm/boot/dts/omap3-devkit8000.dts +@@ -14,36 +14,3 @@ + display2 = &tv0; + }; + }; +- +-/* Unusable as clocksource because of unreliable oscillator */ +-&counter32k { +- status = "disabled"; +-}; +- +-/* Unusable as clockevent because if unreliable oscillator, allow to idle */ +-&timer1_target { +- /delete-property/ti,no-reset-on-init; +- /delete-property/ti,no-idle; +- timer@0 { +- /delete-property/ti,timer-alwon; +- }; +-}; +- +-/* Preferred always-on timer for clocksource */ +-&timer12_target { +- ti,no-reset-on-init; +- ti,no-idle; +- timer@0 { +- /* Always clocked by secure_32k_fck */ +- }; +-}; +- +-/* Preferred timer for clockevent */ +-&timer2_target { +- ti,no-reset-on-init; +- ti,no-idle; +- timer@0 { +- assigned-clocks = <&gpt2_fck>; +- assigned-clock-parents = <&sys_ck>; +- }; +-}; +-- +2.34.1 + diff --git a/queue-5.10/arm-dts-use-32kihz-oscillator-on-devkit8000.patch b/queue-5.10/arm-dts-use-32kihz-oscillator-on-devkit8000.patch new file mode 100644 index 00000000000..05584ecc044 --- /dev/null +++ b/queue-5.10/arm-dts-use-32kihz-oscillator-on-devkit8000.patch @@ -0,0 +1,88 @@ +From 1ca5b01baaa35c2d288ab173012095422e24df6c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 25 Jan 2022 20:11:39 +0100 +Subject: ARM: dts: Use 32KiHz oscillator on devkit8000 + +From: Anthoine Bourgeois + +[ Upstream commit 8840f5460a23759403f1f2860429dcbcc2f04a65 ] + +Devkit8000 board seems to always used 32k_counter as clocksource. +Restore this behavior. + +If clocksource is back to 32k_counter, timer12 is now the clockevent +source (as before) and timer2 is not longer needed here. + +This commit fixes the same issue observed with commit 23885389dbbb +("ARM: dts: Fix timer regression for beagleboard revision c") when sleep +is blocked until hitting keys over serial console. + +Fixes: aba1ad05da08 ("clocksource/drivers/timer-ti-dm: Add clockevent and clocksource support") +Fixes: e428e250fde6 ("ARM: dts: Configure system timers for omap3") +Signed-off-by: Anthoine Bourgeois +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/omap3-devkit8000-common.dtsi | 17 +---------------- + drivers/clocksource/timer-ti-dm-systimer.c | 3 +-- + 2 files changed, 2 insertions(+), 18 deletions(-) + +diff --git a/arch/arm/boot/dts/omap3-devkit8000-common.dtsi b/arch/arm/boot/dts/omap3-devkit8000-common.dtsi +index 0df2b1dd07f6..6883ccb45600 100644 +--- a/arch/arm/boot/dts/omap3-devkit8000-common.dtsi ++++ b/arch/arm/boot/dts/omap3-devkit8000-common.dtsi +@@ -158,11 +158,6 @@ + status = "disabled"; + }; + +-/* Unusable as clocksource because of unreliable oscillator */ +-&counter32k { +- status = "disabled"; +-}; +- + /* Unusable as clockevent because if unreliable oscillator, allow to idle */ + &timer1_target { + /delete-property/ti,no-reset-on-init; +@@ -172,7 +167,7 @@ + }; + }; + +-/* Preferred always-on timer for clocksource */ ++/* Preferred timer for clockevent */ + &timer12_target { + ti,no-reset-on-init; + ti,no-idle; +@@ -181,16 +176,6 @@ + }; + }; + +-/* Preferred timer for clockevent */ +-&timer2_target { +- ti,no-reset-on-init; +- ti,no-idle; +- timer@0 { +- assigned-clocks = <&gpt2_fck>; +- assigned-clock-parents = <&sys_ck>; +- }; +-}; +- + &twl_gpio { + ti,use-leds; + /* +diff --git a/drivers/clocksource/timer-ti-dm-systimer.c b/drivers/clocksource/timer-ti-dm-systimer.c +index 5c40ca1d4740..1fccb457fcc5 100644 +--- a/drivers/clocksource/timer-ti-dm-systimer.c ++++ b/drivers/clocksource/timer-ti-dm-systimer.c +@@ -241,8 +241,7 @@ static void __init dmtimer_systimer_assign_alwon(void) + bool quirk_unreliable_oscillator = false; + + /* Quirk unreliable 32 KiHz oscillator with incomplete dts */ +- if (of_machine_is_compatible("ti,omap3-beagle-ab4") || +- of_machine_is_compatible("timll,omap3-devkit8000")) { ++ if (of_machine_is_compatible("ti,omap3-beagle-ab4")) { + quirk_unreliable_oscillator = true; + counter_32k = -ENODEV; + } +-- +2.34.1 + diff --git a/queue-5.10/arm-tegra-move-panels-to-aux-bus.patch b/queue-5.10/arm-tegra-move-panels-to-aux-bus.patch new file mode 100644 index 00000000000..b9a8c61ca16 --- /dev/null +++ b/queue-5.10/arm-tegra-move-panels-to-aux-bus.patch @@ -0,0 +1,112 @@ +From b93ce40cdc2e37866a731420f3f25330f65fdc65 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 Dec 2021 11:32:39 +0100 +Subject: ARM: tegra: Move panels to AUX bus + +From: Thierry Reding + +[ Upstream commit 8d3b01e0d4bb54368d73d0984466d72c2eeeac74 ] + +Move the eDP panel on Venice 2 and Nyan boards into the corresponding +AUX bus device tree node. This allows us to avoid a nasty circular +dependency that would otherwise be created between the DPAUX and panel +nodes via the DDC/I2C phandle. + +Fixes: eb481f9ac95c ("ARM: tegra: add Acer Chromebook 13 device tree") +Fixes: 59fe02cb079f ("ARM: tegra: Add DTS for the nyan-blaze board") +Fixes: 40e231c770a4 ("ARM: tegra: Enable eDP for Venice2") +Signed-off-by: Thierry Reding +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/tegra124-nyan-big.dts | 15 +++++++++------ + arch/arm/boot/dts/tegra124-nyan-blaze.dts | 15 +++++++++------ + arch/arm/boot/dts/tegra124-venice2.dts | 14 +++++++------- + 3 files changed, 25 insertions(+), 19 deletions(-) + +diff --git a/arch/arm/boot/dts/tegra124-nyan-big.dts b/arch/arm/boot/dts/tegra124-nyan-big.dts +index 1d2aac2cb6d0..fdc1d64dfff9 100644 +--- a/arch/arm/boot/dts/tegra124-nyan-big.dts ++++ b/arch/arm/boot/dts/tegra124-nyan-big.dts +@@ -13,12 +13,15 @@ + "google,nyan-big-rev1", "google,nyan-big-rev0", + "google,nyan-big", "google,nyan", "nvidia,tegra124"; + +- panel: panel { +- compatible = "auo,b133xtn01"; +- +- power-supply = <&vdd_3v3_panel>; +- backlight = <&backlight>; +- ddc-i2c-bus = <&dpaux>; ++ host1x@50000000 { ++ dpaux@545c0000 { ++ aux-bus { ++ panel: panel { ++ compatible = "auo,b133xtn01"; ++ backlight = <&backlight>; ++ }; ++ }; ++ }; + }; + + mmc@700b0400 { /* SD Card on this bus */ +diff --git a/arch/arm/boot/dts/tegra124-nyan-blaze.dts b/arch/arm/boot/dts/tegra124-nyan-blaze.dts +index 677babde6460..abdf4456826f 100644 +--- a/arch/arm/boot/dts/tegra124-nyan-blaze.dts ++++ b/arch/arm/boot/dts/tegra124-nyan-blaze.dts +@@ -15,12 +15,15 @@ + "google,nyan-blaze-rev0", "google,nyan-blaze", + "google,nyan", "nvidia,tegra124"; + +- panel: panel { +- compatible = "samsung,ltn140at29-301"; +- +- power-supply = <&vdd_3v3_panel>; +- backlight = <&backlight>; +- ddc-i2c-bus = <&dpaux>; ++ host1x@50000000 { ++ dpaux@545c0000 { ++ aux-bus { ++ panel: panel { ++ compatible = "samsung,ltn140at29-301"; ++ backlight = <&backlight>; ++ }; ++ }; ++ }; + }; + + sound { +diff --git a/arch/arm/boot/dts/tegra124-venice2.dts b/arch/arm/boot/dts/tegra124-venice2.dts +index e6b54ac1ebd1..84e2d24065e9 100644 +--- a/arch/arm/boot/dts/tegra124-venice2.dts ++++ b/arch/arm/boot/dts/tegra124-venice2.dts +@@ -48,6 +48,13 @@ + dpaux@545c0000 { + vdd-supply = <&vdd_3v3_panel>; + status = "okay"; ++ ++ aux-bus { ++ panel: panel { ++ compatible = "lg,lp129qe"; ++ backlight = <&backlight>; ++ }; ++ }; + }; + }; + +@@ -1079,13 +1086,6 @@ + }; + }; + +- panel: panel { +- compatible = "lg,lp129qe"; +- power-supply = <&vdd_3v3_panel>; +- backlight = <&backlight>; +- ddc-i2c-bus = <&dpaux>; +- }; +- + vdd_mux: regulator@0 { + compatible = "regulator-fixed"; + regulator-name = "+VDD_MUX"; +-- +2.34.1 + diff --git a/queue-5.10/drm-amdgpu-fix-suspend-resume-hang-regression.patch b/queue-5.10/drm-amdgpu-fix-suspend-resume-hang-regression.patch new file mode 100644 index 00000000000..c142f52114a --- /dev/null +++ b/queue-5.10/drm-amdgpu-fix-suspend-resume-hang-regression.patch @@ -0,0 +1,44 @@ +From 5af63ae740f9f25871390ae584033c1f8e06db0c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 1 Mar 2022 14:11:59 +0800 +Subject: drm/amdgpu: fix suspend/resume hang regression +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Qiang Yu + +[ Upstream commit f1ef17011c765495c876fa75435e59eecfdc1ee4 ] + +Regression has been reported that suspend/resume may hang with +the previous vm ready check commit. + +So bring back the evicted list check as a temp fix. + +Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1922 +Fixes: c1a66c3bc425 ("drm/amdgpu: check vm ready by amdgpu_vm->evicting flag") +Reviewed-by: Christian König +Signed-off-by: Qiang Yu +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +index 47cc038d7d50..635601d8b131 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +@@ -724,7 +724,8 @@ bool amdgpu_vm_ready(struct amdgpu_vm *vm) + amdgpu_vm_eviction_lock(vm); + ret = !vm->evicting; + amdgpu_vm_eviction_unlock(vm); +- return ret; ++ ++ return ret && list_empty(&vm->evicted); + } + + /** +-- +2.34.1 + diff --git a/queue-5.10/iavf-refactor-iavf-state-machine-tracking.patch b/queue-5.10/iavf-refactor-iavf-state-machine-tracking.patch new file mode 100644 index 00000000000..7917af662dc --- /dev/null +++ b/queue-5.10/iavf-refactor-iavf-state-machine-tracking.patch @@ -0,0 +1,234 @@ +From 402c0537b90c742d961a05678f4bae9c2117c365 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 19 Aug 2021 08:47:40 +0000 +Subject: iavf: Refactor iavf state machine tracking + +From: Mateusz Palczewski + +[ Upstream commit 45eebd62999d37d13568723524b99d828e0ce22c ] + +Replace state changes of iavf state machine +with a method that also tracks the previous +state the machine was on. + +This change is required for further work with +refactoring init and watchdog state machines. + +Tracking of previous state would help us +recover iavf after failure has occurred. + +Signed-off-by: Jakub Pawlak +Signed-off-by: Jan Sokolowski +Signed-off-by: Mateusz Palczewski +Tested-by: Konrad Jankowski +Signed-off-by: Tony Nguyen +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/intel/iavf/iavf.h | 10 +++++ + drivers/net/ethernet/intel/iavf/iavf_main.c | 37 ++++++++++--------- + .../net/ethernet/intel/iavf/iavf_virtchnl.c | 2 +- + 3 files changed, 31 insertions(+), 18 deletions(-) + +diff --git a/drivers/net/ethernet/intel/iavf/iavf.h b/drivers/net/ethernet/intel/iavf/iavf.h +index 6766446a33f4..ce1e2fb22e09 100644 +--- a/drivers/net/ethernet/intel/iavf/iavf.h ++++ b/drivers/net/ethernet/intel/iavf/iavf.h +@@ -309,6 +309,7 @@ struct iavf_adapter { + struct iavf_hw hw; /* defined in iavf_type.h */ + + enum iavf_state_t state; ++ enum iavf_state_t last_state; + unsigned long crit_section; + + struct delayed_work watchdog_task; +@@ -378,6 +379,15 @@ struct iavf_device { + extern char iavf_driver_name[]; + extern struct workqueue_struct *iavf_wq; + ++static inline void iavf_change_state(struct iavf_adapter *adapter, ++ enum iavf_state_t state) ++{ ++ if (adapter->state != state) { ++ adapter->last_state = adapter->state; ++ adapter->state = state; ++ } ++} ++ + int iavf_up(struct iavf_adapter *adapter); + void iavf_down(struct iavf_adapter *adapter); + int iavf_process_config(struct iavf_adapter *adapter); +diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c +index 07170b77d42b..bd1fb3774769 100644 +--- a/drivers/net/ethernet/intel/iavf/iavf_main.c ++++ b/drivers/net/ethernet/intel/iavf/iavf_main.c +@@ -963,7 +963,7 @@ static void iavf_configure(struct iavf_adapter *adapter) + **/ + static void iavf_up_complete(struct iavf_adapter *adapter) + { +- adapter->state = __IAVF_RUNNING; ++ iavf_change_state(adapter, __IAVF_RUNNING); + clear_bit(__IAVF_VSI_DOWN, adapter->vsi.state); + + iavf_napi_enable_all(adapter); +@@ -1698,7 +1698,7 @@ static int iavf_startup(struct iavf_adapter *adapter) + iavf_shutdown_adminq(hw); + goto err; + } +- adapter->state = __IAVF_INIT_VERSION_CHECK; ++ iavf_change_state(adapter, __IAVF_INIT_VERSION_CHECK); + err: + return err; + } +@@ -1722,7 +1722,7 @@ static int iavf_init_version_check(struct iavf_adapter *adapter) + if (!iavf_asq_done(hw)) { + dev_err(&pdev->dev, "Admin queue command never completed\n"); + iavf_shutdown_adminq(hw); +- adapter->state = __IAVF_STARTUP; ++ iavf_change_state(adapter, __IAVF_STARTUP); + goto err; + } + +@@ -1745,8 +1745,7 @@ static int iavf_init_version_check(struct iavf_adapter *adapter) + err); + goto err; + } +- adapter->state = __IAVF_INIT_GET_RESOURCES; +- ++ iavf_change_state(adapter, __IAVF_INIT_GET_RESOURCES); + err: + return err; + } +@@ -1862,7 +1861,7 @@ static int iavf_init_get_resources(struct iavf_adapter *adapter) + if (netdev->features & NETIF_F_GRO) + dev_info(&pdev->dev, "GRO is enabled\n"); + +- adapter->state = __IAVF_DOWN; ++ iavf_change_state(adapter, __IAVF_DOWN); + set_bit(__IAVF_VSI_DOWN, adapter->vsi.state); + rtnl_unlock(); + +@@ -1910,7 +1909,7 @@ static void iavf_watchdog_task(struct work_struct *work) + goto restart_watchdog; + + if (adapter->flags & IAVF_FLAG_PF_COMMS_FAILED) +- adapter->state = __IAVF_COMM_FAILED; ++ iavf_change_state(adapter, __IAVF_COMM_FAILED); + + switch (adapter->state) { + case __IAVF_COMM_FAILED: +@@ -1921,7 +1920,7 @@ static void iavf_watchdog_task(struct work_struct *work) + /* A chance for redemption! */ + dev_err(&adapter->pdev->dev, + "Hardware came out of reset. Attempting reinit.\n"); +- adapter->state = __IAVF_STARTUP; ++ iavf_change_state(adapter, __IAVF_STARTUP); + adapter->flags &= ~IAVF_FLAG_PF_COMMS_FAILED; + queue_delayed_work(iavf_wq, &adapter->init_task, 10); + clear_bit(__IAVF_IN_CRITICAL_TASK, +@@ -1971,9 +1970,10 @@ static void iavf_watchdog_task(struct work_struct *work) + goto restart_watchdog; + } + +- /* check for hw reset */ ++ /* check for hw reset */ + reg_val = rd32(hw, IAVF_VF_ARQLEN1) & IAVF_VF_ARQLEN1_ARQENABLE_MASK; + if (!reg_val) { ++ iavf_change_state(adapter, __IAVF_RESETTING); + adapter->flags |= IAVF_FLAG_RESET_PENDING; + adapter->aq_required = 0; + adapter->current_op = VIRTCHNL_OP_UNKNOWN; +@@ -2053,7 +2053,7 @@ static void iavf_disable_vf(struct iavf_adapter *adapter) + adapter->netdev->flags &= ~IFF_UP; + clear_bit(__IAVF_IN_CRITICAL_TASK, &adapter->crit_section); + adapter->flags &= ~IAVF_FLAG_RESET_PENDING; +- adapter->state = __IAVF_DOWN; ++ iavf_change_state(adapter, __IAVF_DOWN); + wake_up(&adapter->down_waitqueue); + dev_info(&adapter->pdev->dev, "Reset task did not complete, VF disabled\n"); + } +@@ -2165,7 +2165,7 @@ static void iavf_reset_task(struct work_struct *work) + } + iavf_irq_disable(adapter); + +- adapter->state = __IAVF_RESETTING; ++ iavf_change_state(adapter, __IAVF_RESETTING); + adapter->flags &= ~IAVF_FLAG_RESET_PENDING; + + /* free the Tx/Rx rings and descriptors, might be better to just +@@ -2265,11 +2265,14 @@ static void iavf_reset_task(struct work_struct *work) + + iavf_configure(adapter); + ++ /* iavf_up_complete() will switch device back ++ * to __IAVF_RUNNING ++ */ + iavf_up_complete(adapter); + + iavf_irq_enable(adapter, true); + } else { +- adapter->state = __IAVF_DOWN; ++ iavf_change_state(adapter, __IAVF_DOWN); + wake_up(&adapter->down_waitqueue); + } + clear_bit(__IAVF_IN_CLIENT_TASK, &adapter->crit_section); +@@ -3277,7 +3280,7 @@ static int iavf_close(struct net_device *netdev) + adapter->flags |= IAVF_FLAG_CLIENT_NEEDS_CLOSE; + + iavf_down(adapter); +- adapter->state = __IAVF_DOWN_PENDING; ++ iavf_change_state(adapter, __IAVF_DOWN_PENDING); + iavf_free_traffic_irqs(adapter); + + clear_bit(__IAVF_IN_CRITICAL_TASK, &adapter->crit_section); +@@ -3661,7 +3664,7 @@ static void iavf_init_task(struct work_struct *work) + "Failed to communicate with PF; waiting before retry\n"); + adapter->flags |= IAVF_FLAG_PF_COMMS_FAILED; + iavf_shutdown_adminq(hw); +- adapter->state = __IAVF_STARTUP; ++ iavf_change_state(adapter, __IAVF_STARTUP); + queue_delayed_work(iavf_wq, &adapter->init_task, HZ * 5); + goto out; + } +@@ -3687,7 +3690,7 @@ static void iavf_shutdown(struct pci_dev *pdev) + if (iavf_lock_timeout(adapter, __IAVF_IN_CRITICAL_TASK, 5000)) + dev_warn(&adapter->pdev->dev, "failed to set __IAVF_IN_CRITICAL_TASK in %s\n", __FUNCTION__); + /* Prevent the watchdog from running. */ +- adapter->state = __IAVF_REMOVE; ++ iavf_change_state(adapter, __IAVF_REMOVE); + adapter->aq_required = 0; + clear_bit(__IAVF_IN_CRITICAL_TASK, &adapter->crit_section); + +@@ -3760,7 +3763,7 @@ static int iavf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + hw->back = adapter; + + adapter->msg_enable = BIT(DEFAULT_DEBUG_LEVEL_SHIFT) - 1; +- adapter->state = __IAVF_STARTUP; ++ iavf_change_state(adapter, __IAVF_STARTUP); + + /* Call save state here because it relies on the adapter struct. */ + pci_save_state(pdev); +@@ -3928,7 +3931,7 @@ static void iavf_remove(struct pci_dev *pdev) + dev_warn(&adapter->pdev->dev, "failed to set __IAVF_IN_CRITICAL_TASK in %s\n", __FUNCTION__); + + /* Shut down all the garbage mashers on the detention level */ +- adapter->state = __IAVF_REMOVE; ++ iavf_change_state(adapter, __IAVF_REMOVE); + adapter->aq_required = 0; + adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED; + iavf_free_all_tx_resources(adapter); +diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +index 8be3151f2c62..ff479bf72144 100644 +--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c ++++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +@@ -1460,7 +1460,7 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter, + iavf_free_all_tx_resources(adapter); + iavf_free_all_rx_resources(adapter); + if (adapter->state == __IAVF_DOWN_PENDING) { +- adapter->state = __IAVF_DOWN; ++ iavf_change_state(adapter, __IAVF_DOWN); + wake_up(&adapter->down_waitqueue); + } + break; +-- +2.34.1 + diff --git a/queue-5.10/ibmvnic-complete-init_done-on-transport-events.patch b/queue-5.10/ibmvnic-complete-init_done-on-transport-events.patch new file mode 100644 index 00000000000..4a38cee4933 --- /dev/null +++ b/queue-5.10/ibmvnic-complete-init_done-on-transport-events.patch @@ -0,0 +1,42 @@ +From fa07d6c0764f5ca639ff4e0bfaa45bffb4db8b71 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 24 Feb 2022 22:23:54 -0800 +Subject: ibmvnic: complete init_done on transport events + +From: Sukadev Bhattiprolu + +[ Upstream commit 36491f2df9ad2501e5a4ec25d3d95d72bafd2781 ] + +If we get a transport event, set the error and mark the init as +complete so the attempt to send crq-init or login fail sooner +rather than wait for the timeout. + +Fixes: bbd669a868bb ("ibmvnic: Fix completion structure initialization") +Signed-off-by: Sukadev Bhattiprolu +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/ibm/ibmvnic.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index f07468316656..1afb31c9ed7b 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -4931,6 +4931,13 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq, + adapter->fw_done_rc = -EIO; + complete(&adapter->fw_done); + } ++ ++ /* if we got here during crq-init, retry crq-init */ ++ if (!completion_done(&adapter->init_done)) { ++ adapter->init_done_rc = -EAGAIN; ++ complete(&adapter->init_done); ++ } ++ + if (!completion_done(&adapter->stats_done)) + complete(&adapter->stats_done); + if (test_bit(0, &adapter->resetting)) +-- +2.34.1 + diff --git a/queue-5.10/ibmvnic-define-flush_reset_queue-helper.patch b/queue-5.10/ibmvnic-define-flush_reset_queue-helper.patch new file mode 100644 index 00000000000..cf2eb1385ee --- /dev/null +++ b/queue-5.10/ibmvnic-define-flush_reset_queue-helper.patch @@ -0,0 +1,68 @@ +From a4c55cbb79a10a5c450aa507df02a70f1264f554 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 24 Feb 2022 22:23:53 -0800 +Subject: ibmvnic: define flush_reset_queue helper + +From: Sukadev Bhattiprolu + +[ Upstream commit 83da53f7e4bd86dca4b2edc1e2bb324fb3c033a1 ] + +Define and use a helper to flush the reset queue. + +Fixes: 2770a7984db5 ("ibmvnic: Introduce hard reset recovery") +Signed-off-by: Sukadev Bhattiprolu +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/ibm/ibmvnic.c | 24 ++++++++++++++++-------- + 1 file changed, 16 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index de58824f4c18..f07468316656 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -2304,12 +2304,23 @@ static void __ibmvnic_delayed_reset(struct work_struct *work) + __ibmvnic_reset(&adapter->ibmvnic_reset); + } + ++static void flush_reset_queue(struct ibmvnic_adapter *adapter) ++{ ++ struct list_head *entry, *tmp_entry; ++ ++ if (!list_empty(&adapter->rwi_list)) { ++ list_for_each_safe(entry, tmp_entry, &adapter->rwi_list) { ++ list_del(entry); ++ kfree(list_entry(entry, struct ibmvnic_rwi, list)); ++ } ++ } ++} ++ + static int ibmvnic_reset(struct ibmvnic_adapter *adapter, + enum ibmvnic_reset_reason reason) + { +- struct list_head *entry, *tmp_entry; +- struct ibmvnic_rwi *rwi, *tmp; + struct net_device *netdev = adapter->netdev; ++ struct ibmvnic_rwi *rwi, *tmp; + unsigned long flags; + int ret; + +@@ -2353,12 +2364,9 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, + /* if we just received a transport event, + * flush reset queue and process this reset + */ +- if (adapter->force_reset_recovery && !list_empty(&adapter->rwi_list)) { +- list_for_each_safe(entry, tmp_entry, &adapter->rwi_list) { +- list_del(entry); +- kfree(list_entry(entry, struct ibmvnic_rwi, list)); +- } +- } ++ if (adapter->force_reset_recovery) ++ flush_reset_queue(adapter); ++ + rwi->reset_reason = reason; + list_add_tail(&rwi->list, &adapter->rwi_list); + netdev_dbg(adapter->netdev, "Scheduling reset (reason %d)\n", reason); +-- +2.34.1 + diff --git a/queue-5.10/net-chelsio-cxgb3-check-the-return-value-of-pci_find.patch b/queue-5.10/net-chelsio-cxgb3-check-the-return-value-of-pci_find.patch new file mode 100644 index 00000000000..654112bd12a --- /dev/null +++ b/queue-5.10/net-chelsio-cxgb3-check-the-return-value-of-pci_find.patch @@ -0,0 +1,37 @@ +From a8497030437a35d245877fa119b5dcc3eb39a711 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 25 Feb 2022 04:37:27 -0800 +Subject: net: chelsio: cxgb3: check the return value of pci_find_capability() + +From: Jia-Ju Bai + +[ Upstream commit 767b9825ed1765894e569a3d698749d40d83762a ] + +The function pci_find_capability() in t3_prep_adapter() can fail, so its +return value should be checked. + +Fixes: 4d22de3e6cc4 ("Add support for the latest 1G/10G Chelsio adapter, T3") +Reported-by: TOTE Robot +Signed-off-by: Jia-Ju Bai +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/chelsio/cxgb3/t3_hw.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c b/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c +index 7ff31d1026fb..e0d34e64fc6c 100644 +--- a/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c ++++ b/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c +@@ -3678,6 +3678,8 @@ int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai, + MAC_STATS_ACCUM_SECS : (MAC_STATS_ACCUM_SECS * 10); + adapter->params.pci.vpd_cap_addr = + pci_find_capability(adapter->pdev, PCI_CAP_ID_VPD); ++ if (!adapter->params.pci.vpd_cap_addr) ++ return -ENODEV; + ret = get_vpd_params(adapter, &adapter->params.vpd); + if (ret < 0) + return ret; +-- +2.34.1 + diff --git a/queue-5.10/net-dcb-disable-softirqs-in-dcbnl_flush_dev.patch b/queue-5.10/net-dcb-disable-softirqs-in-dcbnl_flush_dev.patch new file mode 100644 index 00000000000..c25d7988a29 --- /dev/null +++ b/queue-5.10/net-dcb-disable-softirqs-in-dcbnl_flush_dev.patch @@ -0,0 +1,62 @@ +From 5302153ae83c95d018059f4e0ae57ab7b9d83c55 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 2 Mar 2022 21:39:39 +0200 +Subject: net: dcb: disable softirqs in dcbnl_flush_dev() + +From: Vladimir Oltean + +[ Upstream commit 10b6bb62ae1a49ee818fc479cf57b8900176773e ] + +Ido Schimmel points out that since commit 52cff74eef5d ("dcbnl : Disable +software interrupts before taking dcb_lock"), the DCB API can be called +by drivers from softirq context. + +One such in-tree example is the chelsio cxgb4 driver: +dcb_rpl +-> cxgb4_dcb_handle_fw_update + -> dcb_ieee_setapp + +If the firmware for this driver happened to send an event which resulted +in a call to dcb_ieee_setapp() at the exact same time as another +DCB-enabled interface was unregistering on the same CPU, the softirq +would deadlock, because the interrupted process was already holding the +dcb_lock in dcbnl_flush_dev(). + +Fix this unlikely event by using spin_lock_bh() in dcbnl_flush_dev() as +in the rest of the dcbnl code. + +Fixes: 91b0383fef06 ("net: dcb: flush lingering app table entries for unregistered devices") +Reported-by: Ido Schimmel +Signed-off-by: Vladimir Oltean +Link: https://lore.kernel.org/r/20220302193939.1368823-1-vladimir.oltean@nxp.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/dcb/dcbnl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c +index 799ff0efcc55..2535d3dfb92c 100644 +--- a/net/dcb/dcbnl.c ++++ b/net/dcb/dcbnl.c +@@ -2067,7 +2067,7 @@ static void dcbnl_flush_dev(struct net_device *dev) + { + struct dcb_app_type *itr, *tmp; + +- spin_lock(&dcb_lock); ++ spin_lock_bh(&dcb_lock); + + list_for_each_entry_safe(itr, tmp, &dcb_app_list, list) { + if (itr->ifindex == dev->ifindex) { +@@ -2076,7 +2076,7 @@ static void dcbnl_flush_dev(struct net_device *dev) + } + } + +- spin_unlock(&dcb_lock); ++ spin_unlock_bh(&dcb_lock); + } + + static int dcbnl_netdevice_event(struct notifier_block *nb, +-- +2.34.1 + diff --git a/queue-5.10/nl80211-handle-nla_memdup-failures-in-handle_nan_fil.patch b/queue-5.10/nl80211-handle-nla_memdup-failures-in-handle_nan_fil.patch new file mode 100644 index 00000000000..4f6be689417 --- /dev/null +++ b/queue-5.10/nl80211-handle-nla_memdup-failures-in-handle_nan_fil.patch @@ -0,0 +1,54 @@ +From fc83ff94648b6eb3eeb0a2e9b391bb43b9155d58 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 1 Mar 2022 18:00:20 +0800 +Subject: nl80211: Handle nla_memdup failures in handle_nan_filter + +From: Jiasheng Jiang + +[ Upstream commit 6ad27f522cb3b210476daf63ce6ddb6568c0508b ] + +As there's potential for failure of the nla_memdup(), +check the return value. + +Fixes: a442b761b24b ("cfg80211: add add_nan_func / del_nan_func") +Signed-off-by: Jiasheng Jiang +Link: https://lore.kernel.org/r/20220301100020.3801187-1-jiasheng@iscas.ac.cn +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/wireless/nl80211.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c +index 8fb0478888fb..07bd7b00b56d 100644 +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -12930,6 +12930,9 @@ static int handle_nan_filter(struct nlattr *attr_filter, + i = 0; + nla_for_each_nested(attr, attr_filter, rem) { + filter[i].filter = nla_memdup(attr, GFP_KERNEL); ++ if (!filter[i].filter) ++ goto err; ++ + filter[i].len = nla_len(attr); + i++; + } +@@ -12942,6 +12945,15 @@ static int handle_nan_filter(struct nlattr *attr_filter, + } + + return 0; ++ ++err: ++ i = 0; ++ nla_for_each_nested(attr, attr_filter, rem) { ++ kfree(filter[i].filter); ++ i++; ++ } ++ kfree(filter); ++ return -ENOMEM; + } + + static int nl80211_nan_add_func(struct sk_buff *skb, +-- +2.34.1 + diff --git a/queue-5.10/series b/queue-5.10/series index b634e463654..0b0300f162f 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -79,3 +79,16 @@ igc-igc_write_phy_reg_gpy-drop-premature-return.patch ibmvnic-free-reset-work-item-when-flushing.patch memfd-fix-f_seal_write-after-shmem-huge-page-allocated.patch s390-extable-fix-exception-table-sorting.patch +arm-dts-switch-timer-config-to-common-devkit8000-dev.patch +arm-dts-use-32kihz-oscillator-on-devkit8000.patch +soc-fsl-guts-revert-commit-3c0d64e867ed.patch +soc-fsl-guts-add-a-missing-memory-allocation-failure.patch +soc-fsl-qe-check-of-ioremap-return-value.patch +arm-tegra-move-panels-to-aux-bus.patch +ibmvnic-define-flush_reset_queue-helper.patch +ibmvnic-complete-init_done-on-transport-events.patch +net-chelsio-cxgb3-check-the-return-value-of-pci_find.patch +iavf-refactor-iavf-state-machine-tracking.patch +nl80211-handle-nla_memdup-failures-in-handle_nan_fil.patch +drm-amdgpu-fix-suspend-resume-hang-regression.patch +net-dcb-disable-softirqs-in-dcbnl_flush_dev.patch diff --git a/queue-5.10/soc-fsl-guts-add-a-missing-memory-allocation-failure.patch b/queue-5.10/soc-fsl-guts-add-a-missing-memory-allocation-failure.patch new file mode 100644 index 00000000000..cff72ea64be --- /dev/null +++ b/queue-5.10/soc-fsl-guts-add-a-missing-memory-allocation-failure.patch @@ -0,0 +1,49 @@ +From d0a1485c7194f945eb9f86d76054445852f0dd56 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 3 Nov 2021 21:00:33 +0100 +Subject: soc: fsl: guts: Add a missing memory allocation failure check + +From: Christophe JAILLET + +[ Upstream commit b9abe942cda43a1d46a0fd96efb54f1aa909f757 ] + +If 'devm_kstrdup()' fails, we should return -ENOMEM. + +While at it, move the 'of_node_put()' call in the error handling path and +after the 'machine' has been copied. +Better safe than sorry. + +Fixes: a6fc3b698130 ("soc: fsl: add GUTS driver for QorIQ platforms") +Depends-on: fddacc7ff4dd ("soc: fsl: guts: Revert commit 3c0d64e867ed") +Suggested-by: Tyrel Datwyler +Signed-off-by: Christophe JAILLET +Signed-off-by: Li Yang +Signed-off-by: Sasha Levin +--- + drivers/soc/fsl/guts.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c +index 6d7465afd6fd..091e94c04f30 100644 +--- a/drivers/soc/fsl/guts.c ++++ b/drivers/soc/fsl/guts.c +@@ -160,9 +160,14 @@ static int fsl_guts_probe(struct platform_device *pdev) + root = of_find_node_by_path("/"); + if (of_property_read_string(root, "model", &machine)) + of_property_read_string_index(root, "compatible", 0, &machine); +- of_node_put(root); +- if (machine) ++ if (machine) { + soc_dev_attr.machine = devm_kstrdup(dev, machine, GFP_KERNEL); ++ if (!soc_dev_attr.machine) { ++ of_node_put(root); ++ return -ENOMEM; ++ } ++ } ++ of_node_put(root); + + svr = fsl_guts_get_svr(); + soc_die = fsl_soc_die_match(svr, fsl_soc_die); +-- +2.34.1 + diff --git a/queue-5.10/soc-fsl-guts-revert-commit-3c0d64e867ed.patch b/queue-5.10/soc-fsl-guts-revert-commit-3c0d64e867ed.patch new file mode 100644 index 00000000000..fe80a716282 --- /dev/null +++ b/queue-5.10/soc-fsl-guts-revert-commit-3c0d64e867ed.patch @@ -0,0 +1,66 @@ +From 73a0922ffb4cbe309413df19048ff3f4df276fe0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 3 Nov 2021 21:00:17 +0100 +Subject: soc: fsl: guts: Revert commit 3c0d64e867ed + +From: Christophe JAILLET + +[ Upstream commit b113737cf12964a20cc3ba1ddabe6229099661c6 ] + +This reverts commit 3c0d64e867ed +("soc: fsl: guts: reuse machine name from device tree"). + +A following patch will fix the missing memory allocation failure check +instead. + +Suggested-by: Tyrel Datwyler +Signed-off-by: Christophe JAILLET +Signed-off-by: Li Yang +Signed-off-by: Sasha Levin +--- + drivers/soc/fsl/guts.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c +index 34810f9bb2ee..6d7465afd6fd 100644 +--- a/drivers/soc/fsl/guts.c ++++ b/drivers/soc/fsl/guts.c +@@ -28,7 +28,6 @@ struct fsl_soc_die_attr { + static struct guts *guts; + static struct soc_device_attribute soc_dev_attr; + static struct soc_device *soc_dev; +-static struct device_node *root; + + + /* SoC die attribute definition for QorIQ platform */ +@@ -138,7 +137,7 @@ static u32 fsl_guts_get_svr(void) + + static int fsl_guts_probe(struct platform_device *pdev) + { +- struct device_node *np = pdev->dev.of_node; ++ struct device_node *root, *np = pdev->dev.of_node; + struct device *dev = &pdev->dev; + struct resource *res; + const struct fsl_soc_die_attr *soc_die; +@@ -161,8 +160,9 @@ static int fsl_guts_probe(struct platform_device *pdev) + root = of_find_node_by_path("/"); + if (of_property_read_string(root, "model", &machine)) + of_property_read_string_index(root, "compatible", 0, &machine); ++ of_node_put(root); + if (machine) +- soc_dev_attr.machine = machine; ++ soc_dev_attr.machine = devm_kstrdup(dev, machine, GFP_KERNEL); + + svr = fsl_guts_get_svr(); + soc_die = fsl_soc_die_match(svr, fsl_soc_die); +@@ -197,7 +197,6 @@ static int fsl_guts_probe(struct platform_device *pdev) + static int fsl_guts_remove(struct platform_device *dev) + { + soc_device_unregister(soc_dev); +- of_node_put(root); + return 0; + } + +-- +2.34.1 + diff --git a/queue-5.10/soc-fsl-qe-check-of-ioremap-return-value.patch b/queue-5.10/soc-fsl-qe-check-of-ioremap-return-value.patch new file mode 100644 index 00000000000..f058dded7c8 --- /dev/null +++ b/queue-5.10/soc-fsl-qe-check-of-ioremap-return-value.patch @@ -0,0 +1,43 @@ +From 29d0efa3a64dc8c23e7c70ab6121cf6171accb92 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 30 Dec 2021 09:45:43 +0800 +Subject: soc: fsl: qe: Check of ioremap return value + +From: Jiasheng Jiang + +[ Upstream commit a222fd8541394b36b13c89d1698d9530afd59a9c ] + +As the possible failure of the ioremap(), the par_io could be NULL. +Therefore it should be better to check it and return error in order to +guarantee the success of the initiation. +But, I also notice that all the caller like mpc85xx_qe_par_io_init() in +`arch/powerpc/platforms/85xx/common.c` don't check the return value of +the par_io_init(). +Actually, par_io_init() needs to check to handle the potential error. +I will submit another patch to fix that. +Anyway, par_io_init() itsely should be fixed. + +Fixes: 7aa1aa6ecec2 ("QE: Move QE from arch/powerpc to drivers/soc") +Signed-off-by: Jiasheng Jiang +Signed-off-by: Li Yang +Signed-off-by: Sasha Levin +--- + drivers/soc/fsl/qe/qe_io.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/soc/fsl/qe/qe_io.c b/drivers/soc/fsl/qe/qe_io.c +index 11ea08e97db7..1bb46d955d52 100644 +--- a/drivers/soc/fsl/qe/qe_io.c ++++ b/drivers/soc/fsl/qe/qe_io.c +@@ -35,6 +35,8 @@ int par_io_init(struct device_node *np) + if (ret) + return ret; + par_io = ioremap(res.start, resource_size(&res)); ++ if (!par_io) ++ return -ENOMEM; + + if (!of_property_read_u32(np, "num-ports", &num_ports)) + num_par_io_ports = num_ports; +-- +2.34.1 +