aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <[email protected]>2022-03-06 22:57:53 +0100
committerDavid S. Miller <[email protected]>2022-03-07 11:40:41 +0000
commit67dbd6c0a2c427211244e344b85a55d6e82886bf (patch)
treec624eac211a2600ea1c384d14cc23daa1c7323af
parent2655926aea9beea62c9ba80c032485456fd848f0 (diff)
net: phy: micrel: Move netif_rx() outside of IRQ-off section.
lan8814_match_rx_ts() invokes netif_rx() with disables interrupts outside which will create a warning. Invoking netif_rx_ni() with disabled interrupts is wrong even without the recent rework because netif_rx_ni() would enable interrupts while processing the softirq. This in turn can lead to dead lock if an interrupts triggers and attempts to acquire kszphy_ptp_priv::rx_ts_lock. Move netif_rx() outside the IRQ-off section. Cc: Andrew Lunn <[email protected]> Cc: Heiner Kallweit <[email protected]> Cc: Russell King <[email protected]> Cc: Divya Koppera <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: David S. Miller <[email protected]>
-rw-r--r--drivers/net/phy/micrel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index d46b74ef3d6f..19b11e896460 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -2034,8 +2034,6 @@ static bool lan8814_match_rx_ts(struct kszphy_ptp_priv *ptp_priv,
memset(shhwtstamps, 0, sizeof(*shhwtstamps));
shhwtstamps->hwtstamp = ktime_set(rx_ts->seconds,
rx_ts->nsec);
- netif_rx(skb);
-
list_del(&rx_ts->list);
kfree(rx_ts);
@@ -2044,6 +2042,8 @@ static bool lan8814_match_rx_ts(struct kszphy_ptp_priv *ptp_priv,
}
spin_unlock_irqrestore(&ptp_priv->rx_ts_lock, flags);
+ if (ret)
+ netif_rx(skb);
return ret;
}