All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/at91_ether: prepare and unprepare clock
@ 2015-01-07 22:59 ` Alexandre Belloni
  0 siblings, 0 replies; 10+ messages in thread
From: Alexandre Belloni @ 2015-01-07 22:59 UTC (permalink / raw)
  To: Nicolas Ferre, David S. Miller
  Cc: Boris Brezillon, linux-arm-kernel, linux-kernel, netdev,
	Alexandre Belloni

The clock is enabled without being prepared, this leads to:

WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:889 __clk_enable+0x24/0xa8()

and a non working ethernet interface.

Use clk_prepare_enable() and clk_disable_unprepare() to handle the clock.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 drivers/net/ethernet/cadence/at91_ether.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 55eb7f2af2b4..7ef55f5fa664 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -340,7 +340,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
 		res = PTR_ERR(lp->pclk);
 		goto err_free_dev;
 	}
-	clk_enable(lp->pclk);
+	clk_prepare_enable(lp->pclk);
 
 	lp->hclk = ERR_PTR(-ENOENT);
 	lp->tx_clk = ERR_PTR(-ENOENT);
@@ -406,7 +406,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
 err_out_unregister_netdev:
 	unregister_netdev(dev);
 err_disable_clock:
-	clk_disable(lp->pclk);
+	clk_disable_unprepare(lp->pclk);
 err_free_dev:
 	free_netdev(dev);
 	return res;
@@ -424,7 +424,7 @@ static int at91ether_remove(struct platform_device *pdev)
 	kfree(lp->mii_bus->irq);
 	mdiobus_free(lp->mii_bus);
 	unregister_netdev(dev);
-	clk_disable(lp->pclk);
+	clk_disable_unprepare(lp->pclk);
 	free_netdev(dev);
 
 	return 0;
@@ -440,7 +440,7 @@ static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg)
 		netif_stop_queue(net_dev);
 		netif_device_detach(net_dev);
 
-		clk_disable(lp->pclk);
+		clk_disable_unprepare(lp->pclk);
 	}
 	return 0;
 }
@@ -451,7 +451,7 @@ static int at91ether_resume(struct platform_device *pdev)
 	struct macb *lp = netdev_priv(net_dev);
 
 	if (netif_running(net_dev)) {
-		clk_enable(lp->pclk);
+		clk_prepare_enable(lp->pclk);
 
 		netif_device_attach(net_dev);
 		netif_start_queue(net_dev);
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] net/at91_ether: prepare and unprepare clock
@ 2015-01-07 22:59 ` Alexandre Belloni
  0 siblings, 0 replies; 10+ messages in thread
From: Alexandre Belloni @ 2015-01-07 22:59 UTC (permalink / raw)
  To: linux-arm-kernel

The clock is enabled without being prepared, this leads to:

WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:889 __clk_enable+0x24/0xa8()

and a non working ethernet interface.

Use clk_prepare_enable() and clk_disable_unprepare() to handle the clock.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 drivers/net/ethernet/cadence/at91_ether.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 55eb7f2af2b4..7ef55f5fa664 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -340,7 +340,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
 		res = PTR_ERR(lp->pclk);
 		goto err_free_dev;
 	}
-	clk_enable(lp->pclk);
+	clk_prepare_enable(lp->pclk);
 
 	lp->hclk = ERR_PTR(-ENOENT);
 	lp->tx_clk = ERR_PTR(-ENOENT);
@@ -406,7 +406,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
 err_out_unregister_netdev:
 	unregister_netdev(dev);
 err_disable_clock:
-	clk_disable(lp->pclk);
+	clk_disable_unprepare(lp->pclk);
 err_free_dev:
 	free_netdev(dev);
 	return res;
@@ -424,7 +424,7 @@ static int at91ether_remove(struct platform_device *pdev)
 	kfree(lp->mii_bus->irq);
 	mdiobus_free(lp->mii_bus);
 	unregister_netdev(dev);
