Skip to content

Commit

Permalink
usb: dwc3: gadget: driver should not wait for RxFIFO to drain
Browse files Browse the repository at this point in the history
An older version of the databook said to wait for the FIFO to
drain, but that has been removed from the newer databooks.

Waiting for RxFIFO to drain caused problems when testing against
one of the host controllers available in the market.

After talking to one of the RTL engineers, he stated that we
should _not_ wait for RxFIFO to drain.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Paul Zimmerman authored and Greg Kroah-Hartman committed Oct 4, 2011
1 parent b23c843 commit 82828ca
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1656,25 +1656,6 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)
reg = dwc3_readl(dwc->regs, DWC3_DCFG);
reg &= ~(DWC3_DCFG_DEVADDR_MASK);
dwc3_writel(dwc->regs, DWC3_DCFG, reg);

/*
* Wait for RxFifo to drain
*
* REVISIT probably shouldn't wait forever.
* In case Hardware ends up in a screwed up
* case, we error out, notify the user and,
* maybe, WARN() or BUG() but leave the rest
* of the kernel working fine.
*
* REVISIT the below is rather CPU intensive,
* maybe we should read and if it doesn't work
* sleep (not busy wait) for a few useconds.
*
* REVISIT why wait until the RXFIFO is empty anyway?
*/
while (!(dwc3_readl(dwc->regs, DWC3_DSTS)
& DWC3_DSTS_RXFIFOEMPTY))
cpu_relax();
}

static void dwc3_update_ram_clk_sel(struct dwc3 *dwc, u32 speed)
Expand Down

0 comments on commit 82828ca

Please sign in to comment.