Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3965340rwr; Mon, 8 May 2023 00:16:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6kgFT4xm1iTJ9BVtTEqeaZq2zoG4WMaVz7h9Gid80/8CVpm9yLOr/TEiMrh5f1gBXk61hS X-Received: by 2002:a05:6a20:7348:b0:db:b7:fe3f with SMTP id v8-20020a056a20734800b000db00b7fe3fmr12237868pzc.10.1683530192262; Mon, 08 May 2023 00:16:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683530192; cv=none; d=google.com; s=arc-20160816; b=AboIeJbZoXsGacbBbFcOopyYz6mnjLgrPyViie6wAnucWw3Xq6UbnkcwbFgXYfZ8Se 4SNz/g1fa1K85ttd85r+9Dq/GMgotkb+DAiDgGjbmTAeOBnbVKgcgPn6cNjhUd+Jxu2u 0cNstzfzRgTgXzU8662uEVxRBecbcFu22j/V6NXeZNqQhrOztySysklz3n1EaJBBghm1 S38M5LnVeogtFxDITPQLvqwQqgZMfqPZdfTKd+MdNyum/ZcYsrS40aqOTyI70ixKdzCL Nt5Ue9lZAS8XvM8oPNKzQksGLz2JMMmL5cN75SmQdAR2HxN/nTRv7GIs/gvpWpXs1XnG LoOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vqjij2kBjYJWJUuhnEBRNhabVH5fMncpJeuMl4HoFoc=; b=KbvAjkERtxichAOBJNG/FeAKt/1qFhFrX0Kbq44FztlwBNNrgKOtPK2fEFtS61INz6 hdfNMv+oZFZCfbrZ4Z9qhK+4DYM5/qt15oerh6MTzxglytul0Y20sa4VNUoHjvgeQhSg uLa5qd3SHpI4zHrxEz2E3NclIW93bgmvaUGOSb8DS4zpg2zJGisHjSSj46wTkVIe0kFj seD9XICUdfvzvfpVtSc5lG6QjgQkD9uoyPqvmrd/2dAntRI8W9Krk1Mz+hQgdjaxnX3K sSJf3PLVRT+YcvRyri/6zLlBHInfcIWCrDn/jLw5PTJXH4XcrWwvxmx8EoayvhbUJfdZ KCGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=DXdlmQmC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c22-20020a637256000000b00528d90d40ddsi7683089pgn.318.2023.05.08.00.16.20; Mon, 08 May 2023 00:16:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=DXdlmQmC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232564AbjEHHBL (ORCPT + 99 others); Mon, 8 May 2023 03:01:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232533AbjEHHA5 (ORCPT ); Mon, 8 May 2023 03:00:57 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67E22126; Mon, 8 May 2023 00:00:55 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 34870NAE067349; Mon, 8 May 2023 02:00:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1683529224; bh=vqjij2kBjYJWJUuhnEBRNhabVH5fMncpJeuMl4HoFoc=; h=From:To:CC:Subject:Date; b=DXdlmQmC7LZBeSfr/bIhj/Iho7TOkf7tiDeb6HEGI3QBSsQICYQfTt3D6mRU/rA22 8WR7D8UwhfDNewg2iT73J4ZmExroPLTFULtRe3lxbOJn98ES9ozR/UFAviHytTkK6s xF/lLOE1pzjZFRBT8UFBX94jAa0stp503cTbU+fk= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 34870N4f027464 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 8 May 2023 02:00:23 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 8 May 2023 02:00:23 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 8 May 2023 02:00:23 -0500 Received: from uda0492258.dhcp.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 34870JQT113193; Mon, 8 May 2023 02:00:20 -0500 From: Siddharth Vadapalli To: , , , , , , CC: , , , , Subject: [PATCH net] net: phy: dp83867: add w/a for packet errors seen with short cables Date: Mon, 8 May 2023 12:30:19 +0530 Message-ID: <20230508070019.356548-1-s-vadapalli@ti.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Grygorii Strashko Introduce the W/A for packet errors seen with short cables (<1m) between two DP83867 PHYs. The W/A recommended by DM requires FFE Equalizer Configuration tuning by writing value 0x0E81 to DSP_FFE_CFG register (0x012C), surrounded by hard and soft resets as follows: write_reg(0x001F, 0x8000); //hard reset write_reg(DSP_FFE_CFG, 0x0E81); write_reg(0x001F, 0x4000); //soft reset Since DP83867 PHY DM says "Changing this register to 0x0E81, will not affect Long Cable performance.", enable the W/A by default. Fixes: 2a10154abcb7 ("net: phy: dp83867: Add TI dp83867 phy") Signed-off-by: Grygorii Strashko Signed-off-by: Siddharth Vadapalli --- RFC patch at: https://lore.kernel.org/r/20230425054429.3956535-2-s-vadapalli@ti.com/ Changes since RFC patch: - Change patch subject to PATCH net. - Add Fixes tag. - Check return value of phy_write_mmd(). drivers/net/phy/dp83867.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index d75f526a20a4..4eecc9531a6b 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -44,6 +44,7 @@ #define DP83867_STRAP_STS1 0x006E #define DP83867_STRAP_STS2 0x006f #define DP83867_RGMIIDCTL 0x0086 +#define DP83867_DSP_FFE_CFG 0X012C #define DP83867_RXFCFG 0x0134 #define DP83867_RXFPMD1 0x0136 #define DP83867_RXFPMD2 0x0137 @@ -941,8 +942,22 @@ static int dp83867_phy_reset(struct phy_device *phydev) usleep_range(10, 20); - return phy_modify(phydev, MII_DP83867_PHYCTRL, + err = phy_modify(phydev, MII_DP83867_PHYCTRL, DP83867_PHYCR_FORCE_LINK_GOOD, 0); + if (err < 0) + return err; + + err = phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_DSP_FFE_CFG, 0X0E81); + if (err < 0) + return err; + + err = phy_write(phydev, DP83867_CTRL, DP83867_SW_RESTART); + if (err < 0) + return err; + + usleep_range(10, 20); + + return 0; } static void dp83867_link_change_notify(struct phy_device *phydev) -- 2.25.1