diff options
author | Paul Zimmerman <Paul.Zimmerman@synopsys.com> | 2012-04-27 11:28:02 (GMT) |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-06-03 20:08:24 (GMT) |
commit | 7acd85e0eb2ed300edf123178445237059b35fb9 (patch) | |
tree | 1afee16530d6e70786f78c97e84c7571255bec15 /drivers/usb/dwc3/core.c | |
parent | 802fde983e8a3391e059bd41fc272993ae642816 (diff) | |
download | linux-fsl-qoriq-7acd85e0eb2ed300edf123178445237059b35fb9.tar.xz |
usb: dwc3: core: make sure evt->lpos is correctly initialized
The same event buffers will be reused when coming
out of hibernation, so we must reinitialize them
properly to avoid any mistakes.
While at that, also take dwc3_event_buffers_setup()
out of __devinit section.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/core.c')
-rw-r--r-- | drivers/usb/dwc3/core.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 1040bdb..49c0602 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -255,7 +255,7 @@ static int __devinit dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned length) * * Returns 0 on success otherwise negative errno. */ -static int __devinit dwc3_event_buffers_setup(struct dwc3 *dwc) +static int dwc3_event_buffers_setup(struct dwc3 *dwc) { struct dwc3_event_buffer *evt; int n; @@ -266,6 +266,8 @@ static int __devinit dwc3_event_buffers_setup(struct dwc3 *dwc) evt->buf, (unsigned long long) evt->dma, evt->length); + evt->lpos = 0; + dwc3_writel(dwc->regs, DWC3_GEVNTADRLO(n), lower_32_bits(evt->dma)); dwc3_writel(dwc->regs, DWC3_GEVNTADRHI(n), @@ -285,6 +287,9 @@ static void dwc3_event_buffers_cleanup(struct dwc3 *dwc) for (n = 0; n < dwc->num_event_buffers; n++) { evt = dwc->ev_buffs[n]; + + evt->lpos = 0; + dwc3_writel(dwc->regs, DWC3_GEVNTADRLO(n), 0); dwc3_writel(dwc->regs, DWC3_GEVNTADRHI(n), 0); dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(n), 0); |