aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2014-10-10 13:51:53 -0400
committerDavid S. Miller <davem@davemloft.net>2014-10-10 15:39:15 -0400
commit083731a8fbe71d83fc908adf137dc98ee352f280 (patch)
treeafe0ffa0590c5d05b84879387375d2e34b0c3fdb /drivers/net
parentcf377d886f7944a5ccdbd164b89949e13617b096 (diff)
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: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
index b82b7e4e06b2..149a0d70c108 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
@@ -86,7 +86,9 @@ int bcmgenet_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
86 /* Flag the device and relevant IRQ as wakeup capable */ 86 /* Flag the device and relevant IRQ as wakeup capable */
87 if (wol->wolopts) { 87 if (wol->wolopts) {
88 device_set_wakeup_enable(kdev, 1); 88 device_set_wakeup_enable(kdev, 1);
89 enable_irq_wake(priv->wol_irq); 89 /* Avoid unbalanced enable_irq_wake calls */
90 if (priv->wol_irq_disabled)
91 enable_irq_wake(priv->wol_irq);
90 priv->wol_irq_disabled = false; 92 priv->wol_irq_disabled = false;
91 } else { 93 } else {
92 device_set_wakeup_enable(kdev, 0); 94 device_set_wakeup_enable(kdev, 0);