Linux USB
 help / color / mirror / Atom feed
From: Jeff Vanhoof <jdv1029@gmail.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, John Youn <John.Youn@synopsys.com>,
	stable@vger.kernel.org, Dan Vacura <w36195@motorola.com>
Subject: Re: [PATCH v2 2/2] usb: dwc3: gadget: Don't set IMI for no_interrupt
Date: Tue, 25 Oct 2022 15:05:29 -0500	[thread overview]
Message-ID: <20221025200527.GA11641@qjv001-XeonWs> (raw)
In-Reply-To: <20221025045148.GA15715@qjv001-XeonWs>

Hi Thinh,

On Mon, Oct 24, 2022 at 11:51:50PM -0500, Jeff Vanhoof wrote:
> On Mon, Oct 24, 2022 at 06:28:04PM -0700, Thinh Nguyen wrote:
> > The gadget driver may have a certain expectation of how the request
> > completion flow should be from to its configuration. Make sure the
> > controller driver respect that. That is, don't set IMI (Interrupt on
> > Missed Isoc) when usb_request->no_interrupt is set.
> > 
> > Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> > ---
> >  Changes in v2:
> >  - None
> > 
> >  drivers/usb/dwc3/gadget.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> > index 230b3c660054..702bdf42ad2f 100644
> > --- a/drivers/usb/dwc3/gadget.c
> > +++ b/drivers/usb/dwc3/gadget.c
> > @@ -1292,8 +1292,8 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
> >  			trb->ctrl = DWC3_TRBCTL_ISOCHRONOUS;
> >  		}
> >  
> > -		/* always enable Interrupt on Missed ISOC */
> > -		trb->ctrl |= DWC3_TRB_CTRL_ISP_IMI;
> > +		if (!req->request.no_interrupt)
> > +			trb->ctrl |= DWC3_TRB_CTRL_ISP_IMI;
> >  		break;
> >  
> >  	case USB_ENDPOINT_XFER_BULK:
> > -- 
> > 2.28.0
> >
> 
<snip>

For scatter gather, shouldn't the IMI bit be set only for the TRB associated
to the last item in the sg list?  Do we need to do something similar to what
that was done for IOC in this area?

For ex.:
+	if ((!req->request.no_interrupt && !chain) || must_interrupt)
+		trb->ctrl |= DWC3_TRB_CTRL_ISP_IMI;

BTW, Dan indicated that this seems to help resolve the crash mentioned in
[PATCH v2 1/2] of this chain.

Thanks,
Jeff


  reply	other threads:[~2022-10-25 20:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25  1:27 [PATCH v2 0/2] usb: dwc3: gadget: Fix isoc interrupt check Thinh Nguyen
2022-10-25  1:27 ` [PATCH v2 1/2] usb: dwc3: gadget: Stop processing more requests on IMI Thinh Nguyen
2022-10-25  4:45   ` Jeff Vanhoof
2022-10-25 16:42     ` Jeff Vanhoof
2022-10-25 18:22       ` Jeff Vanhoof
2022-10-25  1:28 ` [PATCH v2 2/2] usb: dwc3: gadget: Don't set IMI for no_interrupt Thinh Nguyen
2022-10-25  4:51   ` Jeff Vanhoof
2022-10-25 20:05     ` Jeff Vanhoof [this message]
2022-10-25 20:53       ` Thinh Nguyen
2022-10-25 21:28         ` Thinh Nguyen

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=20221025200527.GA11641@qjv001-XeonWs \
    --to=jdv1029@gmail.com \
    --cc=John.Youn@synopsys.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=w36195@motorola.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