]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Oct 2024 04:27:10 +0000 (06:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Oct 2024 04:27:10 +0000 (06:27 +0200)
added patches:
net-fec-don-t-save-ptp-state-if-ptp-is-unsupported.patch

queue-6.6/net-fec-don-t-save-ptp-state-if-ptp-is-unsupported.patch [new file with mode: 0644]
queue-6.6/series

diff --git a/queue-6.6/net-fec-don-t-save-ptp-state-if-ptp-is-unsupported.patch b/queue-6.6/net-fec-don-t-save-ptp-state-if-ptp-is-unsupported.patch
new file mode 100644 (file)
index 0000000..12d5060
--- /dev/null
@@ -0,0 +1,55 @@
+From 6be063071a457767ee229db13f019c2ec03bfe44 Mon Sep 17 00:00:00 2001
+From: Wei Fang <wei.fang@nxp.com>
+Date: Tue, 8 Oct 2024 14:11:53 +0800
+Subject: net: fec: don't save PTP state if PTP is unsupported
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Wei Fang <wei.fang@nxp.com>
+
+commit 6be063071a457767ee229db13f019c2ec03bfe44 upstream.
+
+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>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/freescale/fec_main.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/freescale/fec_main.c
++++ b/drivers/net/ethernet/freescale/fec_main.c
+@@ -1058,7 +1058,8 @@ fec_restart(struct net_device *ndev)
+       u32 rcntl = OPT_FRAME_SIZE | 0x04;
+       u32 ecntl = FEC_ECR_ETHEREN;
+-      fec_ptp_save_state(fep);
++      if (fep->bufdesc_ex)
++              fec_ptp_save_state(fep);
+       /* Whack a reset.  We should wait for this.
+        * For i.MX6SX SOC, enet use AXI bus, we use disable MAC
+@@ -1321,7 +1322,8 @@ fec_stop(struct net_device *ndev)
+                       netdev_err(ndev, "Graceful transmit stop did not complete!\n");
+       }
+-      fec_ptp_save_state(fep);
++      if (fep->bufdesc_ex)
++              fec_ptp_save_state(fep);
+       /* Whack a reset.  We should wait for this.
+        * For i.MX6SX SOC, enet use AXI bus, we use disable MAC
index e19cb43c8759d4a4bb826d4035340f058b4cd95f..865236b891d7608cc76e85d8a509928d0c4401ed 100644 (file)
@@ -1 +1,2 @@
 unicode-don-t-special-case-ignorable-code-points.patch
+net-fec-don-t-save-ptp-state-if-ptp-is-unsupported.patch