]> www.infradead.org Git - users/hch/misc.git/commit
net: fec: don't save PTP state if PTP is unsupported
authorWei Fang <wei.fang@nxp.com>
Tue, 8 Oct 2024 06:11:53 +0000 (14:11 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 10 Oct 2024 02:37:55 +0000 (19:37 -0700)
commit6be063071a457767ee229db13f019c2ec03bfe44
treeb471aefb43f7ac1f63bf9e40f3d3d621bf993055
parent080ddc22f3b0a58500f87e8e865aabbf96495eea
net: fec: don't save PTP state if PTP is unsupported

Some platforms (such as i.MX25 and i.MX27) do not support PTP, so on
these platforms fec_ptp_init() is not called and the related members
in fep are not initialized. However, fec_ptp_save_state() is called
unconditionally, which causes the kernel to panic. Therefore, add a
condition so that fec_ptp_save_state() is not called if PTP is not
supported.

Fixes: a1477dc87dc4 ("net: fec: Restart PPS after link state change")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/lkml/353e41fe-6bb4-4ee9-9980-2da2a9c1c508@roeck-us.net/
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Csókás, Bence <csokas.bence@prolan.hu>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Link: https://patch.msgid.link/20241008061153.1977930-1-wei.fang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/fec_main.c