Skip to content

Commit 8a066a8

Browse files
danitoolgregkh
authored andcommitted
net: phy: bcm63xx: Utilize correct config_intr function
[ Upstream commit cd33b3e0da43522ff8e8f2b2b71d3d08298512b0 ] Commit a1cba56 ("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: a1cba56 ("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>
1 parent 6fec199 commit 8a066a8

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

drivers/net/phy/bcm63xx.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,23 @@ MODULE_DESCRIPTION("Broadcom 63xx internal PHY driver");
2121
MODULE_AUTHOR("Maxime Bizon <mbizon@freebox.fr>");
2222
MODULE_LICENSE("GPL");
2323

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+
2441
static int bcm63xx_config_init(struct phy_device *phydev)
2542
{
2643
int reg, err;
@@ -55,7 +72,7 @@ static struct phy_driver bcm63xx_driver[] = {
5572
.config_aneg = genphy_config_aneg,
5673
.read_status = genphy_read_status,
5774
.ack_interrupt = bcm_phy_ack_intr,
58-
.config_intr = bcm_phy_config_intr,
75+
.config_intr = bcm63xx_config_intr,
5976
.driver = { .owner = THIS_MODULE },
6077
}, {
6178
/* same phy as above, with just a different OUI */
@@ -68,7 +85,7 @@ static struct phy_driver bcm63xx_driver[] = {
6885
.config_aneg = genphy_config_aneg,
6986
.read_status = genphy_read_status,
7087
.ack_interrupt = bcm_phy_ack_intr,
71-
.config_intr = bcm_phy_config_intr,
88+
.config_intr = bcm63xx_config_intr,
7289
.driver = { .owner = THIS_MODULE },
7390
} };
7491

0 commit comments

Comments
 (0)