diff options
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/vitesse.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c index 596222b260d6..f39ab76e6f67 100644 --- a/drivers/net/phy/vitesse.c +++ b/drivers/net/phy/vitesse.c | |||
@@ -65,7 +65,15 @@ static int vsc824x_config_init(struct phy_device *phydev) | |||
65 | 65 | ||
66 | static int vsc824x_ack_interrupt(struct phy_device *phydev) | 66 | static int vsc824x_ack_interrupt(struct phy_device *phydev) |
67 | { | 67 | { |
68 | int err = phy_read(phydev, MII_VSC8244_ISTAT); | 68 | int err = 0; |
69 | |||
70 | /* | ||
71 | * Don't bother to ACK the interrupts if interrupts | ||
72 | * are disabled. The 824x cannot clear the interrupts | ||
73 | * if they are disabled. | ||
74 | */ | ||
75 | if (phydev->interrupts == PHY_INTERRUPT_ENABLED) | ||
76 | err = phy_read(phydev, MII_VSC8244_ISTAT); | ||
69 | 77 | ||
70 | return (err < 0) ? err : 0; | 78 | return (err < 0) ? err : 0; |
71 | } | 79 | } |
@@ -77,8 +85,19 @@ static int vsc824x_config_intr(struct phy_device *phydev) | |||
77 | if (phydev->interrupts == PHY_INTERRUPT_ENABLED) | 85 | if (phydev->interrupts == PHY_INTERRUPT_ENABLED) |
78 | err = phy_write(phydev, MII_VSC8244_IMASK, | 86 | err = phy_write(phydev, MII_VSC8244_IMASK, |
79 | MII_VSC8244_IMASK_MASK); | 87 | MII_VSC8244_IMASK_MASK); |
80 | else | 88 | else { |
89 | /* | ||
90 | * The Vitesse PHY cannot clear the interrupt | ||
91 | * once it has disabled them, so we clear them first | ||
92 | */ | ||
93 | err = phy_read(phydev, MII_VSC8244_ISTAT); | ||
94 | |||
95 | if (err) | ||
96 | return err; | ||
97 | |||
81 | err = phy_write(phydev, MII_VSC8244_IMASK, 0); | 98 | err = phy_write(phydev, MII_VSC8244_IMASK, 0); |
99 | } | ||
100 | |||
82 | return err; | 101 | return err; |
83 | } | 102 | } |
84 | 103 | ||