Commit 4fd24483 authored by Kishon Vijay Abraham I's avatar Kishon Vijay Abraham I Committed by Greg Kroah-Hartman

usb: dwc3: core: move dwc3_cache_hwparams before dwc3_alloc_event_buffers

commit 392142 moved event buffer allocation out of dwc3_core_init() but
event buffer allocation uses the cached copy of hwparams to determine
the number of event buffers and the caching is done in dwc3_core_init.
So moved dwc3_cache_hwparams function before dwc3_alloc_event_buffers so
that dwc3_alloc_event_buffers sees the correct number of event buffers.
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ac96511b
...@@ -315,8 +315,6 @@ static int __devinit dwc3_core_init(struct dwc3 *dwc) ...@@ -315,8 +315,6 @@ static int __devinit dwc3_core_init(struct dwc3 *dwc)
dwc3_core_soft_reset(dwc); dwc3_core_soft_reset(dwc);
dwc3_cache_hwparams(dwc);
reg = dwc3_readl(dwc->regs, DWC3_GCTL); reg = dwc3_readl(dwc->regs, DWC3_GCTL);
reg &= ~DWC3_GCTL_SCALEDOWN_MASK; reg &= ~DWC3_GCTL_SCALEDOWN_MASK;
reg &= ~DWC3_GCTL_DISSCRAMBLE; reg &= ~DWC3_GCTL_DISSCRAMBLE;
...@@ -460,6 +458,8 @@ static int __devinit dwc3_probe(struct platform_device *pdev) ...@@ -460,6 +458,8 @@ static int __devinit dwc3_probe(struct platform_device *pdev)
pm_runtime_get_sync(dev); pm_runtime_get_sync(dev);
pm_runtime_forbid(dev); pm_runtime_forbid(dev);
dwc3_cache_hwparams(dwc);
ret = dwc3_alloc_event_buffers(dwc, DWC3_EVENT_BUFFERS_SIZE); ret = dwc3_alloc_event_buffers(dwc, DWC3_EVENT_BUFFERS_SIZE);
if (ret) { if (ret) {
dev_err(dwc->dev, "failed to allocate event buffers\n"); dev_err(dwc->dev, "failed to allocate event buffers\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment