aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2010-07-19 04:40:45 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 17:35:42 -0400
commit03e10e5ab5ba6511ddaf80085cf08c62e9336fa5 (patch)
treeef2bce4b63f9ba1811b8ef89bc8b08d85b01e838 /drivers/usb
parent10aebc772a10c95e30dff0779cb0f879b8f1554f (diff)
USB: s3c-hsotg: Only load packet per fifo write
Limit the IN FIFO write to a single packet per attempt at writing, as per the specifications and ensure that we don't return fifo-full so that we can continue writing packets if we have the space. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/s3c-hsotg.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
index 4196e376a346..df6a39d6270f 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
@@ -538,6 +538,17 @@ static int s3c_hsotg_write_fifo(struct s3c_hsotg *hsotg,
538 if (can_write > 512) 538 if (can_write > 512)
539 can_write = 512; 539 can_write = 512;
540 540
541 /* limit the write to one max-packet size worth of data, but allow
542 * the transfer to return that it did not run out of fifo space
543 * doing it. */
544 if (to_write > hs_ep->ep.maxpacket) {
545 to_write = hs_ep->ep.maxpacket;
546
547 s3c_hsotg_en_gsint(hsotg,
548 periodic ? S3C_GINTSTS_PTxFEmp :
549 S3C_GINTSTS_NPTxFEmp);
550 }
551
541 /* see if we can write data */ 552 /* see if we can write data */
542 553
543 if (to_write > can_write) { 554 if (to_write > can_write) {