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=ham 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 D5A1FC43331 for ; Mon, 11 Nov 2019 18:35:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F36A2173B for ; Mon, 11 Nov 2019 18:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497305; bh=hSXP5BlIrHprB8jAsQ1pVwfYd3uQUcImPHcJBB0/Ahg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=J84clMloYEW17vG+yFFaXxCyrr6V/qXyJvYVYRJ2ShNIxZdGJLgxBKMU3fAEDs/M5 CX+2OfYvge/oW4JThhs+1jGIw+samh+3QJFNUtesRRTMVLbI0Ea/ZWs+EoekX61iVv RDCyGJtbzxNRqOzeeinPXpBGE1kNF6sZHRGCWiSY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728458AbfKKSfD (ORCPT ); Mon, 11 Nov 2019 13:35:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:52834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728445AbfKKSfC (ORCPT ); Mon, 11 Nov 2019 13:35:02 -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 184932173B; Mon, 11 Nov 2019 18:35:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497301; bh=hSXP5BlIrHprB8jAsQ1pVwfYd3uQUcImPHcJBB0/Ahg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vJ+GeeP3fl/tTQqcwJjUAi8iCi7z1KOQ5b3aqXS+rad1fO4vZ7x5i4c+G2TK7jQDa ZKKJ7sRk4rrGdNKxmjngnR24hh35luJeFYsyzeNEsa9PgZz8K8q8ME/JZdbdrslOsN 9L8QHWHmNd0Nkb6QHutjBl0uDloUfCTfprfYrq+g= 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.9 58/65] igb: Fix constant media auto sense switching when no cable is connected Date: Mon, 11 Nov 2019 19:28:58 +0100 Message-Id: <20191111181354.197999818@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181331.917659011@linuxfoundation.org> References: <20191111181331.917659011@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 7956176c2c73e..7e35bd6656307 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -1677,7 +1677,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