From: Shaohui Xie <shaohui....@freescale.com>

When probing devices-in-package for a c45 phy, device zero is the last
device to probe, in a rare situation which driver can read a '0' from
the device zero, thus c45_ids->devices_in_package is set to '0', so the
loop condition of probing is matched, see codes below:

for (i = 1;i < num_ids && c45_ids->devices_in_package == 0;i++)

driver will run in a dead loop.

So after probing the device zero, driver should stop the probing loop.

Signed-off-by: Shaohui Xie <shaohui....@freescale.com>
---
 drivers/net/phy/phy_device.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 3833891..065d6d3 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -257,6 +257,10 @@ retry:             reg_addr = MII_ADDR_C45 | i << 16 | 
MDIO_DEVS2;
                                return 0;
                        }
                }
+
+               /* stop probe when device zero was probed. */
+               if (!i)
+                       break;
        }
 
        /* Now probe Device Identifiers for each device present. */
-- 
2.1.0.27.g96db324

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to