Skip to content

Commit

Permalink
net: phy: add genphy_handle_interrupt_no_ack()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ioana Ciornei authored and Jakub Kicinski committed Nov 6, 2020
1 parent 0d65cc1 commit 87de1f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions include/linux/phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 87de1f0

Please sign in to comment.