public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [net-next v5 0/2] Prevent nullptr exceptions in ISR
@ 2024-01-29 13:55 Andre Werner
  2024-01-29 13:55 ` [net-next v5 1/2] net: phy: phy_device: Prevent nullptr exceptions on ISR Andre Werner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andre Werner @ 2024-01-29 13:55 UTC (permalink / raw)
  To: andrew, hkallweit1, davem, edumazet, kuba, pabeni
  Cc: linux, netdev, linux-kernel, Andre Werner

In case phydev->irq is modified unconditionally to a valid IRQ, handling
the IRQ may lead to a nullptr exception if no interrupt handler is
registered to the phy driver. phy_interrupt calls a
phy_device->handle_interrupt unconditionally. And interrupts are enabled
in phy_connect_direct if phydev->irq is not equal to PHY_POLL or
PHY_MAC_INTERRUPT, so it does not check for a phy driver providing an ISR.

Adding an additonal check for a valid interrupt handler in phy_attach_direct
function, and falling back to polling mode if not, should prevent for
such nullptr exceptions.

Moreover, the ADIN1100 phy driver is extended with an interrupt handler
for changes in the link status.

Andre Werner (2):
  net: phy: phy_device: Prevent nullptr exceptions on ISR
  net: phy: adin1100: Add interrupt support for link change

 drivers/net/phy/adin1100.c   | 55 ++++++++++++++++++++++++++++++++++++
 drivers/net/phy/phy_device.c | 13 +++++----
 2 files changed, 63 insertions(+), 5 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-01  0:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-29 13:55 [net-next v5 0/2] Prevent nullptr exceptions in ISR Andre Werner
2024-01-29 13:55 ` [net-next v5 1/2] net: phy: phy_device: Prevent nullptr exceptions on ISR Andre Werner
2024-01-29 14:29   ` Andrew Lunn
2024-01-30  6:54     ` Andre Werner
2024-01-29 13:55 ` [net-next v5 2/2] net: phy: adin1100: Add interrupt support for link change Andre Werner
2024-02-01  0:30 ` [net-next v5 0/2] Prevent nullptr exceptions in ISR patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox