Commit 4c8e0459 authored by Linus Walleij's avatar Linus Walleij Committed by David S. Miller

net: phy: realtek: Dummy IRQ calls for RTL8366RB

This fixes a regression introduced by
commit 0d2e778e
"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: 0d2e778e ("net: phy: replace PHY_HAS_INTERRUPT with a check for config_intr and ack_interrupt")
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bf50b606
...@@ -282,6 +282,13 @@ static struct phy_driver realtek_drvs[] = { ...@@ -282,6 +282,13 @@ static struct phy_driver realtek_drvs[] = {
.name = "RTL8366RB Gigabit Ethernet", .name = "RTL8366RB Gigabit Ethernet",
.features = PHY_GBIT_FEATURES, .features = PHY_GBIT_FEATURES,
.config_init = &rtl8366rb_config_init, .config_init = &rtl8366rb_config_init,
/* These interrupts are handled by the irq controller
* embedded inside the RTL8366RB, they get unmasked when the
* irq is requested and ACKed by reading the status register,
* which is done by the irqchip code.
*/
.ack_interrupt = genphy_no_ack_interrupt,
.config_intr = genphy_no_config_intr,
.suspend = genphy_suspend, .suspend = genphy_suspend,
.resume = genphy_resume, .resume = genphy_resume,
}, },
......
...@@ -992,6 +992,14 @@ static inline int genphy_no_soft_reset(struct phy_device *phydev) ...@@ -992,6 +992,14 @@ static inline int genphy_no_soft_reset(struct phy_device *phydev)
{ {
return 0; return 0;
} }
static inline int genphy_no_ack_interrupt(struct phy_device *phydev)
{
return 0;
}
static inline int genphy_no_config_intr(struct phy_device *phydev)
{
return 0;
}
int genphy_read_mmd_unsupported(struct phy_device *phdev, int devad, int genphy_read_mmd_unsupported(struct phy_device *phdev, int devad,
u16 regnum); u16 regnum);
int genphy_write_mmd_unsupported(struct phy_device *phdev, int devnum, int genphy_write_mmd_unsupported(struct phy_device *phdev, int devnum,
......
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