From: Greg Kroah-Hartman Date: Tue, 22 Jul 2025 08:47:10 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v6.1.147~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1dff7f90e95f962ba92849ca5bd42933a3a5b596;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: usb-dwc3-qcom-don-t-leave-bcr-asserted.patch usb-musb-fix-gadget-state-on-disconnect.patch --- diff --git a/queue-5.4/net-sched-return-null-when-htb_lookup_leaf-encounter.patch b/queue-5.4/net-sched-return-null-when-htb_lookup_leaf-encounter.patch index 91646c4a74..c7167ea456 100644 --- a/queue-5.4/net-sched-return-null-when-htb_lookup_leaf-encounter.patch +++ b/queue-5.4/net-sched-return-null-when-htb_lookup_leaf-encounter.patch @@ -74,14 +74,12 @@ Link: https://patch.msgid.link/20250717022816.221364-1-will@willsroot.io Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- - 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 - diff --git a/queue-5.4/series b/queue-5.4/series index dac54a8c5a..a2f6c8ac3d 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -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 index 0000000000..e792180b57 --- /dev/null +++ b/queue-5.4/usb-dwc3-qcom-don-t-leave-bcr-asserted.patch @@ -0,0 +1,66 @@ +From ef8abc0ba49ce717e6bc4124e88e59982671f3b5 Mon Sep 17 00:00:00 2001 +From: Krishna Kurapati +Date: Wed, 9 Jul 2025 18:59:00 +0530 +Subject: usb: dwc3: qcom: Don't leave BCR asserted + +From: Krishna Kurapati + +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 +Fixes: a4333c3a6ba9 ("usb: dwc3: Add Qualcomm DWC3 glue driver") +Acked-by: Thinh Nguyen +Reviewed-by: Konrad Dybcio +Signed-off-by: Krishna Kurapati +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 +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 0000000000..8d2a502d97 --- /dev/null +++ b/queue-5.4/usb-musb-fix-gadget-state-on-disconnect.patch @@ -0,0 +1,49 @@ +From 67a59f82196c8c4f50c83329f0577acfb1349b50 Mon Sep 17 00:00:00 2001 +From: Drew Hamilton +Date: Tue, 1 Jul 2025 11:41:26 -0400 +Subject: usb: musb: fix gadget state on disconnect + +From: Drew Hamilton + +commit 67a59f82196c8c4f50c83329f0577acfb1349b50 upstream. + +When unplugging the USB cable or disconnecting a gadget in usb peripheral mode with +echo "" > /sys/kernel/config/usb_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 +Signed-off-by: Yehowshua Immanuel +Signed-off-by: Drew Hamilton +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 +Signed-off-by: Greg Kroah-Hartman +--- + 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;