Skip to content

Commit

Permalink
net: lan969x: fix the use of spin_lock in PTP handler
Browse files Browse the repository at this point in the history
We are mixing the use of spin_lock() and spin_lock_irqsave() functions
in the PTP handler of lan969x. Fix this by correctly using the _irqsave
variants.

Fixes: 24fe835 ("net: lan969x: add PTP handler function")
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>

[1]: https://lore.kernel.org/netdev/20241024-sparx5-lan969x-switch-driver-2-v2-10-a0b5fae88a0f@microchip.com/

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Danielmachon authored and davem330 committed Dec 9, 2024
1 parent 1cd7523 commit aa5fc88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ static irqreturn_t lan969x_ptp_irq_handler(int irq, void *args)
if (WARN_ON(!skb_match))
continue;

spin_lock(&sparx5->ptp_ts_id_lock);
spin_lock_irqsave(&sparx5->ptp_ts_id_lock, flags);
sparx5->ptp_skbs--;
spin_unlock(&sparx5->ptp_ts_id_lock);
spin_unlock_irqrestore(&sparx5->ptp_ts_id_lock, flags);

/* Get the h/w timestamp */
sparx5_get_hwtimestamp(sparx5, &ts, delay);
Expand Down

0 comments on commit aa5fc88

Please sign in to comment.