Skip to content

Commit 4c8e045

Browse files
linuswdavem330
authored andcommitted
net: phy: realtek: Dummy IRQ calls for RTL8366RB
This fixes a regression introduced by commit 0d2e778 "net: phy: replace PHY_HAS_INTERRUPT with a check for config_intr and ack_interrupt". This assumes that a PHY cannot trigger interrupt unless it has .config_intr() or .ack_interrupt() implemented. A later patch makes the code assume both need to be implemented for interrupts to be present. But this PHY (which is inside a DSA) will happily fire interrupts without either callback. Implement dummy callbacks for .config_intr() and .ack_interrupt() in the phy header to fix this. Tested on the RTL8366RB on D-Link DIR-685. Fixes: 0d2e778 ("net: phy: replace PHY_HAS_INTERRUPT with a check for config_intr and ack_interrupt") Cc: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent bf50b60 commit 4c8e045

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

drivers/net/phy/realtek.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,13 @@ static struct phy_driver realtek_drvs[] = {
282282
.name = "RTL8366RB Gigabit Ethernet",
283283
.features = PHY_GBIT_FEATURES,
284284
.config_init = &rtl8366rb_config_init,
285+
/* These interrupts are handled by the irq controller
286+
* embedded inside the RTL8366RB, they get unmasked when the
287+
* irq is requested and ACKed by reading the status register,
288+
* which is done by the irqchip code.
289+
*/
290+
.ack_interrupt = genphy_no_ack_interrupt,
291+
.config_intr = genphy_no_config_intr,
285292
.suspend = genphy_suspend,
286293
.resume = genphy_resume,
287294
},

include/linux/phy.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,14 @@ static inline int genphy_no_soft_reset(struct phy_device *phydev)
992992
{
993993
return 0;
994994
}
995+
static inline int genphy_no_ack_interrupt(struct phy_device *phydev)
996+
{
997+
return 0;
998+
}
999+
static inline int genphy_no_config_intr(struct phy_device *phydev)
1000+
{
1001+
return 0;
1002+
}
9951003
int genphy_read_mmd_unsupported(struct phy_device *phdev, int devad,
9961004
u16 regnum);
9971005
int genphy_write_mmd_unsupported(struct phy_device *phdev, int devnum,

0 commit comments

Comments
 (0)