]> git.ipfire.org Git - thirdparty/linux.git/commit
net: micrel: Fix receiving the timestamp in the frame for lan8841
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Mon, 13 May 2024 19:21:57 +0000 (21:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 May 2024 12:38:31 +0000 (13:38 +0100)
commitaea27a92a41dae14843f92c79e9e42d8f570105c
tree5319ffd065eecb40b2170ba2fb8462c375f3297a
parentc2e0c58b25a0a0c37ec643255558c5af4450c9f5
net: micrel: Fix receiving the timestamp in the frame for lan8841

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@microchip.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/micrel.c