netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] stmmac: Remove unbalanced clk_disable call
@ 2014-05-20  9:38 Hans de Goede
  2014-05-20 10:08 ` Giuseppe CAVALLARO
  2014-05-22 19:11 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Hans de Goede @ 2014-05-20  9:38 UTC (permalink / raw)
  To: Giuseppe Cavallaro; +Cc: Chen-Yu Tsai, netdev, Hans de Goede

The stmmac_open call was calling clk_disable_unprepare on phy init
failure, but it never calls clk_prepare_enable, this causes
a WARN_ON in the clk framework to trigger if for some reason phy init
fails.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index d940034..0f4841d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1704,7 +1704,7 @@ static int stmmac_open(struct net_device *dev)
 		if (ret) {
 			pr_err("%s: Cannot attach to PHY (error: %d)\n",
 			       __func__, ret);
-			goto phy_error;
+			return ret;
 		}
 	}
 
@@ -1779,8 +1779,6 @@ init_error:
 dma_desc_error:
 	if (priv->phydev)
 		phy_disconnect(priv->phydev);
-phy_error:
-	clk_disable_unprepare(priv->stmmac_clk);
 
 	return ret;
 }
-- 
1.9.0

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

* Re: [PATCH] stmmac: Remove unbalanced clk_disable call
  2014-05-20  9:38 [PATCH] stmmac: Remove unbalanced clk_disable call Hans de Goede
@ 2014-05-20 10:08 ` Giuseppe CAVALLARO
  2014-05-20 10:59   ` Chen-Yu Tsai
  2014-05-22 19:11 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Giuseppe CAVALLARO @ 2014-05-20 10:08 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Chen-Yu Tsai, netdev

On 5/20/2014 11:38 AM, Hans de Goede wrote:
> The stmmac_open call was calling clk_disable_unprepare on phy init
> failure, but it never calls clk_prepare_enable, this causes
> a WARN_ON in the clk framework to trigger if for some reason phy init
> fails.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

> ---
>   drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index d940034..0f4841d 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -1704,7 +1704,7 @@ static int stmmac_open(struct net_device *dev)
>   		if (ret) {
>   			pr_err("%s: Cannot attach to PHY (error: %d)\n",
>   			       __func__, ret);
> -			goto phy_error;
> +			return ret;
>   		}
>   	}
>
> @@ -1779,8 +1779,6 @@ init_error:
>   dma_desc_error:
>   	if (priv->phydev)
>   		phy_disconnect(priv->phydev);
> -phy_error:
> -	clk_disable_unprepare(priv->stmmac_clk);
>
>   	return ret;
>   }
>

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

* Re: [PATCH] stmmac: Remove unbalanced clk_disable call
  2014-05-20 10:08 ` Giuseppe CAVALLARO
@ 2014-05-20 10:59   ` Chen-Yu Tsai
  0 siblings, 0 replies; 4+ messages in thread
From: Chen-Yu Tsai @ 2014-05-20 10:59 UTC (permalink / raw)
  To: Giuseppe CAVALLARO; +Cc: Hans de Goede, netdev

On Tue, May 20, 2014 at 6:08 PM, Giuseppe CAVALLARO
<peppe.cavallaro@st.com> wrote:
> On 5/20/2014 11:38 AM, Hans de Goede wrote:
>>
>> The stmmac_open call was calling clk_disable_unprepare on phy init
>> failure, but it never calls clk_prepare_enable, this causes
>> a WARN_ON in the clk framework to trigger if for some reason phy init
>> fails.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
>
> Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

This looks like left-overs from

    62866e9 net: stmmac: Enable stmmac main clock when probing hardware

Acked-by: Chen-Yu Tsai <wens@csie.org>

>> ---
>>   drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +---
>>   1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> index d940034..0f4841d 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> @@ -1704,7 +1704,7 @@ static int stmmac_open(struct net_device *dev)
>>                 if (ret) {
>>                         pr_err("%s: Cannot attach to PHY (error: %d)\n",
>>                                __func__, ret);
>> -                       goto phy_error;
>> +                       return ret;
>>                 }
>>         }
>>
>> @@ -1779,8 +1779,6 @@ init_error:
>>   dma_desc_error:
>>         if (priv->phydev)
>>                 phy_disconnect(priv->phydev);
>> -phy_error:
>> -       clk_disable_unprepare(priv->stmmac_clk);
>>
>>         return ret;
>>   }
>>
>

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

* Re: [PATCH] stmmac: Remove unbalanced clk_disable call
  2014-05-20  9:38 [PATCH] stmmac: Remove unbalanced clk_disable call Hans de Goede
  2014-05-20 10:08 ` Giuseppe CAVALLARO
@ 2014-05-22 19:11 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2014-05-22 19:11 UTC (permalink / raw)
  To: hdegoede; +Cc: peppe.cavallaro, wens, netdev

From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 20 May 2014 11:38:18 +0200

> The stmmac_open call was calling clk_disable_unprepare on phy init
> failure, but it never calls clk_prepare_enable, this causes
> a WARN_ON in the clk framework to trigger if for some reason phy init
> fails.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Applied, thanks.

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

end of thread, other threads:[~2014-05-22 19:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-20  9:38 [PATCH] stmmac: Remove unbalanced clk_disable call Hans de Goede
2014-05-20 10:08 ` Giuseppe CAVALLARO
2014-05-20 10:59   ` Chen-Yu Tsai
2014-05-22 19:11 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).