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. ====================
Unified · Split
| @@ -436,7 +436,8 @@ static int bcm_sysport_set_wol(struct net_device *dev, · 435 unmodified lines | ||
| 436 | 436 | /* Flag the device and relevant IRQ as wakeup capable */ |
| 437 | 437 | if (wol->wolopts) { |
| 438 | 438 | device_set_wakeup_enable(kdev, 1); |
| 439 | − enable_irq_wake(priv->wol_irq); | |
| 439 | + if (priv->wol_irq_disabled) | |
| 440 | + enable_irq_wake(priv->wol_irq); | |
| 440 | 441 | priv->wol_irq_disabled = 0; |
| 441 | 442 | } else { |
| 442 | 443 | device_set_wakeup_enable(kdev, 0); |
| @@ -1285,11 +1285,6 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_priv *priv, · 1284 unmodified lines | ||
| 1285 | 1285 | cb = &priv->rx_cbs[priv->rx_read_ptr]; |
| 1286 | 1286 | skb = cb->skb; |
| 1287 | 1287 | |
| 1288 | − rxpktprocessed++; | |
| 1289 | − | |
| 1290 | − priv->rx_read_ptr++; | |
| 1291 | − priv->rx_read_ptr &= (priv->num_rx_bds - 1); | |
| 1292 | − | |
| 1293 | 1288 | /* We do not have a backing SKB, so we do not have a |
| 1294 | 1289 | * corresponding DMA mapping for this incoming packet since |
| 1295 | 1290 | * bcmgenet_rx_refill always either has both skb and mapping or |
| @@ -1404,6 +1399,10 @@ refill: · 108 unmodified lines | ||
| 1404 | 1399 | err = bcmgenet_rx_refill(priv, cb); |
| 1405 | 1400 | if (err) |
| 1406 | 1401 | netif_err(priv, rx_err, dev, "Rx refill failed\n"); |
| 1402 | + | |
| 1403 | + rxpktprocessed++; | |
| 1404 | + priv->rx_read_ptr++; | |
| 1405 | + priv->rx_read_ptr &= (priv->num_rx_bds - 1); | |
| 1407 | 1406 | } |
| 1408 | 1407 | |
| 1409 | 1408 | return rxpktprocessed; |
| @@ -86,7 +86,9 @@ int bcmgenet_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) · 85 unmodified lines | ||
| 86 | 86 | /* Flag the device and relevant IRQ as wakeup capable */ |
| 87 | 87 | if (wol->wolopts) { |
| 88 | 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 | 92 | priv->wol_irq_disabled = false; |
| 91 | 93 | } else { |
| 92 | 94 | device_set_wakeup_enable(kdev, 0); |