Parent device of MDIO bus
Subsystems (2)
Hi,
I noticed a recent change a71e3c37960ce5f9c6a519bc1215e3ba9fa83e75:
net: phy: Set the driver when registering an MDIO bus device
mdiobus_register() registers a device which is already bound to a driver. Hence, the driver pointer should be set properly in order to track down the driver associated to the MDIO bus.
This will be used to allow ethernet driver to pin down a MDIO bus driver, preventing it from being unloaded while the PHY device is running.
Does this mean an MDIO driver must now be separate from its Ethernet driver in order for the latter to be rmmod-able? Otherwise, the Ethernet .probe (*_init_one()) calls mdiobus_register() and immediately bumps refcount (for both drivers in a common module) forever.
The other option seems to be moving mdio_register() from Ethernet's .probe() to dev->open(). This will make the driver un-rmmod-able when the Ethernet device is open (not a big problem and we had it this way some time ago). It will be rmmod-able again when all Ethernets are closed.
Or am I missing something?
What do you think?
Signature · 4 lines
Krzysztof Halasa Research Institute for Automation and Measurements PIAP Al. Jerozolimskie 202, 02-486 Warsaw, Poland
Quoted 17 lines · Krzysztof Hałasa
Hi,
I noticed a recent change
a71e3c37960ce5f9c6a519bc1215e3ba9fa83e75:
net: phy: Set the driver when registering an MDIO bus device
mdiobus_register()registers a device which is already bound to a driver. Hence, the driver pointer should be set properly in order to track down the driver associated to the MDIO bus.This will be used to allow ethernet driver to pin down a MDIO bus driver, preventing it from being unloaded while the PHY device is running.
Does this mean an MDIO driver must now be separate from its Ethernet driver in order for the latter to be rmmod-able? Otherwise, the Ethernet .probe (
*_init_one()) callsmdiobus_register()and immediately bumps refcount (for both drivers in a common module) forever.
Quoted 8 lines
The other option seems to be moving
mdio_register()from Ethernet's .probe() todev->open(). This will make the driver un-rmmod-able when the Ethernet device is open (not a big problem and we had it this way some time ago). It will be rmmod-able again when all Ethernets are closed.Or am I missing something?
What do you think?
This patch has been reverted in mainline.
Quoted 9 lines
Quoted 9 lines
I noticed a recent change
a71e3c37960ce5f9c6a519bc1215e3ba9fa83e75:
net: phy: Set the driver when registering an MDIO bus device
mdiobus_register()registers a device which is already bound to a driver. Hence, the driver pointer should be set properly in order to track down the driver associated to the MDIO bus.This will be used to allow ethernet driver to pin down a MDIO bus driver, preventing it from being unloaded while the PHY device is running.
Quoted 1 line · Fabio Estevam
This patch has been reverted in mainline.
Short and simple... Thanks.
Signature · 4 lines
Krzysztof Halasa Research Institute for Automation and Measurements PIAP Al. Jerozolimskie 202, 02-486 Warsaw, Poland