Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5583509rwr; Tue, 9 May 2023 03:41:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6w3UWL/3iQ7IESoO0cvFcI3+LpBMujwmANj9frf60XI3lz2NzCb3bwfO8ABsuSi6K4P4Zw X-Received: by 2002:a17:902:e746:b0:1ac:4b76:29a1 with SMTP id p6-20020a170902e74600b001ac4b7629a1mr13374166plf.29.1683628865565; Tue, 09 May 2023 03:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683628865; cv=none; d=google.com; s=arc-20160816; b=JNDQf8MgUN5g9g+B6K5OHx3WzUwbgQfW7JoRhPqFWZ/PRbNPrMqdHsfqVwNxexqPcG /NbKBFVEw98v76eSI7PLCvb0SFZWM4xYUnv7WdOOkgdHtz6w851VhTBBAcyIVrNwvLqs QsYCybnaxPDoQI2fAAhxy/sh89TzeyFWbunDhgXffiM5IF0FaI1wa/f9hG95uBmHfg4+ E2xzih64nggmeJoqwasnRn35IaqqzJIt2gz+D8yRDwObOQ0NSULD1UhSwJmH7Qgjvkwz PeYNd9hO6pQnzahyrIvQyVdi7XB+V8z/yRvCsJq/bOGhbCC/CqIxAufQGF/DZGvcsTLY vPuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=J+aJ87Wk8u/OIKkswXL4WuenR3rbc+J67mfSul8Awmk=; b=Dq2xDH1E6LkrA/CLvDBfgdOUNLc2eqkm9sJepB0Pp8nr8jLB3SL31aw6rhpclH+F3F J5NkJRPddhHeuhreHkxGK40UsePaezZ6q8HWW9SPhj/kLToRhz3SwOIA/QVKaj/33nCD CWQ36pt7xnsBP7O00S2Qm7QWfKk+P2568EUdp/sz/Gi/fWm2Abk1TsQBtrKFbO4m8vDi ANb+O8vczIRsT6c5D2CvU/JAWX9mtqnmV0ynBQSXMjve7dsKHeRjq19D7xEq3xdAFDSo T+/Xdj2p7AnIXrjRQFFS3mYUoW4WTnXzykhOWsP3OSbLrfOsL4YWpXvHgyTd4F08IS0z JubA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ZkOdIr8V; 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 b18-20020a170903229200b0019fe9a63cf2si1244924plh.609.2023.05.09.03.40.49; Tue, 09 May 2023 03:41:05 -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=ZkOdIr8V; 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 S234304AbjEIK2C (ORCPT + 99 others); Tue, 9 May 2023 06:28:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234194AbjEIK2A (ORCPT ); Tue, 9 May 2023 06:28:00 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5CCADC6C; Tue, 9 May 2023 03:27:58 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 349ARboc043784; Tue, 9 May 2023 05:27:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1683628057; bh=J+aJ87Wk8u/OIKkswXL4WuenR3rbc+J67mfSul8Awmk=; h=Date:CC:Subject:To:References:From:In-Reply-To; b=ZkOdIr8VF757n5ofAIAtwfjjQuhyjRTFoziyg0Cgi3S/51UjDjcIIjwMum6MrigPo b8RA534KHtulontOcyv1rh6964O8ZojM+CgglEkzzqcXv+WQXHKALYUqDt032WVfdu SpT/sULc9vgb9kX8+gkTwFq4K17oIyCDJNFT9eSY= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 349ARbOj008095 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 9 May 2023 05:27:37 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 9 May 2023 05:27:37 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE109.ent.ti.com (10.64.6.30) 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; Tue, 9 May 2023 05:27:36 -0500 Received: from [172.24.145.61] (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 349ARXah015938; Tue, 9 May 2023 05:27:34 -0500 Message-ID: Date: Tue, 9 May 2023 15:57:33 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 CC: , , , , , , , , , , Subject: Re: [PATCH net v2] net: phy: dp83867: add w/a for packet errors seen with short cables Content-Language: en-US To: Heiner Kallweit References: <20230509052124.611875-1-s-vadapalli@ti.com> <7a53f0d3-3e9a-4024-6b19-72ad9c19ab97@gmail.com> From: Siddharth Vadapalli In-Reply-To: <7a53f0d3-3e9a-4024-6b19-72ad9c19ab97@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 On 09/05/23 14:29, Heiner Kallweit wrote: > On 09.05.2023 07:21, Siddharth Vadapalli wrote: >> 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 >> --- >> >> V1 patch at: >> https://lore.kernel.org/r/20230508070019.356548-1-s-vadapalli@ti.com >> >> Changes since v1 patch: >> - Wrap the line invoking phy_write_mmd(), limiting it to 80 characters. >> - Replace 0X0E81 with 0x0e81 in the call to phy_write_mmd(). >> - Replace 0X012C with 0x012c in the new define for DP83867_DSP_FFE_CFG. >> >> 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 | 18 +++++++++++++++++- >> 1 file changed, 17 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c >> index d75f526a20a4..bbdcc595715d 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,23 @@ 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; >> + > > Would be good to add a comment here explaining what this magic write does. Sure. Is the following comment acceptable? "Configure the DSP Feedforward Equalizer Configuration register to improve short cable (< 1 meter) performance. This will not affect long cable performance." > >> + 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) > -- Regards, Siddharth.