Commit 8a066a87 authored by Daniel Gonzalez Cabanelas's avatar Daniel Gonzalez Cabanelas Committed by Greg Kroah-Hartman

net: phy: bcm63xx: Utilize correct config_intr function

[ Upstream commit cd33b3e0 ]

Commit a1cba561 ("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: a1cba561 ("net: phy: Add Broadcom phy library for common interfaces")
Signed-off-by: default avatarDaniel Gonzalez Cabanelas <dgcbueu@gmail.com>
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6fec1993
...@@ -21,6 +21,23 @@ MODULE_DESCRIPTION("Broadcom 63xx internal PHY driver"); ...@@ -21,6 +21,23 @@ MODULE_DESCRIPTION("Broadcom 63xx internal PHY driver");
MODULE_AUTHOR("Maxime Bizon <mbizon@freebox.fr>"); MODULE_AUTHOR("Maxime Bizon <mbizon@freebox.fr>");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static int bcm63xx_config_intr(struct phy_device *phydev)
{
int reg, err;
reg = phy_read(phydev, MII_BCM63XX_IR);
if (reg < 0)
return reg;
if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
reg &= ~MII_BCM63XX_IR_GMASK;
else
reg |= MII_BCM63XX_IR_GMASK;
err = phy_write(phydev, MII_BCM63XX_IR, reg);
return err;
}
static int bcm63xx_config_init(struct phy_device *phydev) static int bcm63xx_config_init(struct phy_device *phydev)
{ {
int reg, err; int reg, err;
...@@ -55,7 +72,7 @@ static struct phy_driver bcm63xx_driver[] = { ...@@ -55,7 +72,7 @@ static struct phy_driver bcm63xx_driver[] = {
.config_aneg = genphy_config_aneg, .config_aneg = genphy_config_aneg,
.read_status = genphy_read_status, .read_status = genphy_read_status,
.ack_interrupt = bcm_phy_ack_intr, .ack_interrupt = bcm_phy_ack_intr,
.config_intr = bcm_phy_config_intr, .config_intr = bcm63xx_config_intr,
.driver = { .owner = THIS_MODULE }, .driver = { .owner = THIS_MODULE },
}, { }, {
/* same phy as above, with just a different OUI */ /* same phy as above, with just a different OUI */
...@@ -68,7 +85,7 @@ static struct phy_driver bcm63xx_driver[] = { ...@@ -68,7 +85,7 @@ static struct phy_driver bcm63xx_driver[] = {
.config_aneg = genphy_config_aneg, .config_aneg = genphy_config_aneg,
.read_status = genphy_read_status, .read_status = genphy_read_status,
.ack_interrupt = bcm_phy_ack_intr, .ack_interrupt = bcm_phy_ack_intr,
.config_intr = bcm_phy_config_intr, .config_intr = bcm63xx_config_intr,
.driver = { .owner = THIS_MODULE }, .driver = { .owner = THIS_MODULE },
} }; } };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment