Thread (9 messages) flat view 9 messages, 5 authors, 2018-08-20

Re: [PATCH] net: macb: Fix regression breaking non-MDIO fixed-link PHYs

From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
Date: 2018-08-15 16:52:42
Also in: stable

Hi,

On Wed, Aug 15, 2018 at 3:35 AM Andrew Lunn [off-list ref] wrote:
On Tue, Aug 14, 2018 at 05:58:12PM +0200, Uwe Kleine-König wrote:
quoted
Hello Ahmad,


On Tue, Aug 14, 2018 at 04:12:40PM +0200, Ahmad Fatoum wrote:
quoted
The referenced commit broke initializing macb on the EVB-KSZ9477 eval board.
There, of_mdiobus_register was called even for the fixed-link representing
the SPI-connected switch PHY, with the result that the driver attempts to
enumerate PHYs on a non-existent MDIO bus:
I ran into a similar problem on v14.4 for davinci_mdio I had to patch
it with [1].
The cpsw has 2 phys one phy is connected to KSZ9031 and other to
ksz9897 Ethernet switch
which is treated as a fixed phy with no mdio lines because of which
mdio_read/write failed.
This didn’t happen in v4.9.x something in core has changed ?

[1]
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c
b/drivers/net/ethernet/ti/davinci_mdio.c
index 3e84107..197baa6 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -245,6 +245,13 @@ static int davinci_mdio_read(struct mii_bus *bus,
int phy_id, int phy_reg)
        u32 reg;
        int ret;

+       if (phy_id == 2)
+               return 0;
+
        if (phy_reg & ~PHY_REG_MASK || phy_id & ~PHY_ID_MASK)
                return -EINVAL;
@@ -289,6 +296,13 @@ static int davinci_mdio_write(struct mii_bus
*bus, int phy_id,
        u32 reg;
        int ret;

+       if (phy_id == 2)
+               return 0;
+
        if (phy_reg & ~PHY_REG_MASK || phy_id & ~PHY_ID_MASK)
                return -EINVAL;


Cheers,
--Prabhakar Lad
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help