netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: khalasa@piap.pl (Krzysztof Hałasa)
To: netdev@vger.kernel.org,
	Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Subject: Parent device of MDIO bus
Date: Wed, 13 Aug 2014 15:51:08 +0200	[thread overview]
Message-ID: <m3egwkwl9v.fsf@t19.piap.pl> (raw)

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

             reply	other threads:[~2014-08-13 13:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13 13:51 Krzysztof Hałasa [this message]
2014-08-13 15:43 ` Parent device of MDIO bus Fabio Estevam
2014-08-14  6:16   ` Krzysztof Hałasa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3egwkwl9v.fsf@t19.piap.pl \
    --to=khalasa@piap.pl \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).