mbox series

[RFC,net-next,v2,0/2] net: phy: mxl-gpy: broken interrupt fixes

Message ID 20221228164008.1653348-1-michael@walle.cc (mailing list archive)
Headers show
Series net: phy: mxl-gpy: broken interrupt fixes | expand

Message

Michael Walle Dec. 28, 2022, 4:40 p.m. UTC
The GPY215 has a broken interrupt pin. This patch series tries to
workaround that and because in general that is not possible, disables the
interrupts by default and falls back to polling mode. There is an opt-in
via the devicetree.

The devicetree binding is missing for now because there is still an
ongoing discussion. I'm sending this, because I want to get some feedback
on the new handling in the phy core. As Andrew pointed out, we cannot
change the irq in the PHY's .probe() because a MAC driver might overwrite
it afterwards, e.g. the stmmac does so. Instead introduce a new flag which
can be set by the PHY driver and which is evaluated just before the PHY is
attached and thus the interrupt is requested.

Btw. I'm not sure dev_flags is the correct place here. I couldn't see
when to use dev_flags and when to use the plain one-bit properties in the
struct phy_device. The latter seems to be used internally, but of course
there is at least one exception, the .mac_managed_pm is set by the MAC
drivers.

v2:
 - new handling of how to disable the interrupts

Michael Walle (2):
  net: phy: allow a phy to opt-out of interrupt handling
  net: phy: mxl-gpy: disable interrupts on GPY215 by default

 drivers/net/phy/mxl-gpy.c    | 5 +++++
 drivers/net/phy/phy_device.c | 7 +++++++
 include/linux/phy.h          | 2 ++
 3 files changed, 14 insertions(+)