From patchwork Sun Dec 29 17:18:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182578 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5486382ild; Sun, 29 Dec 2019 10:16:47 -0800 (PST) X-Google-Smtp-Source: APXvYqz8uYZUawB88zkJeyLp3mV4UpyTazZZLlRcflkS2KnZlAzCU1BNgs3p1rvWs/msKYCR/J9B X-Received: by 2002:a9d:7f16:: with SMTP id j22mr68017251otq.256.1577643407737; Sun, 29 Dec 2019 10:16:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577643407; cv=none; d=google.com; s=arc-20160816; b=Bm8qxKYussuPmamlh1eTnUz3JoJRpvV8r0xlqx9kFgsIwzX9k5KPNNpm0EU1cQ40KV ZPdP7IyVYptSIQHJPQGoja9itzF/yUt//2A+0TDkeiJsPqgvABtIcAVNxxgCeftN6vUG os35w62BUADbVuLoLoTMjjRuw8v+zurjjE0Sp/35amK6zGiOFkw/DGtRv+MmIWD0WSPE Iz0X/hIl/feTAVnN6KRjTHXmS7i3fIowlCU4BwcsvfiJSgJ9bqSZeEyMkPHI/kG1KBhF OseLa4wyzAiND+/c0irRXq1mjxSNp3SCpoOj8voxX1N9BF3KD4yBa0pSdmYy9ng8FaUQ nnhg== 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=gCNRiCymMNV7c8osL+CrXJF63IEG2UbmO5Biujddaq8=; b=rCvWNquXzXC/BwITUcLNVKx39Boo6ynUld6skPH7RxMtFDSRsJTY0VyI24IWYJsTQ4 ZLWh4FAPTBtvcVkvJwe6Elv0yVN1b4c/evJcqlRqSVrNPtFde1rX3mUnW78xMXFb/EIT 5VRWPZxVo203VMToBHnRmT+91sGQEfjigTDsrnU+VdCpUj0arfBWH8Z2svmKWxn3Xcu9 VS6pJ2W5p7KylpMD1rhGpMYa7kZdd74r+1+OyI36gGgh8TvDP3s1lZmLdcxa5vadLxSn qIRtdWG27PIBEqoOFuzSsxpd2ZmYmNuVDMoOruJSYCVauL2m1KnPnl5qgz2epbrLAsPQ cIRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RcxM5a5x; 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 v6si21677206ota.19.2019.12.29.10.16.47; Sun, 29 Dec 2019 10:16:47 -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=RcxM5a5x; 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 S1727640AbfL2RX7 (ORCPT + 27 others); Sun, 29 Dec 2019 12:23:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:41956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727268AbfL2RXw (ORCPT ); Sun, 29 Dec 2019 12:23:52 -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 BDE9F20CC7; Sun, 29 Dec 2019 17:23:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640231; bh=nie5E4wN1HIpMmq7neBcmQuVrAMzR5DezXZ/OIavkYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RcxM5a5xvzgy5RwlznouQhrzm5lu8Nu+lBLlCSHd7eE1DOH8CZIzVP8nTA9KxmGf5 +a5qVv4DBQXLm+VWxQMp0FVeUZ1Uf+9e20g7akBA1p70nl+dpNzF7yMcH+oD8iRS9D c0vqvmn/XsL6LIXvgEffTsjTwXlNti+torsks4DI= 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 4.14 071/161] net: phy: dp83867: enable robust auto-mdix Date: Sun, 29 Dec 2019 18:18:39 +0100 Message-Id: <20191229162421.660580953@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162355.500086350@linuxfoundation.org> References: <20191229162355.500086350@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 e03e91d5f1b1..0cbcced0870e 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -84,6 +84,10 @@ #define DP83867_IO_MUX_CFG_IO_IMPEDANCE_MAX 0x0 #define DP83867_IO_MUX_CFG_IO_IMPEDANCE_MIN 0x1f +/* 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) @@ -320,12 +324,13 @@ static int dp83867_config_init(struct phy_device *phydev) return ret; } + 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);