Re: [PATCH 8/8] usb: dwc3: gadget: always enable IOC on bulk/interrupt transfers

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

 



Hi Balbi,

On Tue, May 13, 2014 at 11:17:02PM +0800, Felipe Balbi wrote:
> Hi,
> 
> On Fri, May 09, 2014 at 11:25:46AM +0530, Pratyush Anand wrote:
> > On Tue, May 06, 2014 at 02:22:12PM +0800, Amit VIRDI wrote:
> > > On 5/6/2014 12:56 AM, Felipe Balbi wrote:
> > > >> I understand that enabling XferInProgress event for bulk/interrupt
> > > >> >transfers will completely
> > > >> >change the design of the dwc3 driver and hence is not the viable solution
> > > >> >to the issue here.
> > > > just send a patch enabling XferInProgress.. I haven't gotten to it yet.
> > > > If you beat me to it, more power for you;-)
> > > 
> > > Enabling XferInProgress event for bulk and interrupt would incur 
> > > significant testing efforts. Till it is done can we revert this patch as 
> > > it isn't correct conceptually?
> > 
> > Its not just enabling the xferinprogress event for bulk and interrupt
> > and things will start working. DWC3 driver has been written in such a
> > way that it handle all isoc transfer using xferinprogress event and
> > other transfers using xfercomplete event. So you will have to make
> > changes at couple of more places to get that working and then a through
> > stress testing.
> > 
> > @Felip: As per my understanding too, this patch must be reverted.
> > Enabling IOC for bulk and interrupt without enabling xferinprogress
> > for them does not make sense.
> 
> it also causes no extra overhead because the event won't fire anyway.

No..Still there could be issue. If I analyze the situation Amit had
described, I see a problem after this patch.

You have 8 Bulk/Intr TRBs. 1-7 with only IOC and 8th with IOC + LST.
So, you will receive interrupt when 8th TRB is completed.

dwc3_endpoint_transfer_complete->
dwc3_cleanup_done_reqs->
__dwc3_cleanup_done_trbs

Now here we expect that __dwc3_cleanup_done_trbs returns 1 only when
all the TRBs are done ie for last TRB.

But following code in __dwc3_cleanup_done_trbs will cause to return 1
even after processing 1st TRB, which is not desired here. In this case
TRB2-8 will not be processed

1915         if ((event->status & DEPEVT_STATUS_IOC) &&
1916                         (trb->ctrl & DWC3_TRB_CTRL_IOC))
1917                 return 1;

Regards
Pratyush

> 
> -- 
> balbi


--
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