Skip to content
Permalink
Browse files

ipq40xx: fix phy interrupt setting

This patch fixes a problem that was discovered during DSA
development. On the MR33, the link change events from the
external AR8035-PHY would never make it to the qca8k driver.

The issue turned out to be a misplaced memcpy that was copying
over the zero-initialized irq table, when it should have been
set to PHY_POLL. Hence this patch moves the memcpy after the
array has been initialized.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
  • Loading branch information...
chunkeey committed Mar 9, 2019
1 parent 39092ad commit 784f2e73df750e79759a80b21e09094262359f80
@@ -2640,14 +2640,14 @@ Subject: [PATCH 30/38] NET: add qualcomm mdio and PHY
+ am->mii_bus->name = "ipq40xx_mdio";
+ am->mii_bus->read = ipq40xx_mdio_read;
+ am->mii_bus->write = ipq40xx_mdio_write;
+ memcpy(am->mii_bus->irq, am->phy_irq, sizeof(am->phy_irq));
+ am->mii_bus->priv = am;
+ am->mii_bus->parent = &pdev->dev;
+ snprintf(am->mii_bus->id, MII_BUS_ID_SIZE, "%s", dev_name(&pdev->dev));
+
+ for (i = 0; i < PHY_MAX_ADDR; i++)
+ am->phy_irq[i] = PHY_POLL;
+
+ memcpy(am->mii_bus->irq, am->phy_irq, sizeof(am->phy_irq));
+ am->dev = &pdev->dev;
+ platform_set_drvdata(pdev, am);
+
@@ -2640,14 +2640,14 @@ Subject: [PATCH 30/38] NET: add qualcomm mdio and PHY
+ am->mii_bus->name = "ipq40xx_mdio";
+ am->mii_bus->read = ipq40xx_mdio_read;
+ am->mii_bus->write = ipq40xx_mdio_write;
+ memcpy(am->mii_bus->irq, am->phy_irq, sizeof(am->phy_irq));
+ am->mii_bus->priv = am;
+ am->mii_bus->parent = &pdev->dev;
+ snprintf(am->mii_bus->id, MII_BUS_ID_SIZE, "%s", dev_name(&pdev->dev));
+
+ for (i = 0; i < PHY_MAX_ADDR; i++)
+ am->phy_irq[i] = PHY_POLL;
+
+ memcpy(am->mii_bus->irq, am->phy_irq, sizeof(am->phy_irq));
+ am->dev = &pdev->dev;
+ platform_set_drvdata(pdev, am);
+

0 comments on commit 784f2e7

Please sign in to comment.
You can’t perform that action at this time.