From 0aa749191bc9ddd3e371106c894c1e1a0be2f9d7 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: May 25 2023 07:19:35 +0000 Subject: net: phy: dp83867: add w/a for packet errors seen with short cables (git-fixes). --- diff --git a/patches.suse/net-phy-dp83867-add-w-a-for-packet-errors-seen-with-.patch b/patches.suse/net-phy-dp83867-add-w-a-for-packet-errors-seen-with-.patch new file mode 100644 index 0000000..a4c0a74 --- /dev/null +++ b/patches.suse/net-phy-dp83867-add-w-a-for-packet-errors-seen-with-.patch @@ -0,0 +1,77 @@ +From 0b01db274028f5acd207332686ffc92ac77491ac Mon Sep 17 00:00:00 2001 +From: Grygorii Strashko +Date: Wed, 10 May 2023 18:21:39 +0530 +Subject: [PATCH] net: phy: dp83867: add w/a for packet errors seen with short cables +Git-commit: 0b01db274028f5acd207332686ffc92ac77491ac +Patch-mainline: v6.4-rc3 +References: git-fixes + +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 +Reviewed-by: Simon Horman +Signed-off-by: David S. Miller +Acked-by: Takashi Iwai + +--- + drivers/net/phy/dp83867.c | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c +index d75f526a20a4..76f5a2402fb0 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,27 @@ 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; ++ ++ /* 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) +-- +2.35.3 + diff --git a/series.conf b/series.conf index 978e803..befb503 100644 --- a/series.conf +++ b/series.conf @@ -20118,6 +20118,7 @@ patches.suse/media-dvb-core-Fix-use-after-free-due-to-race-condit.patch patches.suse/selftests-seg6-disable-DAD-on-IPv6-router-cfg-for-sr.patch patches.suse/selftets-seg6-disable-rp_filter-by-default-in-srv6_e.patch + patches.suse/net-phy-dp83867-add-w-a-for-packet-errors-seen-with-.patch patches.suse/can-isotp-recvmsg-allow-MSG_CMSG_COMPAT-flag.patch patches.suse/can-j1939-recvmsg-allow-MSG_CMSG_COMPAT-flag.patch patches.suse/cassini-Fix-a-memory-leak-in-the-error-handling-path.patch