-	clk_disable(lp->pclk);
+	clk_disable_unprepare(lp->pclk);
 	free_netdev(dev);
 
 	return 0;
@@ -440,7 +440,7 @@ static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg)
 		netif_stop_queue(net_dev);
 		netif_device_detach(net_dev);
 
-		clk_disable(lp->pclk);
+		clk_disable_unprepare(lp->pclk);
 	}
 	return 0;
 }
@@ -451,7 +451,7 @@ static int at91ether_resume(struct platform_device *pdev)
 	struct macb *lp = netdev_priv(net_dev);
 
 	if (netif_running(net_dev)) {
-		clk_enable(lp->pclk);
+		clk_prepare_enable(lp->pclk);
 
 		netif_device_attach(net_dev);
 		netif_start_queue(net_dev);
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] net/at91_ether: prepare and unprepare clock
  2015-01-07 22:59 ` Alexandre Belloni
@ 2015-01-08  8:13   ` Boris Brezillon
  -1 siblings, 0 replies; 10+ messages in thread
From: Boris Brezillon @ 2015-01-08  8:13 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Nicolas Ferre, David S. Miller, linux-arm-kernel, linux-kernel, netdev

On Wed,  7 Jan 2015 23:59:26 +0100
Alexandre Belloni <alexandre.belloni@free-electrons.com> wrote:

> The clock is enabled without being prepared, this leads to:
> 
> WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:889 __clk_enable+0x24/0xa8()
> 
> and a non working ethernet interface.
> 
> Use clk_prepare_enable() and clk_disable_unprepare() to handle the clock.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> ---
>  drivers/net/ethernet/cadence/at91_ether.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
> index 55eb7f2af2b4..7ef55f5fa664 100644
> --- a/drivers/net/ethernet/cadence/at91_ether.c
> +++ b/drivers/net/ethernet/cadence/at91_ether.c
> @@ -340,7 +340,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
>  		res = PTR_ERR(lp->pclk);
>  		goto err_free_dev;
>  	}
> -	clk_enable(lp->pclk);
> +	clk_prepare_enable(lp->pclk);
>  
>  	lp->hclk = ERR_PTR(-ENOENT);
>  	lp->tx_clk = ERR_PTR(-ENOENT);
> @@ -406,7 +406,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
>  err_out_unregister_netdev:
>  	unregister_netdev(dev);
>  err_disable_clock:
> -	clk_disable(lp->pclk);
> +	clk_disable_unprepare(lp->pclk);
>  err_free_dev:
>  	free_netdev(dev);
>  	return res;
> @@ -424,7 +424,7 @@ static int at91ether_remove(struct platform_device *pdev)
>  	kfree(lp->mii_bus->irq);
>  	mdiobus_free(lp->mii_bus);
>  	unregister_netdev(dev);
> -	clk_disable(lp->pclk);
> +	clk_disable_unprepare(lp->pclk);
>  	free_netdev(dev);
>  
>  	return 0;
> @@ -440,7 +440,7 @@ static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg)
>  		netif_stop_queue(net_dev);
>  		netif_device_detach(net_dev);
>  
> -		clk_disable(lp->pclk);
> +		clk_disable_unprepare(lp->pclk);
>  	}
>  	return 0;
>  }
> @@ -451,7 +451,7 @@ static int at91ether_resume(struct platform_device *pdev)
>  	struct macb *lp = netdev_priv(net_dev);
>  
>  	if (netif_running(net_dev)) {
> -		clk_enable(lp->pclk);
> +		clk_prepare_enable(lp->pclk);
>  
>  		netif_device_attach(net_dev);
>  		netif_start_queue(net_dev);



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] net/at91_ether: prepare and unprepare clock
@ 2015-01-08  8:13   ` Boris Brezillon
  0 siblings, 0 replies; 10+ messages in thread
From: Boris Brezillon @ 2015-01-08  8:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed,  7 Jan 2015 23:59:26 +0100
Alexandre Belloni <alexandre.belloni@free-electrons.com> wrote:

> The clock is enabled without being prepared, this leads to:
> 
> WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:889 __clk_enable+0x24/0xa8()
> 
> and a non working ethernet interface.
> 
> Use clk_prepare_enable() and clk_disable_unprepare() to handle the clock.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> ---
>  drivers/net/ethernet/cadence/at91_ether.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
> index 55eb7f2af2b4..7ef55f5fa664 100644
> --- a/drivers/net/ethernet/cadence/at91_ether.c
> +++ b/drivers/net/ethernet/cadence/at91_ether.c
> @@ -340,7 +340,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
>  		res = PTR_ERR(lp->pclk);
>  		goto err_free_dev;
>  	}
> -	clk_enable(lp->pclk);
> +	clk_prepare_enable(lp->pclk);
>  
>  	lp->hclk = ERR_PTR(-ENOENT);
>  	lp->tx_clk = ERR_PTR(-ENOENT);
> @@ -406,7 +406,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
>  err_out_unregister_netdev:
>  	unregister_netdev(dev);
>  err_disable_clock:
> -	clk_disable(lp->pclk);
> +	clk_disable_unprepare(lp->pclk);
>  err_free_dev:
>  	free_netdev(dev);
>  	return res;
> @@ -424,7 +424,7 @@ static int at91ether_remove(struct platform_device *pdev)
>  	kfree(lp->mii_bus->irq);
>  	mdiobus_free(lp->mii_bus);
>  	unregister_netdev(dev);
> -	clk_disable(lp->pclk);
> +	clk_disable_unprepare(lp->pclk);
>  	free_netdev(dev);
>  
>  	return 0;
> @@ -440,7 +440,7 @@ static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg)
>  		netif_stop_queue(net_dev);
>  		netif_device_detach(net_dev);
>  
> -		clk_disable(lp->pclk);
> +		clk_disable_unprepare(lp->pclk);
>  	}
>  	return 0;
>  }
> @@ -451,7 +451,7 @@ static int at91ether_resume(struct platform_device *pdev)
>  	struct macb *lp = netdev_priv(net_dev);
>  
>  	if (netif_running(net_dev)) {
> -		clk_enable(lp->pclk);
> +		clk_prepare_enable(lp->pclk);
>  
>  		netif_device_attach(net_dev);
>  		netif_start_queue(net_dev);



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] net/at91_ether: prepare and unprepare clock
  2015-01-07 22:59 ` Alexandre Belloni
