diff options
| author | Daniel Gonzalez Cabanelas <dgcbueu@gmail.com> | 2017-01-17 19:26:55 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-04 03:47:10 -0500 |
| commit | b335e65666610c456a5fed734cdd04ec84639a52 (patch) | |
| tree | a03785d8d1bacf7b5666886ac66e8207ef289011 /drivers/net/phy | |
| parent | 948e137ad9ba0d4ff8ebc5ee994dc26fe3ebc4f6 (diff) | |
net: phy: bcm63xx: Utilize correct config_intr function
[ Upstream commit cd33b3e0da43522ff8e8f2b2b71d3d08298512b0 ]
Commit a1cba5613edf ("net: phy: Add Broadcom phy library for common
interfaces") make the BCM63xx PHY driver utilize bcm_phy_config_intr()
which would appear to do the right thing, except that it does not write
to the MII_BCM63XX_IR register but to MII_BCM54XX_ECR which is
different.
This would be causing invalid link parameters and events from being
generated by the PHY interrupt.
Fixes: a1cba5613edf ("net: phy: Add Broadcom phy library for common interfaces")
Signed-off-by: Daniel Gonzalez Cabanelas <dgcbueu@gmail.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/phy')
| -rw-r--r-- | drivers/net/phy/bcm63xx.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/net/phy/bcm63xx.c b/drivers/net/phy/bcm63xx.c index e741bf614c4e..b0492ef2cdaa 100644 --- a/drivers/net/phy/bcm63xx.c +++ b/drivers/net/phy/bcm63xx.c | |||
| @@ -21,6 +21,23 @@ MODULE_DESCRIPTION("Broadcom 63xx internal PHY driver"); | |||
| 21 | MODULE_AUTHOR("Maxime Bizon <mbizon@freebox.fr>"); | 21 | MODULE_AUTHOR("Maxime Bizon <mbizon@freebox.fr>"); |
| 22 | MODULE_LICENSE("GPL"); | 22 | MODULE_LICENSE("GPL"); |
| 23 | 23 | ||
| 24 | static int bcm63xx_config_intr(struct phy_device *phydev) | ||
| 25 | { | ||
| 26 | int reg, err; | ||
| 27 | |||
| 28 | reg = phy_read(phydev, MII_BCM63XX_IR); | ||
| 29 | if (reg < 0) | ||
| 30 | return reg; | ||
| 31 | |||
| 32 | if (phydev->interrupts == PHY_INTERRUPT_ENABLED) | ||
| 33 | reg &= ~MII_BCM63XX_IR_GMASK; | ||
| 34 | else | ||
| 35 | reg |= MII_BCM63XX_IR_GMASK; | ||
| 36 | |||
| 37 | err = phy_write(phydev, MII_BCM63XX_IR, reg); | ||
| 38 | return err; | ||
| 39 | } | ||
| 40 | |||
| 24 | static int bcm63xx_config_init(struct phy_device *phydev) | 41 | static int bcm63xx_config_init(struct phy_device *phydev) |
| 25 | { | 42 | { |
| 26 | int reg, err; | 43 | int reg, err; |
| @@ -55,7 +72,7 @@ static struct phy_driver bcm63xx_driver[] = { | |||
| 55 | .config_aneg = genphy_config_aneg, | 72 | .config_aneg = genphy_config_aneg, |
| 56 | .read_status = genphy_read_status, | 73 | .read_status = genphy_read_status, |
| 57 | .ack_interrupt = bcm_phy_ack_intr, | 74 | .ack_interrupt = bcm_phy_ack_intr, |
| 58 | .config_intr = bcm_phy_config_intr, | 75 | .config_intr = bcm63xx_config_intr, |
| 59 | }, { | 76 | }, { |
| 60 | /* same phy as above, with just a different OUI */ | 77 | /* same phy as above, with just a different OUI */ |
| 61 | .phy_id = 0x002bdc00, | 78 | .phy_id = 0x002bdc00, |
| @@ -67,7 +84,7 @@ static struct phy_driver bcm63xx_driver[] = { | |||
| 67 | .config_aneg = genphy_config_aneg, | 84 | .config_aneg = genphy_config_aneg, |
| 68 | .read_status = genphy_read_status, | 85 | .read_status = genphy_read_status, |
| 69 | .ack_interrupt = bcm_phy_ack_intr, | 86 | .ack_interrupt = bcm_phy_ack_intr, |
| 70 | .config_intr = bcm_phy_config_intr, | 87 | .config_intr = bcm63xx_config_intr, |
| 71 | } }; | 88 | } }; |
| 72 | 89 | ||
| 73 | module_phy_driver(bcm63xx_driver); | 90 | module_phy_driver(bcm63xx_driver); |
