Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5305687rwr; Mon, 8 May 2023 22:40:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5MTzI6t62UX0PGChgug7QioVelG1992PtlB6eq1WbiXinwh0lSj2Duj4eUUO8Jh/0RDxsa X-Received: by 2002:a05:6a00:22cc:b0:646:5f98:6bb4 with SMTP id f12-20020a056a0022cc00b006465f986bb4mr5924547pfj.33.1683610853551; Mon, 08 May 2023 22:40:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683610853; cv=none; d=google.com; s=arc-20160816; b=XVWx2PV1fEbTE6rscxUqQFZzzX6t5/L6RJmb6qVQEaPlQ/VsHwINqPzrgdijEjFexM T8F62nTtE9bncJZPV7xoDbbb73eKECmitya9orz6M0QiSnGgz2Yn2uMf0ORgOH7TWhai nyN9wiZOmbagS375IrCtisSVnI+5dxv0NWmvnq0/PrtvPcUhJR1vNbJEVfAUsX8lkWqf ohbd54wVzXGA9Zeh5sqqPF/o2wnxc7uJtuOLJrGDy9pvnbDPcA1QjH7eLshGIyhZe8Cs sq9tvuJddY0VxdHNJCOmgqAuNPTj2P2rD9MjBjtLn++dpu1DIS07O5fQl38phUoNlI8W XsTA== 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=FaHeUjnucih418Ur8PV/2ZSUSUsKfveQTe6yIr3uQrc=; b=GxF6UhihmIFA70DgTxfSD6Z7aNNYaOwoRsyPSPwOaqK7ook8odMY0XCkccmGf1Hdw2 YK1PFPQl5Ii6m2Cb+kDTmfe971xcOe2VeB38ZeQS2Z/OLMjPu1/dQDGOlgoZ/deK6JZq 7L/AfwPwoz2U6s/U1YVlJfV3KXVFeMfi/BcTt/GW5mAN4EdtjMIiNHMA7kGYNw3TbaM8 lDXpqIl4ys57F2QhOx1b04QBFz3iXmWnMtRJeP4iwJOnhWxqGRdd+7SuBIwzsg0mqsE1 QEZEMh/UfXv2qWXEmFkATgQjb2Gt+Soj3wf1xLjpVcmRZw9xG7dmDbutbSJQJq59Ty9A kLrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=vMGtVkAd; 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 t126-20020a625f84000000b00645c34972a1si1577762pfb.234.2023.05.08.22.40.34; Mon, 08 May 2023 22:40:53 -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=vMGtVkAd; 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 S233401AbjEIFWE (ORCPT + 99 others); Tue, 9 May 2023 01:22:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229533AbjEIFWD (ORCPT ); Tue, 9 May 2023 01:22:03 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCF6D6187; Mon, 8 May 2023 22:22:01 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3495LTLp011976; Tue, 9 May 2023 00:21:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1683609689; bh=FaHeUjnucih418Ur8PV/2ZSUSUsKfveQTe6yIr3uQrc=; h=From:To:CC:Subject:Date; b=vMGtVkAdDAeqsfumXOCtzPOOiCwbqf5cFMoGSdA+q12MuL5PdBDZRQpGu0JyJuoBI l10TDG5GdmOF5qg8SjwpaddiZJj7PuvZl5plwyOVYa+jy9yz7q64NuIXxe/zFbAMfM 2htIn8oWgf5hntRvk59YlHJOCx2NHiyJD+3ifYSw= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3495LTUi009596 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 9 May 2023 00:21:29 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) 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; Tue, 9 May 2023 00:21:28 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE114.ent.ti.com (10.64.6.35) 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 00:21:28 -0500 Received: from uda0492258.dhcp.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3495LOd3024283; Tue, 9 May 2023 00:21:25 -0500 From: Siddharth Vadapalli To: , , , , , , CC: , , , , Subject: [PATCH net v2] net: phy: dp83867: add w/a for packet errors seen with short cables Date: Tue, 9 May 2023 10:51:24 +0530 Message-ID: <20230509052124.611875-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,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 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; + + 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