The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net] net: phy: dp83869: Fix MII mode failure
@ 2024-04-23  8:48 MD Danish Anwar
  2024-04-24  6:10 ` Ravi Gunasekaran
  2024-04-25 10:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: MD Danish Anwar @ 2024-04-23  8:48 UTC (permalink / raw)
  To: Siddharth Vadapalli, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	David S. Miller, Russell King, Heiner Kallweit, Andrew Lunn
  Cc: linux-kernel, netdev, srk, Vignesh Raghavendra, r-gunasekaran,
	Roger Quadros, MD Danish Anwar

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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: phy: dp83869: Fix MII mode failure
  2024-04-23  8:48 [PATCH net] net: phy: dp83869: Fix MII mode failure MD Danish Anwar
@ 2024-04-24  6:10 ` Ravi Gunasekaran
  2024-04-25 10:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Ravi Gunasekaran @ 2024-04-24  6:10 UTC (permalink / raw)
  To: MD Danish Anwar, Siddharth Vadapalli, Paolo Abeni, Jakub Kicinski,
	Eric Dumazet, David S. Miller, Russell King, Heiner Kallweit,
	Andrew Lunn
  Cc: linux-kernel, netdev, srk, Vignesh Raghavendra, Roger Quadros,
	Ravi Gunasekaran



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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: phy: dp83869: Fix MII mode failure
  2024-04-23  8:48 [PATCH net] net: phy: dp83869: Fix MII mode failure MD Danish Anwar
  2024-04-24  6:10 ` Ravi Gunasekaran
@ 2024-04-25 10:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-25 10:30 UTC (permalink / raw)
  To: MD Danish Anwar
  Cc: s-vadapalli, pabeni, kuba, edumazet, davem, linux, hkallweit1,
	andrew, linux-kernel, netdev, srk, vigneshr, r-gunasekaran,
	rogerq

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-25 10:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-23  8:48 [PATCH net] net: phy: dp83869: Fix MII mode failure MD Danish Anwar
2024-04-24  6:10 ` Ravi Gunasekaran
2024-04-25 10:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox