[PATCH v3] usb: xhci: fix lack of short packet event trb handling

Ran Wang ran.wang_1 at nxp.com
Wed Nov 18 04:42:27 CET 2020


Hi Bin,

On Wednesday, November 18, 2020 11:20 AM Bin Meng wrote:
> 
> Hi Ran,
> 
> On Wed, Nov 18, 2020 at 11:02 AM Ran Wang <ran.wang_1 at nxp.com>
> wrote:
> >
> > Hi Bin,
> >
> > On Wednesday, November 18, 2020 11:06 AM Ran Wang wrote:
> > >
> > > For bulk IN transfer, the codes will set ISP flag to request event
> > > TRB being generated by xHC for case of short packet. So in
> > > buffer-cross-64K-boundary case (which we will divide payload and
> > > enqueuqe more than 1 transfer TRB), if the first TRB ends up with a
> > > short packet condition it will trigger an short packet code transfer
> > > event per that flag and cause more than 1 event TRB gegerated for this
> transfer.
> > >
> > > However, current codes will only handle the first transfer event TRB
> > > then mark current transfer completed, which causing next transfer
> > > failure due to event TRB mis-match.
> > >
> > > Such issue has been observed on some Layerscape platforms (LS1028A,
> > > LS1088A, etc) with USB ethernet device
> > >
> > > This patch adds a loop to make sure the event TRB for last transfer
> > > TRB has been  handled in time.
> > >
> > > Signed-off-by: Ran Wang <ran.wang_1 at nxp.com>
> > > ---
> > > Change in v3:
> > >  - Update commit message according to v2 feedback .
> > >  - Replace (void *) with (uintptr_t) to fix below armv7 compile warning:
> > >  ...
> > >  drivers/usb/host/xhci-ring.c: In function 'xhci_bulk_tx':
> > >  drivers/usb/host/xhci-ring.c:726:6: warning: cast to pointer from
> > > integer of different size [-Wint-to-pointer-cast]
> > >    726 |  if ((void *)le64_to_cpu(event->trans_event.buffer) !=
> > > last_transfer_trb_addr) {
> > >        |       ^
> > >  ...
> >
> > For this version, I newly added a fix for above issue, please help check if it's
> OK for you.
> >
> 
> Are you sure you sent the correct patch? Because I see neither the commit
> message was fixed, nor the fix you mentioned "Replace (void *) with
> (uintptr_t)"

My bad, will send the correct patch soon, sorry.

Regards,
Ran

> Regards,
> Bin


More information about the U-Boot mailing list