> Yes mlxbf_gige_mdio_handle_phy_interrupt is used to check whether > the interrupt is coming from GPIO12 (which is set in HW as the PHY > INT_N pin). There is one HW interrupt line (here defined as > MLXBF_GIGE_PHY_INT_N) shared among all the GPIOs and other > components (like I2C).
So this is the key thing here. You have an interrupt controller, where as the PHY subsystem wants a plain interrupt. Give the PHY subsystem a plain interrupt, and it will do all the calls to configure the PHY, enable interrupts in the PHY etc. There is nothing stopping you have an interrupt controller inside an Ethernet driver, or any other sort of driver. Take for example: https://elixir.bootlin.com/linux/v5.10-rc4/source/drivers/net/dsa/mv88e6xxx/chip.c#L127 The Marvell Ethernet switches also have an interrupt controller. Actually they have two nested controllers. This code registers an irq domain with the linux core, so that the individual interrupt sources can be used as just plain old Linux interrupts. The irqdomain is responsible to masking and unmasking interrupts, in the interrupt controller. The end user of these interrupts, then just request them in the usual way: https://elixir.bootlin.com/linux/v5.10-rc4/source/drivers/net/dsa/mv88e6xxx/global1_atu.c#L419 So in your case, map the PHY interrupt in this domain, and pass it to the PHY subsystem. Andrew