diff mbox

stmmac: fix stmmac_resume removing not yet used shutdown flag

Message ID 1290740072-1341-1-git-send-email-peppe.cavallaro@st.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Giuseppe CAVALLARO Nov. 26, 2010, 2:11 p.m. UTC
The commit to convert to use the dev_pm_ops struct
introduces a bug. The shutdown flag is not yet used
because the hibernation on memory is done by using
the freeze callback.
Thanks to Vlad for having reported it.

Reported-by: Vlad Lungu <vlad.lungu@windriver.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/stmmac/stmmac_main.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

Comments

Giuseppe CAVALLARO Nov. 26, 2010, 2:16 p.m. UTC | #1
On 11/26/2010 3:11 PM, Peppe CAVALLARO wrote:
> The commit to convert to use the dev_pm_ops struct
> introduces a bug. The shutdown flag is not yet used
> because the hibernation on memory is done by using
> the freeze callback.
> Thanks to Vlad for having reported it.
Hi Vlad,
as we discussed via email, I'll also look at how to manage the
patch that reworked the private structure and that's generating
problems on your HW (I'll also try to have it for testing!).

Many thanks for the feedback and for having spotted this issue (sorry!).

Regards,
Peppe
> Reported-by: Vlad Lungu <vlad.lungu@windriver.com>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> ---
>  drivers/net/stmmac/stmmac_main.c |    7 -------
>  1 files changed, 0 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c
> index f1dbc18..730a6fd 100644
> --- a/drivers/net/stmmac/stmmac_main.c
> +++ b/drivers/net/stmmac/stmmac_main.c
> @@ -1846,13 +1846,6 @@ static int stmmac_resume(struct device *dev)
>  	if (!netif_running(ndev))
>  		return 0;
>  
> -	if (priv->shutdown) {
> -		/* Re-open the interface and re-init the MAC/DMA
> -		   and the rings (i.e. on hibernation stage) */
> -		stmmac_open(dev);
> -		return 0;
> -	}
> -
>  	spin_lock(&priv->lock);
>  
>  	/* Power Down bit, into the PM register, is cleared
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Nov. 29, 2010, 2:11 a.m. UTC | #2
From: Peppe CAVALLARO <peppe.cavallaro@st.com>
Date: Fri, 26 Nov 2010 15:11:45 +0100

> The commit to convert to use the dev_pm_ops struct
> introduces a bug. The shutdown flag is not yet used
> because the hibernation on memory is done by using
> the freeze callback.
> Thanks to Vlad for having reported it.
> 
> Reported-by: Vlad Lungu <vlad.lungu@windriver.com>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Vlad Lungu Nov. 29, 2010, 10:32 a.m. UTC | #3
Peppe CAVALLARO wrote:
> On 11/26/2010 3:11 PM, Peppe CAVALLARO wrote:
>> The commit to convert to use the dev_pm_ops struct
>> introduces a bug. The shutdown flag is not yet used
>> because the hibernation on memory is done by using
>> the freeze callback.
>> Thanks to Vlad for having reported it.
> Hi Vlad,
> as we discussed via email, I'll also look at how to manage the
> patch that reworked the private structure and that's generating
> problems on your HW (I'll also try to have it for testing!).
> 

Actually, this is is not a blocking problem. I can kmalloc a platform
info structure and fill it with the relevant data on probe. It just feels ... wrong.

The way I see it, the platform info is similar to the PNP on an ISA bus or
the PCI header of a device. Having platform info for a PCI device is kind of
a hack. You didn't know that there's a PCI device out there and that someone
wants to submit a patch for it, so it probably made sense at the time to rework
the structure that particular way.

Regards,
Vlad



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c
index f1dbc18..730a6fd 100644
--- a/drivers/net/stmmac/stmmac_main.c
+++ b/drivers/net/stmmac/stmmac_main.c
@@ -1846,13 +1846,6 @@  static int stmmac_resume(struct device *dev)
 	if (!netif_running(ndev))
 		return 0;
 
-	if (priv->shutdown) {
-		/* Re-open the interface and re-init the MAC/DMA
-		   and the rings (i.e. on hibernation stage) */
-		stmmac_open(dev);
-		return 0;
-	}
-
 	spin_lock(&priv->lock);
 
 	/* Power Down bit, into the PM register, is cleared