Re: [PATCH] usb: musb: gadget: clear PKTRDY flags when set FLUSHFIFO

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

 



Yauheni Kaliuta wrote:

ext Sergei Shtylyov writes:

 > > From: Yauheni Kaliuta <yauheni.kaliuta@xxxxxxxxx>

 > > It fixes MUSB's hardware feature, that it doesn't actually flush FIFOs,
 > > when it has PKTRDY flag set.

 >    Hm, the MUSB programming guide explicitly says:

 > "Note: FlushFIFO should only be used when TxPktRdy/RxPktRdy is set. At other
 > times, it may cause data to be corrupted."

 > > Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@xxxxxxxxx>
 > > ---
 > >  drivers/usb/musb/musb_gadget.c |    2 ++
 > >  1 files changed, 2 insertions(+), 0 deletions(-)

 > > diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
 > > index 0a50a35..830768f 100644
 > > --- a/drivers/usb/musb/musb_gadget.c
 > > +++ b/drivers/usb/musb/musb_gadget.c
 > > @@ -1524,6 +1524,7 @@ static void musb_gadget_fifo_flush(struct usb_ep *ep)
 > >                  csr = musb_readw(epio, MUSB_TXCSR);
 > >                  if (csr & MUSB_TXCSR_FIFONOTEMPTY) {
 > >                          csr |= MUSB_TXCSR_FLUSHFIFO | MUSB_TXCSR_P_WZC_BITS;
 > > +                        csr &= ~MUSB_TXCSR_TXPKTRDY;

 >    CPU can't clear this bit according to the programming guide -- it can only
 > set the bit. So this should have no effect.

Ok, the situation is that it reads it and set again, so let's say "the
flush code should not set the flag".

   That should only happen if the bit gets cleared in between the read and write.

WBR, Sergei
--
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