Commit 01d2d484 authored by David S. Miller's avatar David S. Miller

Merge branch 'bcmgenet_systemport'

Florian Fainelli says:

====================
net: bcmgenet & systemport fixes

This patch series fixes an off-by-one error introduced during a previous
change, and the two other fixes fix a wake depth imbalance situation for
the Wake-on-LAN interrupt line.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 35b7a191 61b423a8
...@@ -436,7 +436,8 @@ static int bcm_sysport_set_wol(struct net_device *dev, ...@@ -436,7 +436,8 @@ static int bcm_sysport_set_wol(struct net_device *dev,
/* 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); if (priv->wol_irq_disabled)
enable_irq_wake(priv->wol_irq);
priv->wol_irq_disabled = 0; priv->wol_irq_disabled = 0;
} else { } else {
device_set_wakeup_enable(kdev, 0); device_set_wakeup_enable(kdev, 0);
......
...@@ -1285,11 +1285,6 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_priv *priv, ...@@ -1285,11 +1285,6 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_priv *priv,
cb = &priv->rx_cbs[priv->rx_read_ptr]; cb = &priv->rx_cbs[priv->rx_read_ptr];
skb = cb->skb; skb = cb->skb;
rxpktprocessed++;
priv->rx_read_ptr++;
priv->rx_read_ptr &= (priv->num_rx_bds - 1);
/* We do not have a backing SKB, so we do not have a /* We do not have a backing SKB, so we do not have a
* corresponding DMA mapping for this incoming packet since * corresponding DMA mapping for this incoming packet since
* bcmgenet_rx_refill always either has both skb and mapping or * bcmgenet_rx_refill always either has both skb and mapping or
...@@ -1404,6 +1399,10 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_priv *priv, ...@@ -1404,6 +1399,10 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_priv *priv,
err = bcmgenet_rx_refill(priv, cb); err = bcmgenet_rx_refill(priv, cb);
if (err) if (err)
netif_err(priv, rx_err, dev, "Rx refill failed\n"); netif_err(priv, rx_err, dev, "Rx refill failed\n");
rxpktprocessed++;
priv->rx_read_ptr++;
priv->rx_read_ptr &= (priv->num_rx_bds - 1);
} }
return rxpktprocessed; return rxpktprocessed;
......
...@@ -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