Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: mscc: ocelot: improve handling of TX timestamp for unknown skb

This condition, theoretically impossible to trigger, is not really
handled well. By "continuing", we are skipping the write to SYS_PTP_NXT
which advances the timestamp FIFO to the next entry. So we are reading
the same FIFO entry all over again, printing stack traces and eventually
killing the kernel.

No real problem has been observed here. This is part of a larger rework
of the timestamp IRQ procedure, with this logical change split out into
a patch of its own. We will need to "goto next_ts" for other conditions
as well.

Fixes: 9fde506e0c53 ("net: mscc: ocelot: warn when a PTP IRQ is raised for an unknown skb")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20241205145519.1236778-3-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Vladimir Oltean and committed by
Jakub Kicinski
b6fba4b3 4b01bec2

+2 -2
+2 -2
drivers/net/ethernet/mscc/ocelot_ptp.c
··· 786 786 spin_unlock_irqrestore(&port->tx_skbs.lock, flags); 787 787 788 788 if (WARN_ON(!skb_match)) 789 - continue; 789 + goto next_ts; 790 790 791 791 if (!ocelot_validate_ptp_skb(skb_match, seqid)) { 792 792 dev_err_ratelimited(ocelot->dev, ··· 804 804 shhwtstamps.hwtstamp = ktime_set(ts.tv_sec, ts.tv_nsec); 805 805 skb_complete_tx_timestamp(skb_match, &shhwtstamps); 806 806 807 - /* Next ts */ 807 + next_ts: 808 808 ocelot_write(ocelot, SYS_PTP_NXT_PTP_NXT, SYS_PTP_NXT); 809 809 } 810 810 }