@ 2015-01-08 10:55   ` Nicolas Ferre
  -1 siblings, 0 replies; 10+ messages in thread
From: Nicolas Ferre @ 2015-01-08 10:55 UTC (permalink / raw)
  To: Alexandre Belloni, David S. Miller, Cyrille Pitchen
  Cc: Boris Brezillon, linux-arm-kernel, linux-kernel, netdev

Le 07/01/2015 23:59, Alexandre Belloni a écrit :
> The clock is enabled without being prepared, this leads to:
> 
> WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:889 __clk_enable+0x24/0xa8()
> 
> and a non working ethernet interface.
> 
> Use clk_prepare_enable() and clk_disable_unprepare() to handle the clock.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> ---
>  drivers/net/ethernet/cadence/at91_ether.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
> index 55eb7f2af2b4..7ef55f5fa664 100644
> --- a/drivers/net/ethernet/cadence/at91_ether.c
> +++ b/drivers/net/ethernet/cadence/at91_ether.c
> @@ -340,7 +340,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
>  		res = PTR_ERR(lp->pclk);
>  		goto err_free_dev;
>  	}
> -	clk_enable(lp->pclk);
> +	clk_prepare_enable(lp->pclk);
>  
>  	lp->hclk = ERR_PTR(-ENOENT);
>  	lp->tx_clk = ERR_PTR(-ENOENT);
> @@ -406,7 +406,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
>  err_out_unregister_netdev:
>  	unregister_netdev(dev);
>  err_disable_clock:
> -	clk_disable(lp->pclk);
> +	clk_disable_unprepare(lp->pclk);
>  err_free_dev:
>  	free_netdev(dev);
>  	return res;
> @@ -424,7 +424,7 @@ static int at91ether_remove(struct platform_device *pdev)
>  	kfree(lp->mii_bus->irq);
>  	mdiobus_free(lp->mii_bus);
>  	unregister_netdev(dev);
> -	clk_disable(lp->pclk);
> +	clk_disable_unprepare(lp->pclk);
>  	free_netdev(dev);
>  
>  	return 0;
> @@ -440,7 +440,7 @@ static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg)
>  		netif_stop_queue(net_dev);
>  		netif_device_detach(net_dev);
>  
> -		clk_disable(lp->pclk);
> +		clk_disable_unprepare(lp->pclk);
>  	}
>  	return 0;
>  }
> @@ -451,7 +451,7 @@ static int at91ether_resume(struct platform_device *pdev)
>  	struct macb *lp = netdev_priv(net_dev);
>  
>  	if (netif_running(net_dev)) {
> -		clk_enable(lp->pclk);
> +		clk_prepare_enable(lp->pclk);
>  
>  		netif_device_attach(net_dev);
>  		netif_start_queue(net_dev);
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] net/at91_ether: prepare and unprepare clock
@ 2015-01-08 10:55   ` Nicolas Ferre
  0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Ferre @ 2015-01-08 10:55 UTC (permalink / raw)
  To: linux-arm-kernel

