netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Parent device of MDIO bus
@ 2014-08-13 13:51 Krzysztof Hałasa
  2014-08-13 15:43 ` Fabio Estevam
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Hałasa @ 2014-08-13 13:51 UTC (permalink / raw)
  To: netdev, Ezequiel Garcia

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?
-- 
Krzysztof Halasa

Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland

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

* Re: Parent device of MDIO bus
  2014-08-13 13:51 Parent device of MDIO bus Krzysztof Hałasa
@ 2014-08-13 15:43 ` Fabio Estevam
  2014-08-14  6:16   ` Krzysztof Hałasa
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2014-08-13 15:43 UTC (permalink / raw)
  To: Krzysztof Hałasa; +Cc: netdev, Ezequiel Garcia

On Wed, Aug 13, 2014 at 10:51 AM, Krzysztof Hałasa <khalasa@piap.pl> wrote:
> 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?

This patch has been reverted in mainline.

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

* Re: Parent device of MDIO bus
  2014-08-13 15:43 ` Fabio Estevam
@ 2014-08-14  6:16   ` Krzysztof Hałasa
  0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Hałasa @ 2014-08-14  6:16 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: netdev, Ezequiel Garcia

>> 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.

Fabio Estevam <festevam@gmail.com> writes:

> This patch has been reverted in mainline.

Short and simple... Thanks.
-- 
Krzysztof Halasa

Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland

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

end of thread, other threads:[~2014-08-14  6:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-13 13:51 Parent device of MDIO bus Krzysztof Hałasa
2014-08-13 15:43 ` Fabio Estevam
2014-08-14  6:16   ` Krzysztof Hałasa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).