]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
net: phy: add genphy_handle_interrupt_no_ack()
authorIoana Ciornei <ioana.ciornei@nxp.com>
Sun, 1 Nov 2020 12:51:12 +0000 (14:51 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 6 Nov 2020 00:32:39 +0000 (16:32 -0800)
It seems there are cases where the interrupts are handled by another
entity (ie an IRQ controller embedded inside the PHY) and do not need
any other interraction from phylib. For this kind of PHYs, like the
RTL8366RB, add the genphy_handle_interrupt_no_ack() function which just
triggers the link state machine.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/phy_device.c
include/linux/phy.h

index f54f483d7fd66f1210f91e59e98013858af740ed..e13a46c25437c035751aa45cca13ad7dba12f5c5 100644 (file)
@@ -2463,6 +2463,19 @@ int genphy_soft_reset(struct phy_device *phydev)
 }
 EXPORT_SYMBOL(genphy_soft_reset);
 
+irqreturn_t genphy_handle_interrupt_no_ack(struct phy_device *phydev)
+{
+       /* It seems there are cases where the interrupts are handled by another
+        * entity (ie an IRQ controller embedded inside the PHY) and do not
+        * need any other interraction from phylib. In this case, just trigger
+        * the state machine directly.
+        */
+       phy_trigger_machine(phydev);
+
+       return 0;
+}
+EXPORT_SYMBOL(genphy_handle_interrupt_no_ack);
+
 /**
  * genphy_read_abilities - read PHY abilities from Clause 22 registers
  * @phydev: target phy_device struct
index 566b39f6cd645312b9e6d82362c00642edd2a9c4..4f158d6352aeae3f3e8fa7a6792a5b4791b79c90 100644 (file)
@@ -1510,6 +1510,7 @@ int genphy_suspend(struct phy_device *phydev);
 int genphy_resume(struct phy_device *phydev);
 int genphy_loopback(struct phy_device *phydev, bool enable);
 int genphy_soft_reset(struct phy_device *phydev);
+irqreturn_t genphy_handle_interrupt_no_ack(struct phy_device *phydev);
 
 static inline int genphy_config_aneg(struct phy_device *phydev)
 {