Re: [PATCH 5/8] usb: cdns3: gadget: handle sg list use case at completion correctly

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

 



On 20-09-08 09:25:41, Felipe Balbi wrote:
> Peter Chen <peter.chen@xxxxxxx> writes:
> 
> > - Judge each TRB has been handled at cdns3_trb_handled, since
> > the DMA pointer may be at the middle of the TD, we can't consider
> > this TD has finished at that time.
> > - Calcuate req->actual according to finished TRBs.
>     ^^^^^^^^
>     calculate
> 
> > - Handle short transfer for sg list use case correctly. When the
> > short transfer occurs, we check OUT_SMM at TRB to see if it is
> > the last TRB.
> 
> it looks like each of these should be split to its own patch.

When I debug sg use case, it indeed took several patches for all
functions work, and some patches improved the old patches since
some short transfers use case did not be considered well.

Using this patch, it could let the completion work for both normal
transfer and short transfer. So I prefer keeping one patch.

> > + * Then, we check if cycle bit for index priv_ep->dequeue
> > + * is correct.
> >   *
> >   * some rules:
> > - * 1. priv_ep->dequeue never exceed current_index.
> > + * 1. priv_ep->dequeue never equals to current_index.
> >   * 2  priv_ep->enqueue never exceed priv_ep->dequeue
> >   * 3. exception: priv_ep->enqueue == priv_ep->dequeue
> >   *    and priv_ep->free_trbs is zero.
> >   *    This case indicate that TR is full.
> >   *
> > - * Then We can split recognition into two parts:
> > + * At below two cases, the request have been handled.
> >   * Case 1 - priv_ep->dequeue < current_index
> >   *      SR ... EQ ... DQ ... CI ... ER
> >   *      SR ... DQ ... CI ... EQ ... ER
> >   *
> > - *      Request has been handled by DMA if ST and ET is between DQ and CI.
> > - *
> >   * Case 2 - priv_ep->dequeue > current_index
> > - * This situation take place when CI go through the LINK TRB at the end of
> > + * This situation takes place when CI go through the LINK TRB at the end of
> 
> not part of $subject
> 

I will make another patch for comment improvement, thanks.

-- 

Thanks,
Peter Chen



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

  Powered by Linux