diff mbox

usb: dwc3: core: move dwc3_cache_hwparams before dwc3_alloc_event_buffers

Message ID 1353047874-4981-1-git-send-email-kishon@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kishon Vijay Abraham I Nov. 16, 2012, 6:37 a.m. UTC
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: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/usb/dwc3/core.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Felipe Balbi Nov. 16, 2012, 8:17 a.m. UTC | #1
Hi,

On Fri, Nov 16, 2012 at 12:07:54PM +0530, Kishon Vijay Abraham I wrote:
> 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: Kishon Vijay Abraham I <kishon@ti.com>

My bad, what a regression I caused :-)

Greg, can you take this one ?

Signed-off-by: Felipe Balbi <balbi@ti.com>

> ---
>  drivers/usb/dwc3/core.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index b923183..88e8d31 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -356,8 +356,6 @@ static int __devinit dwc3_core_init(struct dwc3 *dwc)
>  
>  	dwc3_core_soft_reset(dwc);
>  
> -	dwc3_cache_hwparams(dwc);
> -
>  	reg = dwc3_readl(dwc->regs, DWC3_GCTL);
>  	reg &= ~DWC3_GCTL_SCALEDOWN_MASK;
>  	reg &= ~DWC3_GCTL_DISSCRAMBLE;
> @@ -498,6 +496,8 @@ static int __devinit dwc3_probe(struct platform_device *pdev)
>  	pm_runtime_get_sync(dev);
>  	pm_runtime_forbid(dev);
>  
> +	dwc3_cache_hwparams(dwc);
> +
>  	ret = dwc3_alloc_event_buffers(dwc, DWC3_EVENT_BUFFERS_SIZE);
>  	if (ret) {
>  		dev_err(dwc->dev, "failed to allocate event buffers\n");
> -- 
> 1.7.9.5
>
Sergei Shtylyov Nov. 16, 2012, 12:08 p.m. UTC | #2
Hello.

On 16-11-2012 10:37, Kishon Vijay Abraham I wrote:

> commit 392142

    Please specify thta commit summary in parens.

> 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: Kishon Vijay Abraham I <kishon@ti.com>

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg Kroah-Hartman Nov. 16, 2012, 12:47 p.m. UTC | #3
On Fri, Nov 16, 2012 at 10:17:19AM +0200, Felipe Balbi wrote:
> Hi,
> 
> On Fri, Nov 16, 2012 at 12:07:54PM +0530, Kishon Vijay Abraham I wrote:
> > 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: Kishon Vijay Abraham I <kishon@ti.com>
> 
> My bad, what a regression I caused :-)
> 
> Greg, can you take this one ?

Yes, will do.

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Felipe Balbi Nov. 16, 2012, 1:42 p.m. UTC | #4
On Fri, Nov 16, 2012 at 04:47:11AM -0800, Greg KH wrote:
> On Fri, Nov 16, 2012 at 10:17:19AM +0200, Felipe Balbi wrote:
> > Hi,
> > 
> > On Fri, Nov 16, 2012 at 12:07:54PM +0530, Kishon Vijay Abraham I wrote:
> > > 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: Kishon Vijay Abraham I <kishon@ti.com>
> > 
> > My bad, what a regression I caused :-)
> > 
> > Greg, can you take this one ?
> 
> Yes, will do.

thanks a lot ;-)
diff mbox

Patch

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index b923183..88e8d31 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -356,8 +356,6 @@  static int __devinit dwc3_core_init(struct dwc3 *dwc)
 
 	dwc3_core_soft_reset(dwc);
 
-	dwc3_cache_hwparams(dwc);
-
 	reg = dwc3_readl(dwc->regs, DWC3_GCTL);
 	reg &= ~DWC3_GCTL_SCALEDOWN_MASK;
 	reg &= ~DWC3_GCTL_DISSCRAMBLE;
@@ -498,6 +496,8 @@  static int __devinit dwc3_probe(struct platform_device *pdev)
 	pm_runtime_get_sync(dev);
 	pm_runtime_forbid(dev);
 
+	dwc3_cache_hwparams(dwc);
+
 	ret = dwc3_alloc_event_buffers(dwc, DWC3_EVENT_BUFFERS_SIZE);
 	if (ret) {
 		dev_err(dwc->dev, "failed to allocate event buffers\n");