From: Greg Kroah-Hartman Date: Tue, 12 Aug 2025 13:31:43 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v6.1.148~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d8a6f0d84d886691a917d84f9cd5183f627bcb65;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: usb-hub-fix-flushing-and-scheduling-of-delayed-work-that-tunes-runtime-pm.patch --- diff --git a/queue-5.4/series b/queue-5.4/series index e86a46886b..1408b65db5 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -52,6 +52,7 @@ net_sched-sch_sfq-use-a-temporary-work-area-for-validating-configuration.patch net_sched-sch_sfq-move-the-limit-validation.patch net_sched-sch_sfq-reject-invalid-perturb-period.patch usb-hub-fix-detection-of-high-tier-usb3-devices-behind-suspended-hubs.patch +usb-hub-fix-flushing-and-scheduling-of-delayed-work-that-tunes-runtime-pm.patch regulator-core-fix-null-dereference-on-unbind-due-to.patch rdma-core-rate-limit-gid-cache-warning-messages.patch net-appletalk-fix-kerneldoc-warnings.patch diff --git a/queue-5.4/usb-hub-fix-flushing-and-scheduling-of-delayed-work-that-tunes-runtime-pm.patch b/queue-5.4/usb-hub-fix-flushing-and-scheduling-of-delayed-work-that-tunes-runtime-pm.patch new file mode 100644 index 0000000000..3a94ad9e78 --- /dev/null +++ b/queue-5.4/usb-hub-fix-flushing-and-scheduling-of-delayed-work-that-tunes-runtime-pm.patch @@ -0,0 +1,64 @@ +From a49e1e2e785fb3621f2d748581881b23a364998a Mon Sep 17 00:00:00 2001 +From: Mathias Nyman +Date: Thu, 26 Jun 2025 16:01:02 +0300 +Subject: usb: hub: Fix flushing and scheduling of delayed work that tunes runtime pm + +From: Mathias Nyman + +commit a49e1e2e785fb3621f2d748581881b23a364998a upstream. + +Delayed work to prevent USB3 hubs from runtime-suspending immediately +after resume was added in commit 8f5b7e2bec1c ("usb: hub: fix detection +of high tier USB3 devices behind suspended hubs"). + +This delayed work needs be flushed if system suspends, or hub needs to +be quiesced for other reasons right after resume. Not flushing it +triggered issues on QC SC8280XP CRD board during suspend/resume testing. + +Fix it by flushing the delayed resume work in hub_quiesce() + +The delayed work item that allow hub runtime suspend is also scheduled +just before calling autopm get. Alan pointed out there is a small risk +that work is run before autopm get, which would call autopm put before +get, and mess up the runtime pm usage order. +Swap the order of work sheduling and calling autopm get to solve this. + +Cc: stable +Fixes: 8f5b7e2bec1c ("usb: hub: fix detection of high tier USB3 devices behind suspended hubs") +Reported-by: Konrad Dybcio +Closes: https://lore.kernel.org/linux-usb/acaaa928-832c-48ca-b0ea-d202d5cd3d6c@oss.qualcomm.com +Reported-by: Alan Stern +Closes: https://lore.kernel.org/linux-usb/c73fbead-66d7-497a-8fa1-75ea4761090a@rowland.harvard.edu +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20250626130102.3639861-2-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/core/hub.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -1315,11 +1315,12 @@ static void hub_activate(struct usb_hub + + if (type == HUB_RESUME && hub_is_superspeed(hub->hdev)) { + /* give usb3 downstream links training time after hub resume */ ++ usb_autopm_get_interface_no_resume( ++ to_usb_interface(hub->intfdev)); ++ + INIT_DELAYED_WORK(&hub->init_work, hub_post_resume); + queue_delayed_work(system_power_efficient_wq, &hub->init_work, + msecs_to_jiffies(USB_SS_PORT_U0_WAKE_TIME)); +- usb_autopm_get_interface_no_resume( +- to_usb_interface(hub->intfdev)); + return; + } + +@@ -1373,6 +1374,7 @@ static void hub_quiesce(struct usb_hub * + + /* Stop hub_wq and related activity */ + del_timer_sync(&hub->irq_urb_retry); ++ flush_delayed_work(&hub->init_work); + usb_kill_urb(hub->urb); + if (hub->has_indicators) + cancel_delayed_work_sync(&hub->leds);