* [PATCH] usb: dwc3: meson-g12a: do post init to fix broken usb after resumption
@ 2023-08-08 3:25 Luke Lu
2023-08-08 4:56 ` Greg Kroah-Hartman
0 siblings, 1 reply; 6+ messages in thread
From: Luke Lu @ 2023-08-08 3:25 UTC (permalink / raw)
To: Neil Armstrong, linux-usb, linux-amlogic
Cc: Thinh Nguyen, Greg Kroah-Hartman, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Da Xue, linux-arm-kernel, linux-kernel,
Luke Lu
Device connected to usb otg port of GXL-based boards can not be
recognised after resumption, doesn't recover even if disconnect and
reconnect the device. dmesg shows it disconnects during resumption.
[ 41.492911] usb 1-2: USB disconnect, device number 3
[ 41.499346] usb 1-2: unregistering device
[ 41.511939] usb 1-2: unregistering interface 1-2:1.0
Calling usb_post_init() will fix this issue, and it's tested and
verified on libretech's aml-s905x-cc board.
Signed-off-by: Luke Lu <luke.lu@libre.computer>
---
drivers/usb/dwc3/dwc3-meson-g12a.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
index e99c7489dba0..2c07c038b584 100644
--- a/drivers/usb/dwc3/dwc3-meson-g12a.c
+++ b/drivers/usb/dwc3/dwc3-meson-g12a.c
@@ -926,6 +926,12 @@ static int __maybe_unused dwc3_meson_g12a_resume(struct device *dev)
return ret;
}
+ if (priv->drvdata->usb_post_init) {
+ ret = priv->drvdata->usb_post_init(priv);
+ if (ret)
+ return ret;
+ }
+
return 0;
}
--
2.40.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] usb: dwc3: meson-g12a: do post init to fix broken usb after resumption
2023-08-08 3:25 [PATCH] usb: dwc3: meson-g12a: do post init to fix broken usb after resumption Luke Lu
@ 2023-08-08 4:56 ` Greg Kroah-Hartman
2023-08-08 5:33 ` Da Xue
2023-08-08 6:09 ` Luke Lu
0 siblings, 2 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2023-08-08 4:56 UTC (permalink / raw)
To: Luke Lu
Cc: Neil Armstrong, linux-usb, linux-amlogic, Thinh Nguyen,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Da Xue,
linux-arm-kernel, linux-kernel
On Tue, Aug 08, 2023 at 03:25:10AM +0000, Luke Lu wrote:
> Device connected to usb otg port of GXL-based boards can not be
> recognised after resumption, doesn't recover even if disconnect and
> reconnect the device. dmesg shows it disconnects during resumption.
>
> [ 41.492911] usb 1-2: USB disconnect, device number 3
> [ 41.499346] usb 1-2: unregistering device
> [ 41.511939] usb 1-2: unregistering interface 1-2:1.0
>
> Calling usb_post_init() will fix this issue, and it's tested and
> verified on libretech's aml-s905x-cc board.
>
> Signed-off-by: Luke Lu <luke.lu@libre.computer>
What commit id does this fix? Should it also go to stable kernels?
thanks,
greg k-h
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] usb: dwc3: meson-g12a: do post init to fix broken usb after resumption
2023-08-08 4:56 ` Greg Kroah-Hartman
@ 2023-08-08 5:33 ` Da Xue
2023-08-08 6:10 ` Greg Kroah-Hartman
2023-08-08 6:09 ` Luke Lu
1 sibling, 1 reply; 6+ messages in thread
From: Da Xue @ 2023-08-08 5:33 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Luke Lu, Neil Armstrong, linux-usb, linux-amlogic, Thinh Nguyen,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Da Xue,
linux-arm-kernel, linux-kernel
On Tue, Aug 8, 2023 at 12:56 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Tue, Aug 08, 2023 at 03:25:10AM +0000, Luke Lu wrote:
> > Device connected to usb otg port of GXL-based boards can not be
> > recognised after resumption, doesn't recover even if disconnect and
> > reconnect the device. dmesg shows it disconnects during resumption.
> >
> > [ 41.492911] usb 1-2: USB disconnect, device number 3
> > [ 41.499346] usb 1-2: unregistering device
> > [ 41.511939] usb 1-2: unregistering interface 1-2:1.0
> >
> > Calling usb_post_init() will fix this issue, and it's tested and
> > verified on libretech's aml-s905x-cc board.
> >
> > Signed-off-by: Luke Lu <luke.lu@libre.computer>
>
> What commit id does this fix? Should it also go to stable kernels?
Hi Greg,
Suspend device tree flag has not been enabled in-tree for the Amlogic
GXL (S805X/S905X/S905D) series due it having PSCI 0.2 and thus never
untested. Most of the suspend resume code was only tested on newer
G12A/B series.
This and "[PATCH v3] net: phy: meson-gxl: implement
meson_gxl_phy_resume()" fixes USB and Ethernet after resume. HDMI
requires another fix.
It would be great if they could go into stable since we are carrying
these two patches in our tree on 6.1 and they're applicable back to
5.4 but I am not sure what the criteria is.
Best,
Da
>
> thanks,
>
> greg k-h
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] usb: dwc3: meson-g12a: do post init to fix broken usb after resumption
2023-08-08 4:56 ` Greg Kroah-Hartman
2023-08-08 5:33 ` Da Xue
@ 2023-08-08 6:09 ` Luke Lu
2023-08-08 8:17 ` Greg Kroah-Hartman
1 sibling, 1 reply; 6+ messages in thread
From: Luke Lu @ 2023-08-08 6:09 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Neil Armstrong, linux-usb, linux-amlogic, Thinh Nguyen,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Da Xue,
linux-arm-kernel, linux-kernel
HI Greg:
On Tue, Aug 8, 2023 at 4:56 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Tue, Aug 08, 2023 at 03:25:10AM +0000, Luke Lu wrote:
> > Device connected to usb otg port of GXL-based boards can not be
> > recognised after resumption, doesn't recover even if disconnect and
> > reconnect the device. dmesg shows it disconnects during resumption.
> >
> > [ 41.492911] usb 1-2: USB disconnect, device number 3
> > [ 41.499346] usb 1-2: unregistering device
> > [ 41.511939] usb 1-2: unregistering interface 1-2:1.0
> >
> > Calling usb_post_init() will fix this issue, and it's tested and
> > verified on libretech's aml-s905x-cc board.
> >
> > Signed-off-by: Luke Lu <luke.lu@libre.computer>
>
> What commit id does this fix?
Using "git blame" to explore the history, found dwc3_meson_g12a_resume() was
introduced along with the file of drivers/usb/dwc3/dwc3-meson-g12a.c.
as Da Xue pointed out, the suspend/resume was never tested in GXL based SoC,
so it's broken since the beginning..
For the Fixes tag, I think it's proper to use "5b0ba0caaf3a: (usb:
dwc3: meson-g12a: refactor usb init)"
since the usb_post_init() function was introduced in this commit and
this patch will depend on it.
> Should it also go to stable kernels?
>
Yes, It would be great if the patch can go to stable tree, thanks for
suggesting this
I have it tested on 6.1-lts tree.
Btw, I would wait for a few days for more comments and CC to stable in
next v2 if no objection.
> thanks,
>
> greg k-h
Luke
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] usb: dwc3: meson-g12a: do post init to fix broken usb after resumption
2023-08-08 5:33 ` Da Xue
@ 2023-08-08 6:10 ` Greg Kroah-Hartman
0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2023-08-08 6:10 UTC (permalink / raw)
To: Da Xue
Cc: Luke Lu, Neil Armstrong, linux-usb, linux-amlogic, Thinh Nguyen,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
linux-arm-kernel, linux-kernel
On Tue, Aug 08, 2023 at 01:33:45AM -0400, Da Xue wrote:
> On Tue, Aug 8, 2023 at 12:56 AM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > On Tue, Aug 08, 2023 at 03:25:10AM +0000, Luke Lu wrote:
> > > Device connected to usb otg port of GXL-based boards can not be
> > > recognised after resumption, doesn't recover even if disconnect and
> > > reconnect the device. dmesg shows it disconnects during resumption.
> > >
> > > [ 41.492911] usb 1-2: USB disconnect, device number 3
> > > [ 41.499346] usb 1-2: unregistering device
> > > [ 41.511939] usb 1-2: unregistering interface 1-2:1.0
> > >
> > > Calling usb_post_init() will fix this issue, and it's tested and
> > > verified on libretech's aml-s905x-cc board.
> > >
> > > Signed-off-by: Luke Lu <luke.lu@libre.computer>
> >
> > What commit id does this fix? Should it also go to stable kernels?
>
> Hi Greg,
>
> Suspend device tree flag has not been enabled in-tree for the Amlogic
> GXL (S805X/S905X/S905D) series due it having PSCI 0.2 and thus never
> untested. Most of the suspend resume code was only tested on newer
> G12A/B series.
>
> This and "[PATCH v3] net: phy: meson-gxl: implement
> meson_gxl_phy_resume()" fixes USB and Ethernet after resume. HDMI
> requires another fix.
>
> It would be great if they could go into stable since we are carrying
> these two patches in our tree on 6.1 and they're applicable back to
> 5.4 but I am not sure what the criteria is.
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
has the criteria. If you think it should go there, then please resend
with a cc: stable tag in the signed-off-by area.
thanks,
greg k-h
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] usb: dwc3: meson-g12a: do post init to fix broken usb after resumption
2023-08-08 6:09 ` Luke Lu
@ 2023-08-08 8:17 ` Greg Kroah-Hartman
0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2023-08-08 8:17 UTC (permalink / raw)
To: Luke Lu
Cc: Neil Armstrong, linux-usb, linux-amlogic, Thinh Nguyen,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Da Xue,
linux-arm-kernel, linux-kernel
On Tue, Aug 08, 2023 at 06:09:45AM +0000, Luke Lu wrote:
> HI Greg:
>
> On Tue, Aug 8, 2023 at 4:56 AM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > On Tue, Aug 08, 2023 at 03:25:10AM +0000, Luke Lu wrote:
> > > Device connected to usb otg port of GXL-based boards can not be
> > > recognised after resumption, doesn't recover even if disconnect and
> > > reconnect the device. dmesg shows it disconnects during resumption.
> > >
> > > [ 41.492911] usb 1-2: USB disconnect, device number 3
> > > [ 41.499346] usb 1-2: unregistering device
> > > [ 41.511939] usb 1-2: unregistering interface 1-2:1.0
> > >
> > > Calling usb_post_init() will fix this issue, and it's tested and
> > > verified on libretech's aml-s905x-cc board.
> > >
> > > Signed-off-by: Luke Lu <luke.lu@libre.computer>
> >
> > What commit id does this fix?
> Using "git blame" to explore the history, found dwc3_meson_g12a_resume() was
> introduced along with the file of drivers/usb/dwc3/dwc3-meson-g12a.c.
> as Da Xue pointed out, the suspend/resume was never tested in GXL based SoC,
> so it's broken since the beginning..
>
> For the Fixes tag, I think it's proper to use "5b0ba0caaf3a: (usb:
> dwc3: meson-g12a: refactor usb init)"
> since the usb_post_init() function was introduced in this commit and
> this patch will depend on it.
>
> > Should it also go to stable kernels?
> >
> Yes, It would be great if the patch can go to stable tree, thanks for
> suggesting this
> I have it tested on 6.1-lts tree.
>
> Btw, I would wait for a few days for more comments and CC to stable in
> next v2 if no objection.
No worries, I'll drop this from my review queue and wait for a v2.
thanks,
greg k-h
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-08-08 8:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-08 3:25 [PATCH] usb: dwc3: meson-g12a: do post init to fix broken usb after resumption Luke Lu
2023-08-08 4:56 ` Greg Kroah-Hartman
2023-08-08 5:33 ` Da Xue
2023-08-08 6:10 ` Greg Kroah-Hartman
2023-08-08 6:09 ` Luke Lu
2023-08-08 8:17 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).