Le 07/01/2015 23:59, Alexandre Belloni a ?crit :
> The clock is enabled without being prepared, this leads to:
> 
> WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:889 __clk_enable+0x24/0xa8()
> 
> and a non working ethernet interface.
> 
> Use clk_prepare_enable() and clk_disable_unprepare() to handle the clock.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> ---
>  drivers/net/ethernet/cadence/at91_ether.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
> index 55eb7f2af2b4..7ef55f5fa664 100644
> --- a/drivers/net/ethernet/cadence/at91_ether.c
> +++ b/drivers/net/ethernet/cadence/at91_ether.c
> @@ -340,7 +340,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
>  		res = PTR_ERR(lp->pclk);
>  		goto err_free_dev;
>  	}
> -	clk_enable(lp->pclk);
> +	clk_prepare_enable(lp->pclk);
>  
>  	lp->hclk = ERR_PTR(-ENOENT);
>  	lp->tx_clk = ERR_PTR(-ENOENT);
> @@ -406,7 +406,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
>  err_out_unregister_netdev:
>  	unregister_netdev(dev);
>  err_disable_clock:
> -	clk_disable(lp->pclk);
> +	clk_disable_unprepare(lp->pclk);
>  err_free_dev:
>  	free_netdev(dev);
>  	return res;
> @@ -424,7 +424,7 @@ static int at91ether_remove(struct platform_device *pdev)
>  	kfree(lp->mii_bus->irq);
>  	mdiobus_free(lp->mii_bus);
>  	unregister_netdev(dev);
> -	clk_disable(lp->pclk);
> +	clk_disable_unprepare(lp->pclk);
>  	free_netdev(dev);
>  
>  	return 0;
> @@ -440,7 +440,7 @@ static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg)
>  		netif_stop_queue(net_dev);
>  		netif_device_detach(net_dev);
>  
> -		clk_disable(lp->pclk);
> +		clk_disable_unprepare(lp->pclk);
>  	}
>  	return 0;
>  }
> @@ -451,7 +451,7 @@ static int at91ether_resume(struct platform_device *pdev)
>  	struct macb *lp = netdev_priv(net_dev);
>  
>  	if (netif_running(net_dev)) {
> -		clk_enable(lp->pclk);
> +		clk_prepare_enable(lp->pclk);
>  
>  		netif_device_attach(net_dev);
>  		netif_start_queue(net_dev);
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] net/at91_ether: prepare and unprepare clock
  2015-01-08 10:55   ` Nicolas Ferre
@ 2015-01-12 11:08     ` Alexandre Belloni
  -1 siblings, 0 replies; 10+ messages in thread
