Skip to content

Commit

Permalink
net: phy: micrel: Move netif_rx() outside of IRQ-off section.
Browse files Browse the repository at this point in the history
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 <andrew@lunn.ch>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Divya Koppera <Divya.Koppera@microchip.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sebastian Andrzej Siewior authored and David S. Miller committed Mar 7, 2022
1 parent 2655926 commit 67dbd6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/phy/micrel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
}

Expand Down

0 comments on commit 67dbd6c

Please sign in to comment.