diff mbox series

[net] net: phy: dp83869: Fix MII mode failure

Message ID 20240423084828.1309294-1-danishanwar@ti.com (mailing list archive)
State Accepted
Commit 6c9cd59dbcb09a2122b5ce0dfc07c74e6fc00dc0
Delegated to: Netdev Maintainers
Headers show
Series [net] net: phy: dp83869: Fix MII mode failure | 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: 926 this patch: 926
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 937 this patch: 937
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: 937 this patch: 937
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 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-04-24--15-00 (tests: 995)

Commit Message

MD Danish Anwar April 23, 2024, 8:48 a.m. UTC
The DP83869 driver sets the MII bit (needed for PHY to work in MII mode)
only if the op-mode is either DP83869_100M_MEDIA_CONVERT or
DP83869_RGMII_100_BASE.

Some drivers i.e. ICSSG support MII mode with op-mode as
DP83869_RGMII_COPPER_ETHERNET for which the MII bit is not set in dp83869
driver. As a result MII mode on ICSSG doesn't work and below log is seen.

TI DP83869 300b2400.mdio:0f: selected op-mode is not valid with MII mode
icssg-prueth icssg1-eth: couldn't connect to phy ethernet-phy@0
icssg-prueth icssg1-eth: can't phy connect port MII0

Fix this by setting MII bit for DP83869_RGMII_COPPER_ETHERNET op-mode as
well.

Fixes: 94e86ef1b801 ("net: phy: dp83869: support mii mode when rgmii strap cfg is used")
Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
---
NOTE: This patch is needed for MII mode to work for ICSSG Ethernet driver.
I will post the device tree patch for MII mode and mark that as dependent
on this patch.

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


base-commit: 6bea4f03c6a4e973ef369e15aac88f37981db49e

Comments

Ravi Gunasekaran April 24, 2024, 6:10 a.m. UTC | #1
On 4/23/2024 2:18 PM, MD Danish Anwar wrote:
> The DP83869 driver sets the MII bit (needed for PHY to work in MII mode)
> only if the op-mode is either DP83869_100M_MEDIA_CONVERT or
> DP83869_RGMII_100_BASE.
>
> Some drivers i.e. ICSSG support MII mode with op-mode as
> DP83869_RGMII_COPPER_ETHERNET for which the MII bit is not set in dp83869
> driver. As a result MII mode on ICSSG doesn't work and below log is seen.
>
> TI DP83869 300b2400.mdio:0f: selected op-mode is not valid with MII mode
> icssg-prueth icssg1-eth: couldn't connect to phy ethernet-phy@0
> icssg-prueth icssg1-eth: can't phy connect port MII0
>
> Fix this by setting MII bit for DP83869_RGMII_COPPER_ETHERNET op-mode as
> well.
>
> Fixes: 94e86ef1b801 ("net: phy: dp83869: support mii mode when rgmii strap cfg is used")
> Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
> ---
> NOTE: This patch is needed for MII mode to work for ICSSG Ethernet driver.
> I will post the device tree patch for MII mode and mark that as dependent
> on this patch.
>
>  drivers/net/phy/dp83869.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c
> index fa8c6fdcf301..d7aaefb5226b 100644
> --- a/drivers/net/phy/dp83869.c
> +++ b/drivers/net/phy/dp83869.c
> @@ -695,7 +695,8 @@ static int dp83869_configure_mode(struct phy_device *phydev,
>  	phy_ctrl_val = dp83869->mode;
>  	if (phydev->interface == PHY_INTERFACE_MODE_MII) {
>  		if (dp83869->mode == DP83869_100M_MEDIA_CONVERT ||
> -		    dp83869->mode == DP83869_RGMII_100_BASE) {
> +		    dp83869->mode == DP83869_RGMII_100_BASE ||
> +		    dp83869->mode == DP83869_RGMII_COPPER_ETHERNET) {
>  			phy_ctrl_val |= DP83869_OP_MODE_MII;
>  		} else {
>  			phydev_err(phydev, "selected op-mode is not valid with MII mode\n");
>
> base-commit: 6bea4f03c6a4e973ef369e15aac88f37981db49e

Reviewed-by: Ravi Gunasekaran <r-gunasekaran@ti.com>

Regards,
Ravi
patchwork-bot+netdevbpf@kernel.org April 25, 2024, 10:30 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Tue, 23 Apr 2024 14:18:28 +0530 you wrote:
> The DP83869 driver sets the MII bit (needed for PHY to work in MII mode)
> only if the op-mode is either DP83869_100M_MEDIA_CONVERT or
> DP83869_RGMII_100_BASE.
> 
> Some drivers i.e. ICSSG support MII mode with op-mode as
> DP83869_RGMII_COPPER_ETHERNET for which the MII bit is not set in dp83869
> driver. As a result MII mode on ICSSG doesn't work and below log is seen.
> 
> [...]

Here is the summary with links:
  - [net] net: phy: dp83869: Fix MII mode failure
    https://git.kernel.org/netdev/net/c/6c9cd59dbcb0

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c
index fa8c6fdcf301..d7aaefb5226b 100644
--- a/drivers/net/phy/dp83869.c
+++ b/drivers/net/phy/dp83869.c
@@ -695,7 +695,8 @@  static int dp83869_configure_mode(struct phy_device *phydev,
 	phy_ctrl_val = dp83869->mode;
 	if (phydev->interface == PHY_INTERFACE_MODE_MII) {
 		if (dp83869->mode == DP83869_100M_MEDIA_CONVERT ||
-		    dp83869->mode == DP83869_RGMII_100_BASE) {
+		    dp83869->mode == DP83869_RGMII_100_BASE ||
+		    dp83869->mode == DP83869_RGMII_COPPER_ETHERNET) {
 			phy_ctrl_val |= DP83869_OP_MODE_MII;
 		} else {
 			phydev_err(phydev, "selected op-mode is not valid with MII mode\n");