* [PATCH] usb: dwc3: gadget: Avoid duplicate requests to enable Run/Stop
@ 2022-07-25 20:11 Wesley Cheng
2022-07-26 15:43 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Wesley Cheng @ 2022-07-25 20:11 UTC (permalink / raw)
To: balbi, gregkh
Cc: linux-kernel, linux-usb, quic_jackp, quic_mrana, Thinh.Nguyen,
Wesley Cheng
Relocate the pullups_connected check until after it is ensured that there
are no runtime PM transitions. If another context triggered the DWC3
core's runtime resume, it may have already enabled the Run/Stop. Do not
re-run the entire pullup sequence again, as it may issue a core soft
reset while Run/Stop is already set.
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
---
drivers/usb/dwc3/gadget.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index aeeec751c53c..67b1039c664c 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2539,9 +2539,6 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
is_on = !!is_on;
- if (dwc->pullups_connected == is_on)
- return 0;
-
dwc->softconnect = is_on;
/*
@@ -2566,6 +2563,9 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
return 0;
}
+ if (dwc->pullups_connected == is_on)
+ return 0;
+
if (!is_on) {
ret = dwc3_gadget_soft_disconnect(dwc);
} else {
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] usb: dwc3: gadget: Avoid duplicate requests to enable Run/Stop
2022-07-25 20:11 [PATCH] usb: dwc3: gadget: Avoid duplicate requests to enable Run/Stop Wesley Cheng
@ 2022-07-26 15:43 ` Greg KH
2022-07-26 19:41 ` Wesley Cheng
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2022-07-26 15:43 UTC (permalink / raw)
To: Wesley Cheng
Cc: balbi, linux-kernel, linux-usb, quic_jackp, quic_mrana, Thinh.Nguyen
On Mon, Jul 25, 2022 at 01:11:36PM -0700, Wesley Cheng wrote:
> Relocate the pullups_connected check until after it is ensured that there
> are no runtime PM transitions. If another context triggered the DWC3
> core's runtime resume, it may have already enabled the Run/Stop. Do not
> re-run the entire pullup sequence again, as it may issue a core soft
> reset while Run/Stop is already set.
>
> Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
What commit does this fix?
How far back should it go to stable kernels?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] usb: dwc3: gadget: Avoid duplicate requests to enable Run/Stop
2022-07-26 15:43 ` Greg KH
@ 2022-07-26 19:41 ` Wesley Cheng
0 siblings, 0 replies; 3+ messages in thread
From: Wesley Cheng @ 2022-07-26 19:41 UTC (permalink / raw)
To: Greg KH
Cc: balbi, linux-kernel, linux-usb, quic_jackp, quic_mrana, Thinh.Nguyen
Hi Greg,
On 7/26/2022 8:43 AM, Greg KH wrote:
> On Mon, Jul 25, 2022 at 01:11:36PM -0700, Wesley Cheng wrote:
>> Relocate the pullups_connected check until after it is ensured that there
>> are no runtime PM transitions. If another context triggered the DWC3
>> core's runtime resume, it may have already enabled the Run/Stop. Do not
>> re-run the entire pullup sequence again, as it may issue a core soft
>> reset while Run/Stop is already set.
>>
>> Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
>
> What commit does this fix?
>
> How far back should it go to stable kernels?
>
Let met add a fixes tag and resubmit. Thanks!
Thanks
Wesley Cheng
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-26 19:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-25 20:11 [PATCH] usb: dwc3: gadget: Avoid duplicate requests to enable Run/Stop Wesley Cheng
2022-07-26 15:43 ` Greg KH
2022-07-26 19:41 ` Wesley Cheng
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.