RE: [PATCH v2 03/30] usb: dwc2: gadget: don't process XferCompl on setup packet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> -----Original Message-----
> From: Sergei Shtylyov [mailto:sergei.shtylyov@xxxxxxxxxxxxxxxxxx]
> Sent: Friday, January 2, 2015 6:09 PM
> To: Kaukab, Yousaf; linux-usb@xxxxxxxxxxxxxxx; balbi@xxxxxx
> Cc: Herrero, Gregory; paulz@xxxxxxxxxxxx; r.baldyga@xxxxxxxxxxx
> Subject: Re: [PATCH v2 03/30] usb: dwc2: gadget: don't process XferCompl on
> setup packet
> 
> Hello.
> 
> On 1/2/2015 5:42 PM, Mian Yousaf Kaukab wrote:
> 
> > Only process DOEPINT.XferCompl on data packet as DOEPINTn.SetUp can
> > occur with or without DOEPINT.XferCompl. When DOEPINT.SetUp occurs
> > with DOEPINT.XferCompl, only DOEPINT.SetUp needs to be handled.
> 
> > Moreover, ignore DOEPINT.XferCompl when it occurs with
> > DOEPINT.StupPktRcvd as driver needs to wait for DOEPINT.SetUp to
> > continue.
> 
> > Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@xxxxxxxxx>
> > ---
> >   drivers/usb/dwc2/gadget.c | 4 ++++
> >   drivers/usb/dwc2/hw.h     | 1 +
> >   2 files changed, 5 insertions(+)
> 
> > diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> > index 843f3ee..e190d68 100644
> > --- a/drivers/usb/dwc2/gadget.c
> > +++ b/drivers/usb/dwc2/gadget.c
> > @@ -1810,6 +1810,10 @@ static void s3c_hsotg_epint(struct dwc2_hsotg
> *hsotg, unsigned int idx,
> >   	dev_dbg(hsotg->dev, "%s: ep%d(%s) DxEPINT=0x%08x\n",
> >   		__func__, idx, dir_in ? "in" : "out", ints);
> >
> > +	/* Don't process XferCompl interrupt if it is a setup packet */
> > +	if (ints & DXEPINT_SETUP || ints & DXEPINT_SETUP_RCVD)
> 
> 	if (ints & (DXEPINT_SETUP | DXEPINT_SETUP_RCVD))

Sure.

In a rare case, DXEPINT_SETUP_RCVD was also set for a non-control endpoint. So I will modify the check to following:

	if (idx == 0 && (ints & (DXEPINT_SETUP | DXEPINT_SETUP_RCVD)))

> 
> [...]
> 
> WBR, Sergei

BR,
Yousaf
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux