Re: [PATCH net v4] phy: mscc: Fix timestamping for vsc8584

From: Vadim Fedorenko
Date: Mon Aug 18 2025 - 07:09:46 EST


On 18/08/2025 09:10, Horatiu Vultur wrote:
There was a problem when we received frames and the frames were
timestamped. The driver is configured to store the nanosecond part of
the timestmap in the ptp reserved bits and it would take the second part
by reading the LTC. The problem is that when reading the LTC we are in
atomic context and to read the second part will go over mdio bus which
might sleep, so we get an error.
The fix consists in actually put all the frames in a queue and start the
aux work and in that work to read the LTC and then calculate the full
received time.

Fixes: 7d272e63e0979d ("net: phy: mscc: timestamping and PHC support")
Signed-off-by: Horatiu Vultur <horatiu.vultur@xxxxxxxxxxxxx>

---
v3->v4:
- remove empty line

v2->v3:
- make sure to flush the rx_skbs_list when the driver is removed

v1->v2:
- use sk_buff_head instead of a list_head and spinlock_t
- stop allocating vsc8431_skb but put the timestamp in skb->cb

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@xxxxxxxxx>