From patchwork Sun Dec 29 17:18:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182542 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5449579ild; Sun, 29 Dec 2019 09:33:03 -0800 (PST) X-Google-Smtp-Source: APXvYqwJtfLQprul9c8qF74VNjoJgxj7ocDYlN5nXK/lqeZqEYbAXH3X3bLXrYsAfTTpZRiDCxHp X-Received: by 2002:a05:6830:2111:: with SMTP id i17mr65128008otc.24.1577640782938; Sun, 29 Dec 2019 09:33:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577640782; cv=none; d=google.com; s=arc-20160816; b=oFQeFlsy2z3s9vjISgrfKfxeYq1TIjf57bxMdxdFZxb0YYuUSkC7ZX6zQfUSgnlnON iZ3HX0m0dySQZ2ua/UdLOGJtwxV23aTFRHLdXkFINboTD5/E5eUnCLdNpmJKAUye0qfV uGNCMq2Ar491xM1Ht76DX3kgEGFOP1GqklmW3Ltm4XYJmLp/L/H2ORfkAyRCR5gC+uSJ Kv+wHT2mrNuOfUSx3tWMN486ec2dvENsB80esOQEziByADjOfldaKDCbPFd13acrJawJ ruGEvAEu+7JAhcXjcihGZZWIVEInD6r/Je+R0BRJUCV9ZZSal2IsOj+f0QcV4/WpG4E1 B9XQ== 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=rLK5dwQ6taZ5eAzetqzTsLRtzAMNiJWFei6vRG68qrg=; b=d3aqT0B7RZddT92YtZAvm0/cTH81AR504u3rPpkzhXZ2u6Ruk/bRwmznDKRtoMWhHE 6U1YgtiLQL1MKCgQh7h8W4tm1YlIN5o5TSicTVLxcWh9kPHNoxraSxQXUr+5SzWsS3zn axeOe9x5TNgMpYn1GNSXymXZQ0NseFwiY0J5eUQ+/YEsQLYAMB0gaesayD0YtFQ+2D1U VNIRxyy2a5SlF8+guyKpW5st6MVRKaQTr2wsdZtTiK372yTEtXwt0Sw5W8jdjY8CnAsS +px6qJG2t+SEGVlg/yCRqwFQIq9CPmxCA4rcPlOmLXem1eymr9fQIzreWkCpZvxaLdxn p/zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="S/aJxpT9"; 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 k7si19631477otb.90.2019.12.29.09.33.02; Sun, 29 Dec 2019 09:33:02 -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="S/aJxpT9"; 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 S1729382AbfL2RdB (ORCPT + 27 others); Sun, 29 Dec 2019 12:33:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:34020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729377AbfL2Rc5 (ORCPT ); Sun, 29 Dec 2019 12:32:57 -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 97E98207FD; Sun, 29 Dec 2019 17:32:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640777; bh=f+oyQdJV2mvKWAwexwUt8dcxFVa+jkYNOVD3dekVTwE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S/aJxpT9XCP6XPLxiwKVOOVKubtG6+8M10T2nRM48pGYdBmKufBQVrnd7jtywI5tB zE5BUKn8ezWYPzBH/YihwQgPLdJWIeAAIkD7IwHQMwM7HFE/fAngiSHqFpuYij5T2t 93J6/P7K1gzaIfcPj0vpAUdE2kWC9oDBYb8mwlDQ= 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.19 095/219] net: phy: dp83867: enable robust auto-mdix Date: Sun, 29 Dec 2019 18:18:17 +0100 Message-Id: <20191229162521.892610959@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@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 eeadfde15940..879096d3ff41 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -86,6 +86,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) @@ -331,12 +335,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);