From: Alexandre Belloni @ 2015-01-12 11:08 UTC (permalink / raw)
  To: David S. Miller
  Cc: Nicolas Ferre, Cyrille Pitchen, Boris Brezillon,
	linux-arm-kernel, linux-kernel, netdev

Hi Dave,

This is actually a fix for 3.19, can you take it for the next rc ?

Thanks!

On 08/01/2015 at 11:55:58 +0100, Nicolas Ferre wrote :
> Le 07/01/2015 23:59, Alexandre Belloni a écrit :
> > The clock is enabled without being prepared, this leads to:
> > 
> > WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:889 __clk_enable+0x24/0xa8()
> > 
> > and a non working ethernet interface.
> > 
> > Use clk_prepare_enable() and clk_disable_unprepare() to handle the clock.
> > 
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> 
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> 
> > ---
> >  drivers/net/ethernet/cadence/at91_ether.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
> > index 55eb7f2af2b4..7ef55f5fa664 100644
> > --- a/drivers/net/ethernet/cadence/at91_ether.c
> > +++ b/drivers/net/ethernet/cadence/at91_ether.c
> > @@ -340,7 +340,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
> >  		res = PTR_ERR(lp->pclk);
> >  		goto err_free_dev;
> >  	}
> > -	clk_enable(lp->pclk);
> > +	clk_prepare_enable(lp->pclk);
> >  
> >  	lp->hclk = ERR_PTR(-ENOENT);
> >  	lp->tx_clk = ERR_PTR(-ENOENT);
> > @@ -406,7 +406,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
> >  err_out_unregister_netdev:
> >  	unregister_netdev(dev);
> >  err_disable_clock:
> > -	clk_disable(lp->pclk);
> > +	clk_disable_unprepare(lp->pclk);
> >  err_free_dev:
> >  	free_netdev(dev);
> >  	return res;
> > @@ -424,7 +424,7 @@ static int at91ether_remove(struct platform_device *pdev)
> >  	kfree(lp->mii_bus->irq);
> >  	mdiobus_free(lp->mii_bus);
> >  	unregister_netdev(dev);
> > -	clk_disable(lp->pclk);
> > +	clk_disable_unprepare(lp->pclk);
> >  	free_netdev(dev);
> >  
> >  	return 0;
> > @@ -440,7 +440,7 @@ static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg)
> >  		netif_stop_queue(net_dev);
> >  		netif_device_detach(net_dev);
> >  
> > -		clk_disable(lp->pclk);
> > +		clk_disable_unprepare(lp->pclk);
> >  	}
> >  	return 0;
> >  }
> > @@ -451,7 +451,7 @@ static int at91ether_resume(struct platform_device *pdev)
> >  	struct macb *lp = netdev_priv(net_dev);
> >  
> >  	if (netif_running(net_dev)) {
> > -		clk_enable(lp->pclk);
> > +		clk_prepare_enable(lp->pclk);
> >  
> >  		netif_device_attach(net_dev);
> >  		netif_start_queue(net_dev);
> > 
> 
> 
> -- 
> Nicolas Ferre

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] net/at91_ether: prepare and unprepare clock
@ 2015-01-12 11:08     ` Alexandre Belloni
  0 siblings, 0 replies; 10+ messages in thread
From: Alexandre Belloni @ 2015-01-12 11:08 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Dave,

This is actually a fix for 3.19, can you take it for the next rc ?

Thanks!

On 08/01/2015 at 11:55:58 +0100, Nicolas Ferre wrote :
> Le 07/01/2015 23:59, Alexandre Belloni a ?crit :
> > The clock is enabled without being prepared, this leads to:
> > 
> > WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:889 __clk_enable+0x24/0xa8()
> > 
> > and a non working ethernet interface.
> > 
> > Use clk_prepare_enable() and clk_disable_unprepare() to handle the clock.
> > 
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> 
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> 
> > ---
> >  drivers/net/ethernet/cadence/at91_ether.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
> > index 55eb7f2af2b4..7ef55f5fa664 100644
> > --- a/drivers/net/ethernet/cadence/at91_ether.c
> > +++ b/drivers/net/ethernet/cadence/at91_ether.c
> > @@ -340,7 +340,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
> >  		res = PTR_ERR(lp->pclk);
> >  		goto err_free_dev;
> >  	}
> > -	clk_enable(lp->pclk);
> > +	clk_prepare_enable(lp->pclk);
> >  
> >  	lp->hclk = ERR_PTR(-ENOENT);
> >  	lp->tx_clk = ERR_PTR(-ENOENT);
> > @@ -406,7 +406,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
> >  err_out_unregister_netdev:
> >  	unregister_netdev(dev);
> >  err_disable_clock:
> > -	clk_disable(lp->pclk);
> > +	clk_disable_unprepare(lp->pclk);
> >  err_free_dev:
> >  	free_netdev(dev);
> >  	return res;
> > @@ -424,7 +424,7 @@ static int at91ether_remove(struct platform_device *pdev)
> >  	kfree(lp->mii_bus->irq);
> >  	mdiobus_free(lp->mii_bus);
> >  	unregister_netdev(dev);
> > -	clk_disable(lp->pclk);
> > +	clk_disable_unprepare(lp->pclk);
> >  	free_netdev(dev);
> >  
> >  	return 0;
> > @@ -440,7 +440,7 @@ static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg)
> >  		netif_stop_queue(net_dev);
> >  		netif_device_detach(net_dev);
> >  
> > -		clk_disable(lp->pclk);
> > +		clk_disable_unprepare(lp->pclk);
> >  	}
> >  	return 0;
> >  }
> > @@ -451,7 +451,7 @@ static int at91ether_resume(struct platform_device *pdev)
> >  	struct macb *lp = netdev_priv(net_dev);
> >  
> >  	if (netif_running(net_dev)) {
> > -		clk_enable(lp->pclk);
> > +		clk_prepare_enable(lp->pclk);
> >  
> >  		netif_device_attach(net_dev);
> >  		netif_start_queue(net_dev);
> > 
> 
> 
> -- 
> Nicolas Ferre

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] net/at91_ether: prepare and unprepare clock
  2015-01-07 22:59 ` Alexandre Belloni
