From patchwork Wed Oct 23 14:48:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 177292 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp833764ill; Wed, 23 Oct 2019 07:50:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqx18MDDvnfFgJxvc2At2EIkPs2rg8xa1rpGyNYpaseWNwPKBAmfOYqJ2VSI9a4XpdAXj+6b X-Received: by 2002:a05:6402:1547:: with SMTP id p7mr26827469edx.28.1571842245332; Wed, 23 Oct 2019 07:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571842245; cv=none; d=google.com; s=arc-20160816; b=sjOvxt132WWPbn/Qp3/mTbRsaLu3ExOgGhSchxtzH+SgM61Jxyc2b3pirxZbs4Q0RH oMo1u/181b/HrYNgvi7f7kwbks3OID0y5MTW6fj3o6bWm3wSD3pmaJ4Xo+mOwL3nZz6j Vnea+6RWqfRn9kTlKwXKI1t9NS9K3pVv41/43VXiub58KLyWC/CVdB65+cxfB1dwM9tI E1JmLvaPO2uzyI9ZRy8PIpTH60Dk/lpstiM1wESiPd/C5EeCYo76urcVcPD2yonBxdUS KqbmP7ll2oChpyt/LY5x5wAh8I8MCnXa/HURJZAJJBI3dxk8hWZwGt/axWaQd5wuJgl6 r41g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=x1qHQIzWckKmDT0+Z5edtZm7FwPcWh80iTf5ybJzuKU=; b=OCCjmgcCD7GjFPVHpIFeAtB4H24fpMYNC+3WKh+cDwxYXcD+TGCejr0HygQ88idlyy sAQlcx6sGDIudtl8QWClmyOZkBoM+d3xLV0w4OVHfYOAde/jMXc5UF3YDU82snsRDCTr 71a+NRq/ayIDeXx2Kr3gUFAcspVqWGCSc4+c3bVAile0vhj72jLorF6Og9zVhgBELyQi 2B8LMOE/nUcxuyfqP/wXoSsHdFYiM6Yfe4QItnzeYBQ5eFDO86NWg3EB85fyO0ga2Hnx JtqSIyHq2lhLzE8tx18dMYF3M5836zyDmxiYBujVQxyKLogE6vzf3BIhlO3w5zxYW/Fn 4ztw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=shZTD08Y; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k51si8462269edb.411.2019.10.23.07.50.44; Wed, 23 Oct 2019 07:50:45 -0700 (PDT) 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=@ti.com header.s=ti-com-17Q1 header.b=shZTD08Y; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406379AbfJWOul (ORCPT + 26 others); Wed, 23 Oct 2019 10:50:41 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:48402 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404873AbfJWOuk (ORCPT ); Wed, 23 Oct 2019 10:50:40 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9NEoaUM090494; Wed, 23 Oct 2019 09:50:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1571842236; bh=x1qHQIzWckKmDT0+Z5edtZm7FwPcWh80iTf5ybJzuKU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=shZTD08YebKJPfXNfpuvavUiME3smvs0S+d/Y7xuey0NPDFOA6Uios7wLGe1/XqZz 6+LGXJwXiAyHDzFN2LSDUa4JZpFqma+U68+klMkeEa3MEIpSeVxdWQksdkmFIic6Q/ LQIG9GJc3A9j74KseS02Y8GBpcIehcKWStohckfQ= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9NEoZjo129477 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 23 Oct 2019 09:50:36 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 23 Oct 2019 09:50:25 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Wed, 23 Oct 2019 09:50:25 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9NEoYLt130427; Wed, 23 Oct 2019 09:50:35 -0500 From: Grygorii Strashko To: "David S. Miller" , , Andrew Lunn , Florian Fainelli , Heiner Kallweit CC: Sekhar Nori , , Grygorii Strashko Subject: [PATCH 1/2] net: phy: dp83867: enable robust auto-mdix Date: Wed, 23 Oct 2019 17:48:45 +0300 Message-ID: <20191023144846.1381-2-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191023144846.1381-1-grygorii.strashko@ti.com> References: <20191023144846.1381-1-grygorii.strashko@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The link detection timeouts can be observed (or link might not be detected at all) when dp83867 PHY is configured in manual mode (speed/duplexity). CFG3[9] Robust Auto-MDIX option allows 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 --- drivers/net/phy/dp83867.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) -- 2.17.1 Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli 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);