Commit 083731a8 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

net: bcmgenet: avoid unbalanced enable_irq_wake calls

Multiple enable_irq_wake() calls will keep increasing the IRQ
wake_depth, which ultimately leads to the following types of
situation:

1) enable Wake-on-LAN interrupt w/o password
2) enable Wake-on-LAN interrupt w/ password
3) enable Wake-on-LAN interrupt w/o password
4) disable Wake-on-LAN interrupt

After step 4), GENET would always wake-up the system no matter what
wake-up device we use, which is not what we want. Fix this by making
sure there are no unbalanced enable_irq_wake() calls.
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cf377d88
...@@ -86,7 +86,9 @@ int bcmgenet_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) ...@@ -86,7 +86,9 @@ int bcmgenet_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
/* Flag the device and relevant IRQ as wakeup capable */ /* Flag the device and relevant IRQ as wakeup capable */
if (wol->wolopts) { if (wol->wolopts) {
device_set_wakeup_enable(kdev, 1); device_set_wakeup_enable(kdev, 1);
enable_irq_wake(priv->wol_irq); /* Avoid unbalanced enable_irq_wake calls */
if (priv->wol_irq_disabled)
enable_irq_wake(priv->wol_irq);
priv->wol_irq_disabled = false; priv->wol_irq_disabled = false;
} else { } else {
device_set_wakeup_enable(kdev, 0); device_set_wakeup_enable(kdev, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment