ipq40xx: fix phy interrupt setting
authorChristian Lamparter <chunkeey@gmail.com>
Sat, 9 Mar 2019 18:05:17 +0000 (19:05 +0100)
committerChristian Lamparter <chunkeey@gmail.com>
Wed, 13 Mar 2019 15:25:34 +0000 (16:25 +0100)
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>
target/linux/ipq40xx/patches-4.14/700-net-add-qualcomm-mdio-and-phy.patch
target/linux/ipq40xx/patches-4.19/700-net-add-qualcomm-mdio-and-phy.patch

index c6e715510eaa42c904d3cf1e7b31bc6024464381..00cfa3ab9be9eededa3c60631d47d0d6dc0f0dc1 100644 (file)
@@ -2640,7 +2640,6 @@ 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));
@@ -2648,6 +2647,7 @@ Subject: [PATCH 30/38] NET: add qualcomm mdio and PHY
 +      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);
 +
index 58ae6b99067584c6712e78b0f686ba847b0f859d..bad8b797f8861b196d476013fdbbb2cee172e332 100644 (file)
@@ -2640,7 +2640,6 @@ 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));
@@ -2648,6 +2647,7 @@ Subject: [PATCH 30/38] NET: add qualcomm mdio and PHY
 +      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);
 +