Re: [PATCH 6/6] usb: dwc3: clear 'res_trans_idx' as soon as it becomes invalid

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

 



Hi,

On Mon, Feb 27, 2012 at 04:29:33PM +0200, Felipe Balbi wrote:
> Hi,
> 
> On Fri, Feb 24, 2012 at 05:32:18PM -0800, Paul Zimmerman wrote:
> > Transfer resource index is cleared in hardware when XFERCOMPLETE
> > event is generated, so clear the driver's res_trans_idx variable
> > immediately after that event is received. The upcoming hibernation
> > patches depend on this change.
> > 
> > Signed-off-by: Paul Zimmerman <paulz@xxxxxxxxxxxx>
> > ---
> >  drivers/usb/dwc3/ep0.c    |    1 +
> >  drivers/usb/dwc3/gadget.c |    6 +++---
> >  2 files changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
> > index bf48e2c..25910e2 100644
> > --- a/drivers/usb/dwc3/ep0.c
> > +++ b/drivers/usb/dwc3/ep0.c
> > @@ -617,6 +617,7 @@ static void dwc3_ep0_xfer_complete(struct dwc3 *dwc,
> >  	struct dwc3_ep		*dep = dwc->eps[event->endpoint_number];
> >  
> >  	dep->flags &= ~DWC3_EP_BUSY;
> > +	dep->res_trans_idx = 0;
> >  	dwc->setup_packet_pending = false;
> >  
> >  	switch (dwc->ep0state) {
> > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> > index d94c77b0..3430dbb 100644
> > --- a/drivers/usb/dwc3/gadget.c
> > +++ b/drivers/usb/dwc3/gadget.c
> > @@ -1577,10 +1577,8 @@ static void dwc3_endpoint_transfer_complete(struct dwc3 *dwc,
> >  		status = -ECONNRESET;
> >  
> >  	clean_busy = dwc3_cleanup_done_reqs(dwc, dep, event, status);
> > -	if (clean_busy) {
> > +	if (clean_busy)
> >  		dep->flags &= ~DWC3_EP_BUSY;
> > -		dep->res_trans_idx = 0;
> > -	}
> >  
> >  	/*
> >  	 * WORKAROUND: This is the 2nd half of U1/U2 -> U0 workaround.
> > @@ -1685,6 +1683,8 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
> >  
> >  	switch (event->endpoint_event) {
> >  	case DWC3_DEPEVT_XFERCOMPLETE:
> > +		dep->res_trans_idx = 0;
> 
> Surely you don't need to clear it twice. I have fixed this one myself.

My eyes tricked me, sorry. first hunk in on ep0 handling. I'll apply as
is, thanks

-- 
balbi

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux