netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Manfred Rudigier <manfred.rudigier@omicronenergy.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	Aaron Brown <aaron.f.brown@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net v2 3/7] igb: Fix constant media auto sense switching when no cable is connected
Date: Fri,  1 Nov 2019 13:25:34 -0700	[thread overview]
Message-ID: <20191101202538.665-4-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20191101202538.665-1-jeffrey.t.kirsher@intel.com>

From: Manfred Rudigier <manfred.rudigier@omicronenergy.com>

At least on the i350 there is an annoying behavior that is maybe also
present on 82580 devices, but was probably not noticed yet as MAS is not
widely used.

If no cable is connected on both fiber/copper ports the media auto sense
code will constantly swap between them as part of the watchdog task and
produce many unnecessary kernel log messages.

The swap code responsible for this behavior (switching to fiber) should
not be executed if the current media type is copper and there is no signal
detected on the fiber port. In this case we can safely wait until the
AUTOSENSE_EN bit is cleared.

Signed-off-by: Manfred Rudigier <manfred.rudigier@omicronenergy.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
v2: Fixed alignment issue with the wrapped line of code

 drivers/net/ethernet/intel/igb/igb_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 17a961c3d6e4..9148c62d9ac5 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2065,7 +2065,8 @@ static void igb_check_swap_media(struct igb_adapter *adapter)
 	if ((hw->phy.media_type == e1000_media_type_copper) &&
 	    (!(connsw & E1000_CONNSW_AUTOSENSE_EN))) {
 		swap_now = true;
-	} else if (!(connsw & E1000_CONNSW_SERDESD)) {
+	} else if ((hw->phy.media_type != e1000_media_type_copper) &&
+		   !(connsw & E1000_CONNSW_SERDESD)) {
 		/* copper signal takes time to appear */
 		if (adapter->copper_tries < 4) {
 			adapter->copper_tries++;
-- 
2.21.0


  parent reply	other threads:[~2019-11-01 20:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-01 20:25 [net v2 0/7][pull request] Intel Wired LAN Driver Updates 2019-11-01 Jeff Kirsher
2019-11-01 20:25 ` [net v2 1/7] igb/igc: Don't warn on fatal read failures when the device is removed Jeff Kirsher
2019-11-01 20:25 ` [net v2 2/7] igb: Enable media autosense for the i350 Jeff Kirsher
2019-11-01 20:25 ` Jeff Kirsher [this message]
2019-11-01 20:25 ` [net v2 4/7] i40e: Fix receive buffer starvation for AF_XDP Jeff Kirsher
2019-11-01 20:25 ` [net v2 5/7] e1000: fix memory leaks Jeff Kirsher
2019-11-01 20:25 ` [net v2 6/7] Documentation: networking: device drivers: Remove stray asterisks Jeff Kirsher
2019-11-01 20:25 ` [net v2 7/7] ixgbe: Remove duplicate clear_bit() call Jeff Kirsher
2019-11-01 21:52 ` [net v2 0/7][pull request] Intel Wired LAN Driver Updates 2019-11-01 David Miller

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=20191101202538.665-4-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=aaron.f.brown@intel.com \
    --cc=davem@davemloft.net \
    --cc=manfred.rudigier@omicronenergy.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).