From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71B0BC77B7C for ; Tue, 9 May 2023 10:28:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234483AbjEIK2E (ORCPT ); Tue, 9 May 2023 06:28:04 -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 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.