From: Wesley Cheng <quic_wcheng@quicinc.com>
To: <balbi@kernel.org>, <gregkh@linuxfoundation.org>,
<Thinh.Nguyen@synopsys.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-usb@vger.kernel.org>,
<quic_jackp@quicinc.com>, Wesley Cheng <quic_wcheng@quicinc.com>
Subject: [PATCH v4 3/9] usb: dwc3: gadget: Synchronize IRQ between soft connect/disconnect
Date: Wed, 17 Aug 2022 11:23:53 -0700 [thread overview]
Message-ID: <20220817182359.13550-4-quic_wcheng@quicinc.com> (raw)
In-Reply-To: <20220817182359.13550-1-quic_wcheng@quicinc.com>
Ensure that there are no pending events being handled in between soft
connect/disconnect transitions. As we are keeping interrupts enabled,
and EP0 events are still being serviced, this avoids any stale events from
being serviced.
Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
---
drivers/usb/dwc3/gadget.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 391e40c35747..3b83e3c4b932 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2569,6 +2569,8 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
return 0;
}
+ synchronize_irq(dwc->irq_gadget);
+
if (!is_on) {
ret = dwc3_gadget_soft_disconnect(dwc);
} else {
next prev parent reply other threads:[~2022-08-18 4:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-17 18:23 [PATCH v4 0/9] Fix controller halt and endxfer timeout issues Wesley Cheng
2022-08-17 18:23 ` [PATCH v4 1/9] usb: dwc3: Do not service EP0 and conndone events if soft disconnected Wesley Cheng
2022-08-17 18:23 ` [PATCH v4 2/9] usb: dwc3: gadget: Force sending delayed status during soft disconnect Wesley Cheng
2022-08-17 18:23 ` Wesley Cheng [this message]
2022-08-17 18:23 ` [PATCH v4 4/9] usb: dwc3: gadget: Continue handling EP0 xfercomplete events Wesley Cheng
2022-08-17 18:23 ` [PATCH v4 5/9] usb: dwc3: Avoid unmapping USB requests if endxfer is not complete Wesley Cheng
2022-08-30 14:08 ` Greg KH
2022-08-30 18:13 ` Wesley Cheng
2022-08-17 18:23 ` [PATCH v4 6/9] usb: dwc3: Remove DWC3 locking during gadget suspend/resume Wesley Cheng
2022-08-23 1:14 ` Thinh Nguyen
2022-08-17 18:23 ` [PATCH v4 7/9] usb: dwc3: Increase DWC3 controller halt timeout Wesley Cheng
2022-08-23 1:04 ` Thinh Nguyen
2022-08-17 18:23 ` [PATCH v4 8/9] usb: dwc3: gadget: Skip waiting for CMDACT cleared during endxfer Wesley Cheng
2022-08-17 18:23 ` [PATCH v4 9/9] usb: dwc3: gadget: Submit endxfer command if delayed during disconnect Wesley Cheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220817182359.13550-4-quic_wcheng@quicinc.com \
--to=quic_wcheng@quicinc.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=quic_jackp@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox