]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jul 2025 08:47:10 +0000 (10:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jul 2025 08:47:10 +0000 (10:47 +0200)
added patches:
usb-dwc3-qcom-don-t-leave-bcr-asserted.patch
usb-musb-fix-gadget-state-on-disconnect.patch

queue-5.4/net-sched-return-null-when-htb_lookup_leaf-encounter.patch
queue-5.4/series
queue-5.4/usb-dwc3-qcom-don-t-leave-bcr-asserted.patch [new file with mode: 0644]
queue-5.4/usb-musb-fix-gadget-state-on-disconnect.patch [new file with mode: 0644]

index 91646c4a7451dd421a0833f85703ab11450c6de7..c7167ea456b80351a54e83cfa48ba08a78f94498 100644 (file)
@@ -74,14 +74,12 @@ Link: https://patch.msgid.link/20250717022816.221364-1-will@willsroot.io
 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- net/sched/sch_htb.c | 4 +++-
+ net/sched/sch_htb.c |    4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
 
-diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
-index c618aae25b099..2562219ccca4b 100644
 --- a/net/sched/sch_htb.c
 +++ b/net/sched/sch_htb.c
-@@ -776,7 +776,9 @@ static struct htb_class *htb_lookup_leaf(struct htb_prio *hprio, const int prio)
+@@ -776,7 +776,9 @@ static struct htb_class *htb_lookup_leaf
                u32 *pid;
        } stk[TC_HTB_MAXDEPTH], *sp = stk;
  
@@ -92,6 +90,3 @@ index c618aae25b099..2562219ccca4b 100644
        sp->root = hprio->row.rb_node;
        sp->pptr = &hprio->ptr;
        sp->pid = &hprio->last_ptr_id;
--- 
-2.39.5
-
index dac54a8c5aa9b8efd0508a95c926478196ce0afa..a2f6c8ac3dc4e645dd479572da7c1cf39b76f860 100644 (file)
@@ -37,3 +37,5 @@ bluetooth-smp-fix-using-hci_error_remote_user_term-o.patch
 bluetooth-l2cap-fix-attempting-to-adjust-outgoing-mt.patch
 net-vlan-fix-vlan-0-refcount-imbalance-of-toggling-f.patch
 net-sched-return-null-when-htb_lookup_leaf-encounter.patch
