diff mbox series

[net] net: macb: use phy_interface_mode_is_rgmii everywhere

Message ID 20200717233221.840294-1-alexandre.belloni@bootlin.com
State Accepted
Delegated to: David Miller
Headers show
Series [net] net: macb: use phy_interface_mode_is_rgmii everywhere | expand

Commit Message

Alexandre Belloni July 17, 2020, 11:32 p.m. UTC
There is one RGMII check not using the phy_interface_mode_is_rgmii()
helper. This prevents the driver from configuring the MAC properly when
using a phy-mode that is not just rgmii, e.g. rgmii-rxid. This became an
issue on sama5d3 xplained since the ksz9031 driver is hadling phy-mode
properly and the phy-mode has to be set to rgmii-rxid.

Fixes: bcf3440c6dd78bfe ("net: phy: micrel: add phy-mode support for the KSZ9031 PHY")
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/net/ethernet/cadence/macb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller July 18, 2020, 1:32 a.m. UTC | #1
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
Date: Sat, 18 Jul 2020 01:32:21 +0200

> There is one RGMII check not using the phy_interface_mode_is_rgmii()
> helper. This prevents the driver from configuring the MAC properly when
> using a phy-mode that is not just rgmii, e.g. rgmii-rxid. This became an
> issue on sama5d3 xplained since the ksz9031 driver is hadling phy-mode
> properly and the phy-mode has to be set to rgmii-rxid.
> 
> Fixes: bcf3440c6dd78bfe ("net: phy: micrel: add phy-mode support for the KSZ9031 PHY")
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

Applied, thank you.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 52582e8ed90e..61d5b5744261 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -3730,7 +3730,7 @@  static int macb_init(struct platform_device *pdev)
 
 	if (!(bp->caps & MACB_CAPS_USRIO_DISABLED)) {
 		val = 0;
-		if (bp->phy_interface == PHY_INTERFACE_MODE_RGMII)
+		if (phy_interface_mode_is_rgmii(bp->phy_interface))
 			val = GEM_BIT(RGMII);
 		else if (bp->phy_interface == PHY_INTERFACE_MODE_RMII &&
 			 (bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII))