2022-11-29 05:55:04

by Siddharth Vadapalli

[permalink] [raw]
Subject: [PATCH net] net: ethernet: ti: am65-cpsw: Fix RGMII configuration at SPEED_10

The am65-cpsw driver supports configuring all RGMII variants at interface
speed of 10 Mbps. However, in the process of shifting to the PHYLINK
framework, the support for all variants of RGMII except the
PHY_INTERFACE_MODE_RGMII variant was accidentally removed.

Fix this by using phy_interface_mode_is_rgmii() to check for all variants
of RGMII mode.

Fixes: e8609e69470f ("net: ethernet: ti: am65-cpsw: Convert to PHYLINK")
Reported-by: Schuyler Patton <[email protected]>
Signed-off-by: Siddharth Vadapalli <[email protected]>
---
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index 6b0458df613a..6ae802d73063 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -1495,7 +1495,7 @@ static void am65_cpsw_nuss_mac_link_up(struct phylink_config *config, struct phy

if (speed == SPEED_1000)
mac_control |= CPSW_SL_CTL_GIG;
- if (speed == SPEED_10 && interface == PHY_INTERFACE_MODE_RGMII)
+ if (speed == SPEED_10 && phy_interface_mode_is_rgmii(interface))
/* Can be used with in band mode only */
mac_control |= CPSW_SL_CTL_EXT_EN;
if (speed == SPEED_100 && interface == PHY_INTERFACE_MODE_RMII)
--
2.25.1


2022-11-29 07:05:41

by Pavan Chebbi

[permalink] [raw]
Subject: Re: [PATCH net] net: ethernet: ti: am65-cpsw: Fix RGMII configuration at SPEED_10

Looks like this patch should be directed to net-next?

On Tue, Nov 29, 2022 at 10:37 AM Siddharth Vadapalli <[email protected]> wrote:
>
> The am65-cpsw driver supports configuring all RGMII variants at interface
> speed of 10 Mbps. However, in the process of shifting to the PHYLINK
> framework, the support for all variants of RGMII except the
> PHY_INTERFACE_MODE_RGMII variant was accidentally removed.
>
> Fix this by using phy_interface_mode_is_rgmii() to check for all variants
> of RGMII mode.
>
> Fixes: e8609e69470f ("net: ethernet: ti: am65-cpsw: Convert to PHYLINK")
> Reported-by: Schuyler Patton <[email protected]>
> Signed-off-by: Siddharth Vadapalli <[email protected]>
> ---
> drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> index 6b0458df613a..6ae802d73063 100644
> --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> @@ -1495,7 +1495,7 @@ static void am65_cpsw_nuss_mac_link_up(struct phylink_config *config, struct phy
>
> if (speed == SPEED_1000)
> mac_control |= CPSW_SL_CTL_GIG;
> - if (speed == SPEED_10 && interface == PHY_INTERFACE_MODE_RGMII)
> + if (speed == SPEED_10 && phy_interface_mode_is_rgmii(interface))
> /* Can be used with in band mode only */
> mac_control |= CPSW_SL_CTL_EXT_EN;
> if (speed == SPEED_100 && interface == PHY_INTERFACE_MODE_RMII)
> --
> 2.25.1
>


Attachments:
smime.p7s (4.11 kB)
S/MIME Cryptographic Signature

2022-11-29 18:03:25

by Vladimir Oltean

[permalink] [raw]
Subject: Re: [PATCH net] net: ethernet: ti: am65-cpsw: Fix RGMII configuration at SPEED_10

On Tue, Nov 29, 2022 at 11:16:42AM +0530, Pavan Chebbi wrote:
> Looks like this patch should be directed to net-next?

Do you know more about what CPSW_SL_CTL_EXT_EN does, exactly? I'm not
able to assess the impact of the bug being fixed. What doesn't work?
Maybe Siddharth could put more focus on that.

2022-11-30 05:35:07

by Siddharth Vadapalli

[permalink] [raw]
Subject: Re: [PATCH net] net: ethernet: ti: am65-cpsw: Fix RGMII configuration at SPEED_10

Hello,

On 29/11/22 11:16, Pavan Chebbi wrote:
> Looks like this patch should be directed to net-next?

The commit fixed by this patch is a part of the released kernel. Thus, I
think it should be a part of net instead of net-next. Please let me know.

Regards,
Siddharth.

2022-11-30 06:33:40

by Pavan Chebbi

[permalink] [raw]
Subject: Re: [PATCH net] net: ethernet: ti: am65-cpsw: Fix RGMII configuration at SPEED_10

On Wed, Nov 30, 2022 at 10:54 AM Siddharth Vadapalli <[email protected]> wrote:
>
> Hello,
>
> On 29/11/22 11:16, Pavan Chebbi wrote:
> > Looks like this patch should be directed to net-next?
>
> The commit fixed by this patch is a part of the released kernel. Thus, I
> think it should be a part of net instead of net-next. Please let me know.
>
Sorry, yes. Also you may want to respond to Vladimir.

> Regards,
> Siddharth.


Attachments:
smime.p7s (4.11 kB)
S/MIME Cryptographic Signature

2022-11-30 06:34:06

by Siddharth Vadapalli

[permalink] [raw]
Subject: Re: [PATCH net] net: ethernet: ti: am65-cpsw: Fix RGMII configuration at SPEED_10

Hello,

On 29/11/22 22:16, Vladimir Oltean wrote:
> On Tue, Nov 29, 2022 at 11:16:42AM +0530, Pavan Chebbi wrote:
>> Looks like this patch should be directed to net-next?
>
> Do you know more about what CPSW_SL_CTL_EXT_EN does, exactly? I'm not
> able to assess the impact of the bug being fixed. What doesn't work?
> Maybe Siddharth could put more focus on that.

The CPSW_SL_CTL_EXT_EN bit is used to control in-band mode v/s forced
mode of operation. Setting the bit selects in-band mode while clearing
it selects forced mode. Thus, if the bit isn't set for certain variants
of RGMII mode, then those variants of RGMII mode will not work in
in-band mode of operation.

Please refer to the patch at [1] which corresponds to the commit being
fixed. That patch intended to convert the existing driver to utilize the
PHYLINK framework. In that process, the following line:
if (phy->speed == 10 && phy_interface_is_rgmii(phy))
was removed from the am65_cpsw_nuss_adjust_link() function and added in
the am65_cpsw_nuss_mac_link_up() function in the same patch as:
if (speed == SPEED_10 && interface == PHY_INTERFACE_MODE_RGMII)
instead of:
if (speed == SPEED_10 && phy_interface_mode_is_rgmii(interface))

Due to the above, the already existing support for in-band mode of
operation for all RGMII mode variants was accidentally changed to
support for in-band mode of operation for just the
PHY_INTERFACE_MODE_RGMII variant.

[1]
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/

Regards,
Siddharth.

2022-12-01 06:42:01

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH net] net: ethernet: ti: am65-cpsw: Fix RGMII configuration at SPEED_10

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

On Tue, 29 Nov 2022 10:36:39 +0530 you wrote:
> The am65-cpsw driver supports configuring all RGMII variants at interface
> speed of 10 Mbps. However, in the process of shifting to the PHYLINK
> framework, the support for all variants of RGMII except the
> PHY_INTERFACE_MODE_RGMII variant was accidentally removed.
>
> Fix this by using phy_interface_mode_is_rgmii() to check for all variants
> of RGMII mode.
>
> [...]

Here is the summary with links:
- [net] net: ethernet: ti: am65-cpsw: Fix RGMII configuration at SPEED_10
https://git.kernel.org/netdev/net/c/6c681f899e03

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html