From: Jack Pham <quic_jackp@quicinc.com>
To: Wesley Cheng <quic_wcheng@quicinc.com>
Cc: <balbi@kernel.org>, <gregkh@linuxfoundation.org>,
<Thinh.Nguyen@synopsys.com>, <linux-kernel@vger.kernel.org>,
<linux-usb@vger.kernel.org>
Subject: Re: [PATCH v6 1/5] usb: dwc3: Avoid unmapping USB requests if endxfer is not complete
Date: Thu, 1 Sep 2022 12:27:12 -0700 [thread overview]
Message-ID: <20220901192712.GB19313@jackp-linux.qualcomm.com> (raw)
In-Reply-To: <20220901192154.GA19313@jackp-linux.qualcomm.com>
On Thu, Sep 01, 2022 at 12:22:47PM -0700, Jack Pham wrote:
> Hi Wesley,
>
> On Thu, Sep 01, 2022 at 11:43:10AM -0700, Wesley Cheng wrote:
> > If DWC3_EP_DELAYED_STOP is set during stop active transfers, then do not
> > continue attempting to unmap request buffers during dwc3_remove_requests().
> > This can lead to SMMU faults, as the controller has not stopped the
> > processing of the TRB. Defer this sequence to the EP0 out start, which
> > ensures that there are no pending SETUP transactions before issuing the
> > endxfer.
> >
> > Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> > Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
> > ---
> > drivers/usb/dwc3/core.h | 3 +++
> > drivers/usb/dwc3/ep0.c | 5 ++++-
> > drivers/usb/dwc3/gadget.c | 6 +++++-
> > 3 files changed, 12 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> > index 4fe4287dc934..7d5d2507244b 100644
> > --- a/drivers/usb/dwc3/core.h
> > +++ b/drivers/usb/dwc3/core.h
> > @@ -1560,6 +1560,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned int cmd,
> > int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned int cmd,
> > u32 param);
> > void dwc3_gadget_clear_tx_fifos(struct dwc3 *dwc);
> > +void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep, int status);
> > #else
> > static inline int dwc3_gadget_init(struct dwc3 *dwc)
> > { return 0; }
> > @@ -1581,6 +1582,8 @@ static inline int dwc3_send_gadget_generic_command(struct dwc3 *dwc,
> > { return 0; }
> > static inline void dwc3_gadget_clear_tx_fifos(struct dwc3 *dwc)
> > { }
> > +static inline void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep)
>
> Oops, you missed updating this with the additional 'status' parameter as
> well.
Actually, why even bother having this stub at all? This would only be
when neither CONFIG_USB_DWC3_GADGET nor CONFIG_USB_DWC3_DUAL_ROLE are
enabled, but ep0.c itself wouldn't even be compiled in that case.
Jack
next prev parent reply other threads:[~2022-09-01 19:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-01 18:43 [PATCH v6 0/5] Fix controller halt and endxfer timeout issues Wesley Cheng
2022-09-01 18:43 ` [PATCH v6 1/5] usb: dwc3: Avoid unmapping USB requests if endxfer is not complete Wesley Cheng
2022-09-01 19:22 ` Jack Pham
2022-09-01 19:27 ` Jack Pham [this message]
2022-09-01 18:43 ` [PATCH v6 2/5] usb: dwc3: Remove DWC3 locking during gadget suspend/resume Wesley Cheng
2022-09-01 18:43 ` [PATCH v6 3/5] usb: dwc3: Increase DWC3 controller halt timeout Wesley Cheng
2022-09-01 18:43 ` [PATCH v6 4/5] usb: dwc3: gadget: Skip waiting for CMDACT cleared during endxfer Wesley Cheng
2022-09-01 18:43 ` [PATCH v6 5/5] 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=20220901192712.GB19313@jackp-linux.qualcomm.com \
--to=quic_jackp@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_wcheng@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