diff mbox series

[net] net: ethernet: ti: am65-cpsw: Fix RGMII configuration at SPEED_10

Message ID 20221129050639.111142-1-s-vadapalli@ti.com (mailing list archive)
State Accepted
Commit 6c681f899e0360803b924ac8c96ee21965118649
Delegated to: Netdev Maintainers
Headers show
Series [net] net: ethernet: ti: am65-cpsw: Fix RGMII configuration at SPEED_10 | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 23 this patch: 23
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 6 this patch: 6
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
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: 21 this patch: 21
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Siddharth Vadapalli Nov. 29, 2022, 5:06 a.m. UTC
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 <spatton@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
---
 drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pavan Chebbi Nov. 29, 2022, 5:46 a.m. UTC | #1
Looks like this patch should be directed to net-next?

On Tue, Nov 29, 2022 at 10:37 AM Siddharth Vadapalli <s-vadapalli@ti.com> 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 <spatton@ti.com>
> Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
> ---
>  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
>
Vladimir Oltean Nov. 29, 2022, 4:46 p.m. UTC | #2
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.
Siddharth Vadapalli Nov. 30, 2022, 5:24 a.m. UTC | #3
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.
Pavan Chebbi Nov. 30, 2022, 5:56 a.m. UTC | #4
On Wed, Nov 30, 2022 at 10:54 AM Siddharth Vadapalli <s-vadapalli@ti.com> 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.
Siddharth Vadapalli Nov. 30, 2022, 5:59 a.m. UTC | #5
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/20220309075944.32166-1-s-vadapalli@ti.com/

Regards,
Siddharth.
patchwork-bot+netdevbpf@kernel.org Dec. 1, 2022, 6 a.m. UTC | #6
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

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!
diff mbox series

Patch

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)