WSL2-Linux-Kernel/drivers/net/dsa/mv88e6xxx
Richard Cochran 2290482379 net: dsa: mv88e6xxx: Fix receive time stamp race condition.
The DSA stack passes received PTP frames to this driver via
mv88e6xxx_port_rxtstamp() for deferred delivery.  The driver then
queues the frame and kicks the worker thread.  The work callback reads
out the latched receive time stamp and then works through the queue,
delivering any non-matching frames without a time stamp.

If a new frame arrives after the worker thread has read out the time
stamp register but enters the queue before the worker finishes
processing the queue, that frame will be delivered without a time
stamp.

This patch fixes the race by moving the queue onto a list on the stack
before reading out the latched time stamp value.

Fixes: c6fe0ad2c3 ("net: dsa: mv88e6xxx: add rx/tx timestamping support")
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-04-12 22:05:58 -04:00
..
Kconfig net: dsa: mv88e6xxx: expose switch time as a PTP hardware clock 2018-02-14 14:33:36 -05:00
Makefile net: dsa: mv88e6xxx: add rx/tx timestamping support 2018-02-14 14:33:37 -05:00
chip.c net: dsa: mv88e6xxx: Keep ATU/VTU violation statistics 2018-03-29 15:04:22 -04:00
chip.h net: dsa: mv88e6xxx: Keep ATU/VTU violation statistics 2018-03-29 15:04:22 -04:00
global1.c net: dsa: mv88e6xxx: Fix stats histogram mode 2017-11-11 19:34:33 +09:00
global1.h net: dsa: mv88e6xxx: Decode VTU problem interrupt 2018-01-14 12:08:45 -05:00
global1_atu.c net: dsa: mv88e6xxx: Keep ATU/VTU violation statistics 2018-03-29 15:04:22 -04:00
global1_vtu.c net: dsa: mv88e6xxx: Make VTU miss violations less spammy 2018-03-29 15:04:22 -04:00
global2.c net: dsa: mv88e6xxx: Fix interrupt name for g2 irq 2018-03-20 12:29:58 -04:00
global2.h net: dsa: mv88e6xxx: Add MDIO interrupts for internal PHYs 2018-03-18 16:52:59 -04:00
global2_avb.c net: dsa: mv88e6xxx: add accessors for PTP/TAI registers 2018-02-14 14:33:36 -05:00
global2_scratch.c net: dsa: mv88e6xxx: scratch registers and external MDIO pins 2018-02-22 14:46:32 -05:00
hwtstamp.c net: dsa: mv88e6xxx: Fix receive time stamp race condition. 2018-04-12 22:05:58 -04:00
hwtstamp.h net: dsa: mv88e6xxx: add workaround for 6341 timestamping 2018-02-14 14:33:37 -05:00
phy.c treewide: setup_timer() -> timer_setup() 2017-11-21 15:57:07 -08:00
phy.h net: dsa: mv88e6xxx: remove EEE support 2017-08-01 20:09:10 -07:00
port.c net: dsa: allow XAUI phy interface mode 2017-12-13 14:59:15 -05:00
port.h net: dsa: mv88e6xxx: remove EEE support 2017-08-01 20:09:10 -07:00
ptp.c net: dsa: mv88e6xxx: add rx/tx timestamping support 2018-02-14 14:33:37 -05:00
ptp.h dsa: ptp: mark dummy helpers as 'inline' 2018-02-22 15:36:42 -05:00
serdes.c net: dsa: mv88e6xxx: Keep ATU/VTU violation statistics 2018-03-29 15:04:22 -04:00
serdes.h net: dsa: mv88e6xxx: Keep ATU/VTU violation statistics 2018-03-29 15:04:22 -04:00