From patchwork Wed Aug 14 11:59:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manfred Rudigier X-Patchwork-Id: 1146987 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=omicronenergy.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=omicronenergy.com header.i=@omicronenergy.com header.b="UAtGOLrq"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 467pGM4Gc0z9sDB for ; Wed, 14 Aug 2019 22:06:35 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726522AbfHNMGd (ORCPT ); Wed, 14 Aug 2019 08:06:33 -0400 Received: from ns.omicron.at ([212.183.10.25]:50962 "EHLO ns.omicron.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfHNMGd (ORCPT ); Wed, 14 Aug 2019 08:06:33 -0400 X-Greylist: delayed 341 seconds by postgrey-1.27 at vger.kernel.org; Wed, 14 Aug 2019 08:06:31 EDT Received: from MGW02-ATKLA.omicron.at ([172.25.62.35]) by ns.omicron.at (8.15.2/8.15.2) with ESMTPS id x7EC0xog008592 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 14 Aug 2019 14:00:59 +0200 DKIM-Filter: OpenDKIM Filter v2.11.0 ns.omicron.at x7EC0xog008592 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=omicronenergy.com; s=default; t=1565784059; bh=hvJjyGDbLwQ/MBXPFq7wvY87wg5nsLk7BNsIoy2YOZk=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=UAtGOLrqRu0Ho3CrHK9fjKTdUkPAZjBst/hoJFX/fYcI8Ple3ao198jijlieLSmSb DKf0BHKnJtvoLc21Q9vnie3MD4YrRkhmEYX4sKRwta5UoYV00PrWWEDsKKEmG4Ehh7 tCwGi8A3RrqG/msItJqAtDGxhMrWMq4jhxiYU+no= Received: from MGW02-ATKLA.omicron.at (localhost [127.0.0.1]) by MGW02-ATKLA.omicron.at (Postfix) with ESMTP id 24B3DA0054 for ; Wed, 14 Aug 2019 14:00:59 +0200 (CEST) Received: from MGW01-ATKLA.omicron.at (unknown [172.25.62.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by MGW02-ATKLA.omicron.at (Postfix) with ESMTPS id 22D41A0068 for ; Wed, 14 Aug 2019 14:00:59 +0200 (CEST) Received: from EXC04-ATKLA.omicron.at ([172.22.100.189]) by MGW01-ATKLA.omicron.at with ESMTP id x7EC0xFH001055-x7EC0xFJ001055 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=CAFAIL); Wed, 14 Aug 2019 14:00:59 +0200 Received: from manrud11.omicron.at (172.22.24.34) by EXC04-ATKLA.omicron.at (172.22.100.189) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 14 Aug 2019 14:00:57 +0200 From: Manfred Rudigier To: CC: , , , , Manfred Rudigier Subject: [PATCH net 2/2] igb: Fix constant media auto sense switching when no cable is connected. Date: Wed, 14 Aug 2019 13:59:09 +0200 X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814115909.20839-1-manfred.rudigier@omicronenergy.com> References: <20190814115909.20839-1-manfred.rudigier@omicronenergy.com> MIME-Version: 1.0 X-Originating-IP: [172.22.24.34] X-ClientProxiedBy: EXC04-ATKLA.omicron.at (172.22.100.189) To EXC04-ATKLA.omicron.at (172.22.100.189) Message-ID: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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 95fc1a178ff3..891cd072d4dd 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -2064,7 +2064,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++;