Re: [PATCH net] net: micrel: Fix receiving the timestamp in the frame for lan8841

From: Simon Horman
Date: Mon May 13 2024 - 15:50:23 EST


On Mon, May 13, 2024 at 09:21:57PM +0200, Horatiu Vultur wrote:
> The blamed commit started to use the ptp workqueue to get the second
> part of the timestamp. And when the port was set down, then this
> workqueue is stopped. But if the config option NETWORK_PHY_TIMESTAMPING
> is not enabled, then the ptp_clock is not initialized so then it would
> crash when it would try to access the delayed work.
> So then basically by setting up and then down the port, it would crash.
> The fix consists in checking if the ptp_clock is initialized and only
> then cancel the delayed work.
>
> Fixes: cc7554954848 ("net: micrel: Change to receive timestamp in the frame for lan8841")
> Signed-off-by: Horatiu Vultur <horatiu.vultur@xxxxxxxxxxxxx>

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>