From patchwork Sun Dec 29 17:24:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182563 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5463555ild; Sun, 29 Dec 2019 09:50:50 -0800 (PST) X-Google-Smtp-Source: APXvYqyjjrj54fzgtKqKQ33otihdh6mCksGGHvnfrD20C17ZQrhjxyWEQfMyEH+qub56JCIGw34E X-Received: by 2002:a9d:67d2:: with SMTP id c18mr67465318otn.362.1577641850562; Sun, 29 Dec 2019 09:50:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641850; cv=none; d=google.com; s=arc-20160816; b=Vfb8v45r+ZMUJNQ2bo9dDfohMRC02E9ZuIMn/BZaeKgTFh88d18hqZlPYGEjk8hxT0 8LrzOUv3wLvVq/E24bOsbKq+4nly4VU8fsAeoTaUc0ovkUW+h4zM/3zXN130PiM4W9DP offZ+ck6/dqQV+Fu1UoHkcxCCzC2VI4q3Pb12L9EQdWjF0D+ZMm8sDJD1VP6/EOe0Rd/ U3QnKI4vp0VgCiBpYup/09w85/Dntq3adnEIehMlZUy/+lB++V7QvhyStj/Rjkd6vbnG bJsl5SMvfBcCQf/3gJVouMeJLzzkfdSbMmLMgmKO7gLDm29c9vxfA6xFoPSFhRHPqvUM anxQ== 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=88AVnpBEsnkBD8ha5VzEPsOUP1GLcPn85y25bXwY7+A=; b=b5d+H+7J/ODLBBEBSV8h9qof8A4lP5cMJKHtlzrb38b1JKuvry7IyGnQYg0keVxbmg AWoCt6eIzEXwWQnflM6viy9LaQocZYpxZ2cG6m7dbOuLeysP83oqNoT6a9Y5h2xBaW9a VrRlk772otAEAtUSQsVJnkvknCGUvVWWzecZi7oOXS13jnTMbQWcl6ReIyF9ATMZSvQo 921baN1+3ZhKYGtqeLYsbSr3iePhIXZ70lLflDvvzFo+9h7lODOCfIT6vBBp7AkUnde7 btnswJHK6hCLb/57Wb89hKV8HPJPn5fTAgvxj4xFR9IbhUVoCtDK0it0m4g0awfIRegD 6ZTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pN7xt5M4; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 k13si19400803oij.118.2019.12.29.09.50.50; Sun, 29 Dec 2019 09:50:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=pN7xt5M4; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731622AbfL2Rut (ORCPT + 14 others); Sun, 29 Dec 2019 12:50:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:35498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731929AbfL2Rus (ORCPT ); Sun, 29 Dec 2019 12:50:48 -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 8B2BB207FD; Sun, 29 Dec 2019 17:50:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641847; bh=kGp2oEj4Y0E7GzyIkTeTvwRHpJHHSsU9qgEs6Z+cSog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pN7xt5M48Eek7fNZrTMt3K8F53tyYqCA1MM1+mYYNqoFW4WAfkQo9LOfIiK7p7wC6 qiuuiMiMv/taBZp0EE7PB+XgxgNZ3isUbL1M0j2jBFDCkgrSDOsuR9Qff5CfOjnBia mqEnjVe5siqdBOZwWmgkaTlPoHyEwg4cdvXYu/4c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Grygorii Strashko , Andrew Lunn , Florian Fainelli , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 193/434] net: phy: dp83867: enable robust auto-mdix Date: Sun, 29 Dec 2019 18:24:06 +0100 Message-Id: <20191229172714.645230740@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Grygorii Strashko [ Upstream commit 5a7f08c2abb0efc9d17aff2fc75d6d3b85e622e4 ] The link detection timeouts can be observed (or link might not be detected at all) when dp83867 PHY is configured in manual mode (speed/duplex). CFG3[9] Robust Auto-MDIX option allows to significantly improve link detection in case dp83867 is configured in manual mode and reduce link detection time. As per DM: "If link partners are configured to operational modes that are not supported by normal Auto MDI/MDIX mode (like Auto-Neg versus Force 100Base-TX or Force 100Base-TX versus Force 100Base-TX), this Robust Auto MDI/MDIX mode allows MDI/MDIX resolution and prevents deadlock." Hence, enable this option by default as there are no known reasons not to do so. Signed-off-by: Grygorii Strashko Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/dp83867.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index 37fceaf9fa10..cf4455bbf888 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -95,6 +95,10 @@ #define DP83867_IO_MUX_CFG_CLK_O_SEL_MASK (0x1f << 8) #define DP83867_IO_MUX_CFG_CLK_O_SEL_SHIFT 8 +/* CFG3 bits */ +#define DP83867_CFG3_INT_OE BIT(7) +#define DP83867_CFG3_ROBUST_AUTO_MDIX BIT(9) + /* CFG4 bits */ #define DP83867_CFG4_PORT_MIRROR_EN BIT(0) @@ -410,12 +414,13 @@ static int dp83867_config_init(struct phy_device *phydev) phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_SGMIICTL, val); } + val = phy_read(phydev, DP83867_CFG3); /* Enable Interrupt output INT_OE in CFG3 register */ - if (phy_interrupt_is_valid(phydev)) { - val = phy_read(phydev, DP83867_CFG3); - val |= BIT(7); - phy_write(phydev, DP83867_CFG3, val); - } + if (phy_interrupt_is_valid(phydev)) + val |= DP83867_CFG3_INT_OE; + + val |= DP83867_CFG3_ROBUST_AUTO_MDIX; + phy_write(phydev, DP83867_CFG3, val); if (dp83867->port_mirroring != DP83867_PORT_MIRROING_KEEP) dp83867_config_port_mirroring(phydev);