diff mbox series

[net] net: phy: realtek: Fix rtl8211f_config_init() for RTL8211F(D)(I)-VD-CG PHY

Message ID 20240220070007.968762-1-s-vadapalli@ti.com (mailing list archive)
State Accepted
Commit 3489182b11d35f1944c1245fc9c4867cf622c50f
Delegated to: Netdev Maintainers
Headers show
Series [net] net: phy: realtek: Fix rtl8211f_config_init() for RTL8211F(D)(I)-VD-CG PHY | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 956 this patch: 956
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 9 of 9 maintainers
netdev/build_clang success Errors and warnings before: 973 this patch: 973
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 973 this patch: 973
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-02-22--00-00 (tests: 1455)

Commit Message

Siddharth Vadapalli Feb. 20, 2024, 7 a.m. UTC
Commit bb726b753f75 ("net: phy: realtek: add support for
RTL8211F(D)(I)-VD-CG") extended support of the driver from the existing
support for RTL8211F(D)(I)-CG PHY to the newer RTL8211F(D)(I)-VD-CG PHY.

While that commit indicated that the RTL8211F_PHYCR2 register is not
supported by the "VD-CG" PHY model and therefore updated the corresponding
section in rtl8211f_config_init() to be invoked conditionally, the call to
"genphy_soft_reset()" was left as-is, when it should have also been invoked
conditionally. This is because the call to "genphy_soft_reset()" was first
introduced by the commit 0a4355c2b7f8 ("net: phy: realtek: add dt property
to disable CLKOUT clock") since the RTL8211F guide indicates that a PHY
reset should be issued after setting bits in the PHYCR2 register.

As the PHYCR2 register is not applicable to the "VD-CG" PHY model, fix the
rtl8211f_config_init() function by invoking "genphy_soft_reset()"
conditionally based on the presence of the "PHYCR2" register.

Fixes: bb726b753f75 ("net: phy: realtek: add support for RTL8211F(D)(I)-VD-CG")
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
---

Hello,

This patch is based on Linux 6.8-rc5.

Regards,
Siddharth.

 drivers/net/phy/realtek.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Simon Horman Feb. 20, 2024, 3 p.m. UTC | #1
On Tue, Feb 20, 2024 at 12:30:07PM +0530, Siddharth Vadapalli wrote:
> Commit bb726b753f75 ("net: phy: realtek: add support for
> RTL8211F(D)(I)-VD-CG") extended support of the driver from the existing
> support for RTL8211F(D)(I)-CG PHY to the newer RTL8211F(D)(I)-VD-CG PHY.
> 
> While that commit indicated that the RTL8211F_PHYCR2 register is not
> supported by the "VD-CG" PHY model and therefore updated the corresponding
> section in rtl8211f_config_init() to be invoked conditionally, the call to
> "genphy_soft_reset()" was left as-is, when it should have also been invoked
> conditionally. This is because the call to "genphy_soft_reset()" was first
> introduced by the commit 0a4355c2b7f8 ("net: phy: realtek: add dt property
> to disable CLKOUT clock") since the RTL8211F guide indicates that a PHY
> reset should be issued after setting bits in the PHYCR2 register.
> 
> As the PHYCR2 register is not applicable to the "VD-CG" PHY model, fix the
> rtl8211f_config_init() function by invoking "genphy_soft_reset()"
> conditionally based on the presence of the "PHYCR2" register.
> 
> Fixes: bb726b753f75 ("net: phy: realtek: add support for RTL8211F(D)(I)-VD-CG")
> Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>

Reviewed-by: Simon Horman <horms@kernel.org>
patchwork-bot+netdevbpf@kernel.org Feb. 22, 2024, 9:10 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Tue, 20 Feb 2024 12:30:07 +0530 you wrote:
> Commit bb726b753f75 ("net: phy: realtek: add support for
> RTL8211F(D)(I)-VD-CG") extended support of the driver from the existing
> support for RTL8211F(D)(I)-CG PHY to the newer RTL8211F(D)(I)-VD-CG PHY.
> 
> While that commit indicated that the RTL8211F_PHYCR2 register is not
> supported by the "VD-CG" PHY model and therefore updated the corresponding
> section in rtl8211f_config_init() to be invoked conditionally, the call to
> "genphy_soft_reset()" was left as-is, when it should have also been invoked
> conditionally. This is because the call to "genphy_soft_reset()" was first
> introduced by the commit 0a4355c2b7f8 ("net: phy: realtek: add dt property
> to disable CLKOUT clock") since the RTL8211F guide indicates that a PHY
> reset should be issued after setting bits in the PHYCR2 register.
> 
> [...]

Here is the summary with links:
  - [net] net: phy: realtek: Fix rtl8211f_config_init() for RTL8211F(D)(I)-VD-CG PHY
    https://git.kernel.org/netdev/net/c/3489182b11d3

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index 481c79fbd6eb..1fa70427b2a2 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -413,9 +413,11 @@  static int rtl8211f_config_init(struct phy_device *phydev)
 				ERR_PTR(ret));
 			return ret;
 		}
+
+		return genphy_soft_reset(phydev);
 	}
 
-	return genphy_soft_reset(phydev);
+	return 0;
 }
 
 static int rtl821x_suspend(struct phy_device *phydev)