+usb-musb-fix-gadget-state-on-disconnect.patch
+usb-dwc3-qcom-don-t-leave-bcr-asserted.patch
diff --git a/queue-5.4/usb-dwc3-qcom-don-t-leave-bcr-asserted.patch b/queue-5.4/usb-dwc3-qcom-don-t-leave-bcr-asserted.patch
new file mode 100644 (file)
index 0000000..e792180
--- /dev/null
@@ -0,0 +1,66 @@
+From ef8abc0ba49ce717e6bc4124e88e59982671f3b5 Mon Sep 17 00:00:00 2001
+From: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
+Date: Wed, 9 Jul 2025 18:59:00 +0530
+Subject: usb: dwc3: qcom: Don't leave BCR asserted
+
+From: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
+
+commit ef8abc0ba49ce717e6bc4124e88e59982671f3b5 upstream.
+
+Leaving the USB BCR asserted prevents the associated GDSC to turn on. This
+blocks any subsequent attempts of probing the device, e.g. after a probe
+deferral, with the following showing in the log:
+
+[    1.332226] usb30_prim_gdsc status stuck at 'off'
+
+Leave the BCR deasserted when exiting the driver to avoid this issue.
+
+Cc: stable <stable@kernel.org>
+Fixes: a4333c3a6ba9 ("usb: dwc3: Add Qualcomm DWC3 glue driver")
+Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
+Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
+Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
+Link: https://lore.kernel.org/r/20250709132900.3408752-1-krishna.kurapati@oss.qualcomm.com
+[ adapted to individual clock management API instead of bulk clock operations ]
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/dwc3/dwc3-qcom.c |    8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+--- a/drivers/usb/dwc3/dwc3-qcom.c
++++ b/drivers/usb/dwc3/dwc3-qcom.c
+@@ -615,13 +615,13 @@ static int dwc3_qcom_probe(struct platfo
+       ret = reset_control_deassert(qcom->resets);
+       if (ret) {
+               dev_err(&pdev->dev, "failed to deassert resets, err=%d\n", ret);
+-              goto reset_assert;
++              return ret;
+       }
+       ret = dwc3_qcom_clk_init(qcom, of_clk_get_parent_count(np));
+       if (ret) {
+               dev_err(dev, "failed to get clocks\n");
+-              goto reset_assert;
++              return ret;
+       }
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+@@ -700,8 +700,6 @@ clk_disable:
+               clk_disable_unprepare(qcom->clks[i]);
+               clk_put(qcom->clks[i]);
+       }
+-reset_assert:
+-      reset_control_assert(qcom->resets);
+       return ret;
+ }
+@@ -725,8 +723,6 @@ static int dwc3_qcom_remove(struct platf
+       }
+       qcom->num_clocks = 0;
+-      reset_control_assert(qcom->resets);
+-
+       pm_runtime_allow(dev);
+       pm_runtime_disable(dev);
diff --git a/queue-5.4/usb-musb-fix-gadget-state-on-disconnect.patch b/queue-5.4/usb-musb-fix-gadget-state-on-disconnect.patch
new file mode 100644 (file)
index 0000000..8d2a502
--- /dev/null
@@ -0,0 +1,49 @@
+From 67a59f82196c8c4f50c83329f0577acfb1349b50 Mon Sep 17 00:00:00 2001
+From: Drew Hamilton <drew.hamilton@zetier.com>
+Date: Tue, 1 Jul 2025 11:41:26 -0400
+Subject: usb: musb: fix gadget state on disconnect
+
+From: Drew Hamilton <drew.hamilton@zetier.com>
+
+commit 67a59f82196c8c4f50c83329f0577acfb1349b50 upstream.
+
+When unplugging the USB cable or disconnecting a gadget in usb peripheral mode with
+echo "" > /sys/kernel/config/usb_gadget/<your_gadget>/UDC,
+/sys/class/udc/musb-hdrc.0/state does not change from USB_STATE_CONFIGURED.
+
+Testing on dwc2/3 shows they both update the state to USB_STATE_NOTATTACHED.
+
+Add calls to usb_gadget_set_state in musb_g_disconnect and musb_gadget_stop
+to fix both cases.
+
+Fixes: 49401f4169c0 ("usb: gadget: introduce gadget state tracking")
+Cc: stable@vger.kernel.org
+Co-authored-by: Yehowshua Immanuel <yehowshua.immanuel@twosixtech.com>
+Signed-off-by: Yehowshua Immanuel <yehowshua.immanuel@twosixtech.com>
+Signed-off-by: Drew Hamilton <drew.hamilton@zetier.com>
+Link: https://lore.kernel.org/r/20250701154126.8543-1-drew.hamilton@zetier.com
+[ replaced musb_set_state() call with direct otg state assignment ]
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/musb/musb_gadget.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/usb/musb/musb_gadget.c
++++ b/drivers/usb/musb/musb_gadget.c
+@@ -1910,6 +1910,7 @@ static int musb_gadget_stop(struct usb_g
+        * gadget driver here and have everything work;
+        * that currently misbehaves.
+        */
++      usb_gadget_set_state(g, USB_STATE_NOTATTACHED);
+       /* Force check of devctl register for PM runtime */
+       schedule_delayed_work(&musb->irq_work, 0);
+@@ -2018,6 +2019,7 @@ void musb_g_disconnect(struct musb *musb
+       case OTG_STATE_B_PERIPHERAL:
+       case OTG_STATE_B_IDLE:
+               musb->xceiv->otg->state = OTG_STATE_B_IDLE;
++              usb_gadget_set_state(&musb->g, USB_STATE_NOTATTACHED);
+               break;
+       case OTG_STATE_B_SRP_INIT:
+               break;