@ 2015-01-12 20:35   ` David Miller
  -1 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2015-01-12 20:35 UTC (permalink / raw)
  To: alexandre.belloni
  Cc: nicolas.ferre, boris.brezillon, linux-arm-kernel, linux-kernel, netdev

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Date: Wed,  7 Jan 2015 23:59:26 +0100

> The clock is enabled without being prepared, this leads to:
> 
> WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:889 __clk_enable+0x24/0xa8()
> 
> and a non working ethernet interface.
> 
> Use clk_prepare_enable() and clk_disable_unprepare() to handle the clock.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] net/at91_ether: prepare and unprepare clock
@ 2015-01-12 20:35   ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2015-01-12 20:35 UTC (permalink / raw)
  To: linux-arm-kernel

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Date: Wed,  7 Jan 2015 23:59:26 +0100

> The clock is enabled without being prepared, this leads to:
> 
> WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:889 __clk_enable+0x24/0xa8()
> 
> and a non working ethernet interface.
> 
> Use clk_prepare_enable() and clk_disable_unprepare() to handle the clock.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-01-12 20:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-07 22:59 [PATCH] net/at91_ether: prepare and unprepare clock Alexandre Belloni
2015-01-07 22:59 ` Alexandre Belloni
2015-01-08  8:13 ` Boris Brezillon
2015-01-08  8:13   ` Boris Brezillon
2015-01-08 10:55 ` Nicolas Ferre
2015-01-08 10:55   ` Nicolas Ferre
2015-01-12 11:08   ` Alexandre Belloni
2015-01-12 11:08     ` Alexandre Belloni
2015-01-12 20:35 ` David Miller
2015-01-12 20:35   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.