Hello. On 08/07/2012 05:09 PM, Roger Quadros wrote: > Do not rely on any hints from gadget drivers and use DMA mode 1 > whenever we expect data of at least the endpoint's packet size and > have not yet received a short packet. > The last packet if short is always transferred using DMA mode 0. > This patch fixes USB throughput issues in mass storage mode for > host to device transfers. > Signed-off-by: Roger Quadros <rogerq@xxxxxx> > --- > drivers/usb/musb/musb_gadget.c | 30 ++++-------------------------- > 1 files changed, 4 insertions(+), 26 deletions(-) > diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c > index 8d2cce1..5c4392b 100644 > --- a/drivers/usb/musb/musb_gadget.c > +++ b/drivers/usb/musb/musb_gadget.c > @@ -707,12 +707,11 @@ static void rxstate(struct musb *musb, struct musb_request *req) > fifo_count = musb_readw(epio, MUSB_RXCOUNT); > > /* > - * Enable Mode 1 on RX transfers only when short_not_ok flag > - * is set. Currently short_not_ok flag is set only from > - * file_storage and f_mass_storage drivers > + * use mode 1 only if we expect data of at least ep packet_sz > + * and have not yet received a short packet Why offset the comment text with 2 spaces? > */ > - > - if (request->short_not_ok && fifo_count == musb_ep->packet_sz) > + if ((request->length - request->actual >= musb_ep->packet_sz) && > + (fifo_count >= musb_ep->packet_sz)) 'fifo_count' shouldn't ever be > packet size (unless there's babble error??). 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