net: ethernet: ti: cpsw: add check for in-band mode setting with RGMII PHY interface
Subsystems (3)
PATCH v2 1/1 net: ethernet: ti: cpsw: add check for in-band mode setting with RGMII PHY interface
According to AM335x TRM[1] 14.3.6.2, AM437x TRM[2] 15.3.6.2 and DRA7 TRM[3] 24.11.4.8.7.3.3, in-band mode in EXT_EN(bit18) register is only available when PHY is configured in RGMII mode with 10Mbps speed. It will cause some networking issues without RGMII mode, such as carrier sense errors and low throughput. TI also mentioned this issue in their forum[4].
This patch adds the check mechanism for PHY interface with RGMII interface type, the in-band mode can only be set in RGMII mode with 10Mbps speed.
References:
[1]: https://www.ti.com/lit/ug/spruh73p/spruh73p.pdf
[2]: http://www.ti.com/lit/ug/spruhl7h/spruhl7h.pdf
[3]: http://www.ti.com/lit/ug/spruic2b/spruic2b.pdf
[4]: https://e2e.ti.com/support/arm/sitara_arm/f/791/p/640765/2392155
---
Changes from v1:
- Use phy_interface_is_rgmii helper function
- Remove blank line
drivers/net/ethernet/ti/cpsw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/ti/cpsw.c +2 -1
@@ -1014,7 +1014,8 @@ static void _cpsw_adjust_link(struct cpsw_slave *slave,/* set speed_in input in case RMII mode is used in 100Mbps */ if (phy->speed ==100 ) mac_control |=BIT (15 ); -else if (phy->speed ==10 ) +/* in band mode only works in 10Mbps RGMII mode */ +else if ((phy->speed ==10 ) &&phy_interface_is_rgmii (phy)) mac_control |=BIT (18 );/* In Band mode */ if (priv->rx_pause)
Signature · 1 line
2.16.2
Quoted 15 lines · SZ Lin (林上智)
According to AM335x TRM[1] 14.3.6.2, AM437x TRM[2] 15.3.6.2 and DRA7 TRM[3] 24.11.4.8.7.3.3, in-band mode in
EXT_EN(bit18)register is only available when PHY is configured in RGMII mode with 10Mbps speed. It will cause some networking issues without RGMII mode, such as carrier sense errors and low throughput. TI also mentioned this issue in their forum[4].This patch adds the check mechanism for PHY interface with RGMII interface type, the in-band mode can only be set in RGMII mode with 10Mbps speed.
References:
[1]: https://www.ti.com/lit/ug/spruh73p/spruh73p.pdf
[2]: http://www.ti.com/lit/ug/spruhl7h/spruhl7h.pdf
[3]: http://www.ti.com/lit/ug/spruic2b/spruic2b.pdf
[4]: https://e2e.ti.com/support/arm/sitara_arm/f/791/p/640765/2392155
Quoted 8 lines
Suggested-by Holsety Chen (陳憲輝) <[email protected]>Signed-off-by SZ Lin (林上智) <[email protected]>Signed-off-by Schuyler Patton <[email protected]>---
Changes from v1:
- Usephy_interface_is_rgmiihelper function
- Remove blank line
Quoted 18 lines
drivers/net/ethernet/ti/cpsw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/ti/cpsw.c +2
-1@@ -1014,7 +1014,8 @@ static void _cpsw_adjust_link(struct cpsw_slave *slave,/* set speed_in input in case RMII mode is used in 100Mbps */ if (phy->speed ==100 ) mac_control |=BIT (15 ); -else if (phy->speed ==10 ) +/* in band mode only works in 10Mbps RGMII mode */ +else if ((phy->speed ==10 ) &&phy_interface_is_rgmii (phy)) mac_control |=BIT (18 );/* In Band mode */ if (priv->rx_pause)
Signature · 2 lines
regards, -grygorii
Quoted 27 lines · Grygorii Strashko
Quoted 15 lines · SZ Lin (林上智)
According to AM335x TRM[1] 14.3.6.2, AM437x TRM[2] 15.3.6.2 and DRA7 TRM[3] 24.11.4.8.7.3.3, in-band mode in
EXT_EN(bit18)register is only available when PHY is configured in RGMII mode with 10Mbps speed. It will cause some networking issues without RGMII mode, such as carrier sense errors and low throughput. TI also mentioned this issue in their forum[4].This patch adds the check mechanism for PHY interface with RGMII interface type, the in-band mode can only be set in RGMII mode with 10Mbps speed.
References:
[1]: https://www.ti.com/lit/ug/spruh73p/spruh73p.pdf
[2]: http://www.ti.com/lit/ug/spruhl7h/spruhl7h.pdf
[3]: http://www.ti.com/lit/ug/spruic2b/spruic2b.pdf
[4]: https://e2e.ti.com/support/arm/sitara_arm/f/791/p/640765/2392155Quoted 8 lines
Suggested-by Holsety Chen (陳憲輝) <[email protected]>Signed-off-by SZ Lin (林上智) <[email protected]>Signed-off-by Schuyler Patton <[email protected]>---
Changes from v1:
- Usephy_interface_is_rgmiihelper function
- Remove blank line
Quoted 2 lines
Reviewed-by Grygorii Strashko <[email protected]>
Also could this be marked as stable material 4.9+?
Signature · 2 lines
regards, -grygorii
Quoted 34 lines · Grygorii Strashko
Quoted 31 lines · Grygorii Strashko
Quoted 27 lines · SZ Lin (林上智)
According to AM335x TRM[1] 14.3.6.2, AM437x TRM[2] 15.3.6.2 and DRA7 TRM[3] 24.11.4.8.7.3.3, in-band mode in
EXT_EN(bit18)register is only
available when PHY is configured in RGMII mode with 10Mbps speed. It will
cause some networking issues without RGMII mode, such as carrier sense errors and low throughput. TI also mentioned this issue in their forum[4].This patch adds the check mechanism for PHY interface with RGMII interface
type, the in-band mode can only be set in RGMII mode with 10Mbps speed.References:
[1]: https://www.ti.com/lit/ug/spruh73p/spruh73p.pdf
[2]: http://www.ti.com/lit/ug/spruhl7h/spruhl7h.pdf
[3]: http://www.ti.com/lit/ug/spruic2b/spruic2b.pdf
[4]: https://e2e.ti.com/support/arm/sitara_arm/f/791/p/640765/2392155Suggested-by Holsety Chen (陳憲輝) <[email protected]>Signed-off-by SZ Lin (林上智) <[email protected]>Signed-off-by Schuyler Patton <[email protected]>---
Changes from v1:
- Usephy_interface_is_rgmiihelper function
- Remove blank line
Quoted 4 lines
Quoted 2 lines
Reviewed-by Grygorii Strashko <[email protected]>Also could this be marked as stable material 4.9+?
This is not how it works for networking changes, just make sure you provide a "Fixes:" tag, and David would usually take care of queueing the change to -stable accordingly:
Signature · 1 line
Florian
Quoted 38 lines · Florian Fainelli
Quoted 37 lines · Grygorii Strashko
Quoted 33 lines · Grygorii Strashko
Quoted 19 lines · SZ Lin (林上智)
According to AM335x TRM[1] 14.3.6.2, AM437x TRM[2] 15.3.6.2 and DRA7 TRM[3] 24.11.4.8.7.3.3, in-band mode in
EXT_EN(bit18)register is only
available when PHY is configured in RGMII mode with 10Mbps speed. It will
cause some networking issues without RGMII mode, such as carrier sense errors and low throughput. TI also mentioned this issue in their forum[4].This patch adds the check mechanism for PHY interface with RGMII interface
type, the in-band mode can only be set in RGMII mode with 10Mbps speed.References:
[1]: https://www.ti.com/lit/ug/spruh73p/spruh73p.pdf
[2]: http://www.ti.com/lit/ug/spruhl7h/spruhl7h.pdf
[3]: http://www.ti.com/lit/ug/spruic2b/spruic2b.pdf
[4]: https://e2e.ti.com/support/arm/sitara_arm/f/791/p/640765/2392155Quoted 8 lines
Suggested-by Holsety Chen (陳憲輝) <[email protected]>Signed-off-by SZ Lin (林上智) <[email protected]>Signed-off-by Schuyler Patton <[email protected]>---
Changes from v1:
- Usephy_interface_is_rgmiihelper function
- Remove blank lineReviewed-by Grygorii Strashko <[email protected]>
Quoted 8 lines
Quoted 1 line
Also could this be marked as stable material 4.9+?
This is not how it works for networking changes, just make sure you provide a "Fixes:" tag, and David would usually take care of queueing the change to -stable accordingly:
Sry, I know that, but this patch fixes very old commit [1] and it can't be applied to old Kernels without merge conflicts or build errors:(, so I've manually checked if it can be applied to most recent stable kernels and noted kernel versions here.
Also there is dependency from phy_interface_is_rgmii() which was merged in v4.2.
[1] commit a81d8762d713 ("drivers: net cpsw: Enable In Band mode in cpsw for 10 mbps") ^ went in v3.13
Signature · 2 lines
regards, -grygorii
David Miller
maintainerFrom: SZ Lin (林上智) <[email protected]>
Date: Fri, 16 Mar 2018 00:56:01 +0800
Quoted 15 lines
According to AM335x TRM[1] 14.3.6.2, AM437x TRM[2] 15.3.6.2 and DRA7 TRM[3] 24.11.4.8.7.3.3, in-band mode in
EXT_EN(bit18)register is only available when PHY is configured in RGMII mode with 10Mbps speed. It will cause some networking issues without RGMII mode, such as carrier sense errors and low throughput. TI also mentioned this issue in their forum[4].This patch adds the check mechanism for PHY interface with RGMII interface type, the in-band mode can only be set in RGMII mode with 10Mbps speed.
References:
[1]: https://www.ti.com/lit/ug/spruh73p/spruh73p.pdf
[2]: http://www.ti.com/lit/ug/spruhl7h/spruhl7h.pdf
[3]: http://www.ti.com/lit/ug/spruic2b/spruic2b.pdf
[4]: https://e2e.ti.com/support/arm/sitara_arm/f/791/p/640765/2392155
Quoted 3 lines
Suggested-by Holsety Chen (陳憲輝) <[email protected]>Signed-off-by SZ Lin (林上智) <[email protected]>Signed-off-by Schuyler Patton <[email protected]>
Applied and queued up for -stable, thank you.