mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Mahr <dac922@gmx.de>
To: Russell King <linux@armlinux.org.uk>, netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Stefan Mahr <dac922@gmx.de>
Subject: [PATCH] net: sfp: reset fault retry counter on successful reinitialisation
Date: Fri, 12 Aug 2022 15:04:38 +0200	[thread overview]
Message-ID: <20220812130438.140434-1-dac922@gmx.de> (raw)

This patch resets the fault retry counter to the default value, if the
module reinitialisation was successful. Otherwise without resetting
the counter, five (N_FAULT/N_FAULT_INIT) single TX_FAULT events will
deactivate the module persistently.

In case the reinitialisation was not successful after five retries,
the module is still being deactivated.

Signed-off-by: Stefan Mahr <dac922@gmx.de>
---
 drivers/net/phy/sfp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 63f90fe9a4d2..a8d7a713222a 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -2263,6 +2263,9 @@ static void sfp_sm_main(struct sfp *sfp, unsigned int event)
 		} else if (event == SFP_E_TIMEOUT || event == SFP_E_TX_CLEAR) {
 			dev_info(sfp->dev, "module transmit fault recovered\n");
 			sfp_sm_link_check_los(sfp);
+
+			/* Reset the fault retry count */
+			sfp->sm_fault_retries = N_FAULT;
 		}
 		break;

--
2.25.1


             reply	other threads:[~2022-08-12 13:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12 13:04 Stefan Mahr [this message]
2022-08-12 15:07 ` Russell King (Oracle)
2022-08-12 15:45   ` Stefan Mahr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220812130438.140434-1-dac922@gmx.de \
    --to=dac922@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®