summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale/gianfar_ethtool.c
diff options
context:
space:
mode:
authorClaudiu Manoil <claudiu.manoil@freescale.com>2014-04-02 14:15:56 (GMT)
committerJose Rivera <German.Rivera@freescale.com>2014-04-11 16:24:06 (GMT)
commit6f834514194a11e2e1b17a7a4e6e17a81969378d (patch)
treeb9c3f7cc217c3476b4adb019117a355043e72b67 /drivers/net/ethernet/freescale/gianfar_ethtool.c
parentf584822a2ed39f757ca290b464bef7cdd7bb9ab3 (diff)
downloadlinux-fsl-qoriq-6f834514194a11e2e1b17a7a4e6e17a81969378d.tar.xz
gianfar: Fix suspend/resume for wol magic packet
Don't detach the interfaces that are already down. Use correct sequence to stop Tx traffic and to prevent Tx timeout, including napi disabling. Use netif_tx_lock() to prevent races while stopping Tx, replacing the driver specific lock_tx_qs() which is not correct for this purpose. Use gfar_halt() to correctly stop the traffic at controller level (i.e. graceful stop the DMA). Fix the invalid device references for the wakeup routines, from the invalid &dev->dev references to the correct &ofdev->dev (or priv->dev) references. Remove buggy device_set_wakeup_enable() from the open() routine. Only the ethtool is allowed to enable/disable the wol capabilities. Remove superfluous priv->bflock lock, as it's not justified. Use IRQF_NO_SUSPEND to be able to wake up the system by magic packet generated interrupts. Change-Id: If9b4a878aa3ee6df8867bab9ca19d96b731e9fa9 Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/10728 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Jeffrey Ladouceur <Jeffrey.Ladouceur@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/gianfar_ethtool.c')
-rw-r--r--drivers/net/ethernet/freescale/gianfar_ethtool.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
index f2dfa10..2b980d5 100644
--- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
@@ -646,7 +646,6 @@ static void gfar_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
static int gfar_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
struct gfar_private *priv = netdev_priv(dev);
- unsigned long flags;
if (!(priv->device_flags & FSL_GIANFAR_DEV_HAS_MAGIC_PACKET) &&
wol->wolopts != 0)
@@ -655,11 +654,9 @@ static int gfar_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
if (wol->wolopts & ~WAKE_MAGIC)
return -EINVAL;
- device_set_wakeup_enable(&dev->dev, wol->wolopts & WAKE_MAGIC);
+ device_set_wakeup_enable(priv->dev, wol->wolopts & WAKE_MAGIC);
- spin_lock_irqsave(&priv->bflock, flags);
- priv->wol_en = !!device_may_wakeup(&dev->dev);
- spin_unlock_irqrestore(&priv->bflock, flags);
+ priv->wol_en = !!device_may_wakeup(priv->dev);
return 0;
}