From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C69DC43331 for ; Mon, 11 Nov 2019 18:59:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ECCC421655 for ; Mon, 11 Nov 2019 18:59:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573498746; bh=xRjkGyC2T/u82vScRl5yZiADyi8Ko5EwIaJV0FyKyac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xUNGobXY72wLmInBs9H2XIFLthTDIG7wAWhOFu9NbMRwcrFRcl/uG4ZVBcuaPzfAz CFs4fwkK1FBdq04bebdMT7RJPJnYZ/mseAlGl1h3BDefgxdehIL5hNmBwxShGgLXAr UrCvB0Y3AEI8MVce3OHGngCW4oJX2VYDT4xWuBrM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728772AbfKKS5v (ORCPT ); Mon, 11 Nov 2019 13:57:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:57786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730875AbfKKS5v (ORCPT ); Mon, 11 Nov 2019 13:57:51 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3132120659; Mon, 11 Nov 2019 18:57:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573498670; bh=xRjkGyC2T/u82vScRl5yZiADyi8Ko5EwIaJV0FyKyac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LplaWkbEhJcRk5e2k5fM5hkotYnj63YcpdDTOCO6brgfQx4Nw3TJUp/FoXpeW0GT0 9EXT2tXZDksnfy1oTMHgaMfcY8UaR03tQsh77OPNv19taJKcaqFu1fS5OnTSqnsZmz aNMqDJV4OZL59FOnhjQ9bO2uz0rCS+blND6fYmCw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manfred Rudigier , Aaron Brown , Jeff Kirsher , Sasha Levin Subject: [PATCH 5.3 185/193] igb: Fix constant media auto sense switching when no cable is connected Date: Mon, 11 Nov 2019 19:29:27 +0100 Message-Id: <20191111181514.741290870@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181459.850623879@linuxfoundation.org> References: <20191111181459.850623879@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Manfred Rudigier [ Upstream commit 8d5cfd7f76a2414e23c74bb8858af7540365d985 ] 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 Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- 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 b4df3e319467e..93a1352f5be90 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++; -- 2.20.1