]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
USB: s3c-hsotg: Re-initialise all FIFOs on USB bus reset
authorBen Dooks <ben-linux@fluff.org>
Mon, 19 Jul 2010 08:40:43 +0000 (09:40 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Aug 2010 21:35:42 +0000 (14:35 -0700)
The USB documentation suggest that the FIFOs should be reset when a
bus reset event happens. Use the s3c_hsotg_init_fifo() to ensure that
the FIFO layout is correct and that the FIFOs are flushed before
acknowledging the reset.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/s3c-hsotg.c

index 354fd456f8cc7f9bf73942d5bf1e7dc55b5897da..9d32c9ff737d92f8ba88066db1893d18098ccabf 100644 (file)
@@ -2082,17 +2082,12 @@ irq_retry:
                kill_all_requests(hsotg, &hsotg->eps[0], -ECONNRESET, true);
 
                /* it seems after a reset we can end up with a situation
-                * where the TXFIFO still has data in it... try flushing
-                * it to remove anything that may still be in it.
+                * where the TXFIFO still has data in it... the docs
+                * suggest resetting all the fifos, so use the init_fifo
+                * code to relayout and flush the fifos.
                 */
 
-               if (1) {
-                       writel(S3C_GRSTCTL_TxFNum(0) | S3C_GRSTCTL_TxFFlsh,
-                              hsotg->regs + S3C_GRSTCTL);
-
-                       dev_info(hsotg->dev, "GNPTXSTS=%08x\n",
-                                readl(hsotg->regs + S3C_GNPTXSTS));
-               }
+               s3c_hsotg_init_fifo(hsotg);
 
                s3c_hsotg_enqueue_setup(hsotg);