From: Wang Dongsheng <hidden> Date: 2012-11-06 06:48:51
we should make sure a ethernet has been taken down when system into hibernation
status. when the system restoring form hibernation, the ethernet cannot be
taken up.
eg:
~# ifconfig eth0 down
~# echo disk > /sys/power/state
hibernation restore
~# ifconfig eth0 up
SIOCSIFFLAGS: No such device
Signed-off-by: Wang Dongsheng <redacted>
---
drivers/net/ethernet/freescale/gianfar.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
From: Paul Gortmaker <hidden> Date: 2012-11-09 14:44:09
From: Wang Dongsheng <redacted>
If a gianfar ethernet device is down prior to hibernating a
system, it will no longer be present upon system restore.
For example:
~# ifconfig eth0 down
~# echo disk > /sys/power/state
<trigger a restore from hibernation>
~# ifconfig eth0 up
SIOCSIFFLAGS: No such device
This happens because the restore function bails out early upon
finding devices that were not up at hibernation. In doing so,
it never gets to the netif_device_attach call at the end of
the restore function. Adding the netif_device_attach as done
here also makes the gfar_restore code consistent with what is
done in the gfar_resume code.
Cc: Claudiu Manoil <redacted>
Signed-off-by: Wang Dongsheng <redacted>
Signed-off-by: Paul Gortmaker <redacted>
---
[v2: expand on details in commit log a bit more, to superceed
v1 at http://patchwork.ozlabs.org/patch/197412/ ]
drivers/net/ethernet/freescale/gianfar.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
From: Wang Dongsheng <redacted>
If a gianfar ethernet device is down prior to hibernating a
system, it will no longer be present upon system restore.
For example:
~# ifconfig eth0 down
~# echo disk > /sys/power/state
<trigger a restore from hibernation>
~# ifconfig eth0 up
SIOCSIFFLAGS: No such device
This happens because the restore function bails out early upon
finding devices that were not up at hibernation. In doing so,
it never gets to the netif_device_attach call at the end of
the restore function. Adding the netif_device_attach as done
here also makes the gfar_restore code consistent with what is
done in the gfar_resume code.
Cc: Claudiu Manoil <redacted>
Hello Paul,
Thought I don't have the proper setup to test the hibernation feature,
I agree with this patch especially now that the description is much
clearer. I fully agree on the consistency argument b/w gfar_restore and
gfar_resume. (good observation)
Acked-by: Claudiu Manoil <redacted>
From: David Miller <davem@davemloft.net> Date: 2012-11-09 22:09:01
From: Paul Gortmaker <redacted>
Date: Fri, 9 Nov 2012 09:43:51 -0500
From: Wang Dongsheng <redacted>
If a gianfar ethernet device is down prior to hibernating a
system, it will no longer be present upon system restore.
For example:
~# ifconfig eth0 down
~# echo disk > /sys/power/state
<trigger a restore from hibernation>
~# ifconfig eth0 up
SIOCSIFFLAGS: No such device
This happens because the restore function bails out early upon
finding devices that were not up at hibernation. In doing so,
it never gets to the netif_device_attach call at the end of
the restore function. Adding the netif_device_attach as done
here also makes the gfar_restore code consistent with what is
done in the gfar_resume code.
Cc: Claudiu Manoil <redacted>
Signed-off-by: Wang Dongsheng <redacted>
Signed-off-by: Paul Gortmaker <redacted>