From a1d3a072c0c271c110536a5cb012c00beff8acde Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 11 Jun 2023 09:27:17 +0200 Subject: [PATCH] 6.1-stable patches added patches: net-sfp-fix-state-loss-when-updating-state_hw_mask.patch --- ...ate-loss-when-updating-state_hw_mask.patch | 49 +++++++++++++++++++ queue-6.1/series | 1 + 2 files changed, 50 insertions(+) create mode 100644 queue-6.1/net-sfp-fix-state-loss-when-updating-state_hw_mask.patch diff --git a/queue-6.1/net-sfp-fix-state-loss-when-updating-state_hw_mask.patch b/queue-6.1/net-sfp-fix-state-loss-when-updating-state_hw_mask.patch new file mode 100644 index 00000000000..4e847e74533 --- /dev/null +++ b/queue-6.1/net-sfp-fix-state-loss-when-updating-state_hw_mask.patch @@ -0,0 +1,49 @@ +From 04361b8bb81819efb68bf39c276025e2250ac537 Mon Sep 17 00:00:00 2001 +From: "Russell King (Oracle)" +Date: Fri, 17 Mar 2023 07:28:00 +0000 +Subject: net: sfp: fix state loss when updating state_hw_mask + +From: Russell King (Oracle) + +commit 04361b8bb81819efb68bf39c276025e2250ac537 upstream. + +Andrew reports that the SFF modules on one of the ZII platforms do not +indicate link up due to the SFP code believing that LOS indicating that +there is no signal being received from the remote end, but in fact the +LOS signal is showing that there is signal. + +What makes SFF modules different from SFPs is they typically have an +inverted LOS, which uncovered this issue. When we read the hardware +state, we mask it with state_hw_mask so we ignore anything we're not +interested in. However, we don't re-read when state_hw_mask changes, +leading to sfp->state being stale. + +Arrange for a software poll of the module state after we have parsed +the EEPROM in sfp_sm_mod_probe() and updated state_*_mask. This will +generate any necessary events for signal changes for the state +machine as well as updating sfp->state. + +Reported-by: Andrew Lunn +Tested-by: Andrew Lunn +Fixes: 8475c4b70b04 ("net: sfp: re-implement soft state polling setup") +Signed-off-by: Russell King (Oracle) +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/phy/sfp.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/net/phy/sfp.c ++++ b/drivers/net/phy/sfp.c +@@ -2199,6 +2199,11 @@ static void sfp_sm_module(struct sfp *sf + break; + } + ++ /* Force a poll to re-read the hardware signal state after ++ * sfp_sm_mod_probe() changed state_hw_mask. ++ */ ++ mod_delayed_work(system_wq, &sfp->poll, 1); ++ + err = sfp_hwmon_insert(sfp); + if (err) + dev_warn(sfp->dev, "hwmon probe failed: %pe\n", diff --git a/queue-6.1/series b/queue-6.1/series index 446f5d7d099..1abbc1a938c 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -1,4 +1,5 @@ scsi-megaraid_sas-add-flexible-array-member-for-sgls.patch +net-sfp-fix-state-loss-when-updating-state_hw_mask.patch spi-mt65xx-make-sure-operations-completed-before-unl.patch platform-surface-aggregator-allow-completion-work-it.patch platform-surface-aggregator_tabletsw-add-support-for.patch -- 2.47.3