Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6550544ybx; Mon, 11 Nov 2019 10:48:10 -0800 (PST) X-Google-Smtp-Source: APXvYqy+t4pUYhlRo0MGDvxWKov/a1EpYeAWcpFrUNt5h+vgXYgy/8lw3Alb5eYU03ktmxbZ+1li X-Received: by 2002:a50:8dc9:: with SMTP id s9mr3473510edh.155.1573498090180; Mon, 11 Nov 2019 10:48:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573498090; cv=none; d=google.com; s=arc-20160816; b=MajIM+Z2FSFTd4RKMytN8cZFNwK3TfvAKWUJT7VPRQ9KX42bIPgMm+ZQg3fefdrqvF R8yhK08YFEu1/pO1cTx5aWeN4IjOmqG8FkWdKmssQxa1dYhFSmFVK1DKm7baz/G+JFpR zeBKGeTg3mx/JrtmAZ40rN/An8720DL60WY8AX5xiK+HaSjIPSHUpNIx+PwzSL1rI5KR 3fSXM5n1XEcdgzIFkz4Qo2WqwGl7B2RyD3TBQCvIYtfhBXT+hBRRF7E6KkWTKOfu10r3 HMKjq7VyR81qYrdEaW2SnsG40i+bSgGvNJLiTZKzZfeXY5xyprQ8SFYteSbQAhhytryf O8Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2vqJKyVJ6o0rdwyEGS2aOGKq0QDYzZWBsaVoS5RkpFk=; b=uaFgwhszsqH3wSs7TtvfL51d3cpSwM4s/SKHBT8yDmdWgNGCONevE0P2G+nqE/AqV9 SdZbMwMFaCXBm0w/Tb403aTwnjYW7S6iNXpKFkaGL0GzdXzIgDDupg3iDr8NdEHNf2d5 /OuowWBX9mbDSuwQch2K2uiH74xMEersulGJdKE5s/hHZz/R6oJqq4m3hmQb7xAzEJcg cbrBJOM9UKO/v9uVquyebbYonXJHqYE8xIg42qbhX9FD8Td8iYE9GFOFbUZrsEFwPjga F/GbN5/nbRytWsD5cDT+mz55dcrdfwOa0qMXGs7YoXQ0GhprnbpyEzUtoUARc3OOYv8g Uugw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=z2DN74Wt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h37si12478600eda.249.2019.11.11.10.47.46; Mon, 11 Nov 2019 10:48:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=z2DN74Wt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727164AbfKKSqe (ORCPT + 99 others); Mon, 11 Nov 2019 13:46:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:39050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728231AbfKKSqd (ORCPT ); Mon, 11 Nov 2019 13:46:33 -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 671BA21655; Mon, 11 Nov 2019 18:46:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497992; bh=1G2RTe8bkhAi0JvZ0DOc/Hnu08pCUoVbpcdYhiBBMiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z2DN74Wt9gaO1GpKOjRo4xcwjR6ZxOsoma5hsmD7XT2sdlwtcsJXw/AaFOXXgilQK OHp4Z1hpeCTj3uWVw6vxrq4bsa3BYEBScx0hHSMEBDul4IWaj9jaAqzmWQth84e1VN i73008GEGD59Kq3ZtrfJ8BWi8xEO9qClV5zZrpp8= 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 4.19 116/125] igb: Fix constant media auto sense switching when no cable is connected Date: Mon, 11 Nov 2019 19:29:15 +0100 Message-Id: <20191111181455.335395928@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181438.945353076@linuxfoundation.org> References: <20191111181438.945353076@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 ab76a5f77cd0e..36db874f3c928 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