netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev <netdev@vger.kernel.org>,
	David Miller <davem@davemloft.net>,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Gregory Clement <gregory.clement@free-electrons.com>
Subject: Re: [RFC 0/2] net: phy: Prevent an MDIO bus from being unloaded while in use
Date: Mon, 21 Jul 2014 15:55:53 -0300	[thread overview]
Message-ID: <20140721185552.GA20027@arch.cereza> (raw)
In-Reply-To: <CAGVrzcYo7BKmjxLMfB7u8rkgE1o+CDkDkWvCSL4kZ8S3whx=hw@mail.gmail.com>

Hi Florian,

Thanks for the quick reply.

On 21 Jul 11:42 AM, Florian Fainelli wrote:
[..]
> >
> > This patchset fixes this by calling module_{get,put} in the ethernet driver.
> > After this patch, the mvmdio driver is no longer removable:
> >
> >   $ modprobe -r mvmdio
> >   modprobe: can't unload module mvmdio: Resource temporarily unavailable
> >
> > Of course, we can expect a few drivers to have the same need and therefore
> > we could argue about moving this to be part of the phydev connection.
> 
> Right, that's exactly what jumps to mind when I take a look at your
> patch set. As long as a PHY device connected to a particular MDIO bus
> is in used, we should make sure its refcount does not hit zero.
> 

Any suggestions about where to do it? I think the right place is
after the calls to bus_find_device() in of_phy_find_device() and
phy_connect().

> BTW, neither mvmdio nor mvneta seems to set their 'owner' field, is
> that intentional?
> 

Actually, I had a patch that did so and then dropped it. The owner
is set to unconditionally for plaftorm drivers, so setting it has no
effect. See include/linux/platform_device.h:

/*
 * use a macro to avoid include chaining to get THIS_MODULE
 */
#define platform_driver_register(drv) \
        __platform_driver_register(drv, THIS_MODULE)

-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com

  reply	other threads:[~2014-07-21 18:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-21 18:26 [RFC 0/2] net: phy: Prevent an MDIO bus from being unloaded while in use Ezequiel Garcia
2014-07-21 18:26 ` [RFC 1/2] net: phy: Set the driver when registering an MDIO bus device Ezequiel Garcia
2014-07-21 18:26 ` [RFC 2/2] net: mvneta: Ensure the MDIO bus module is held Ezequiel Garcia
2014-07-21 18:42 ` [RFC 0/2] net: phy: Prevent an MDIO bus from being unloaded while in use Florian Fainelli
2014-07-21 18:55   ` Ezequiel Garcia [this message]
2014-07-22 21:31     ` Florian Fainelli

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=20140721185552.GA20027@arch.cereza \
    --to=ezequiel.garcia@free-electrons.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=gregory.clement@free-electrons.com \
    --cc=netdev@vger.kernel.org \
    --cc=thomas.petazzoni@free-electrons.com \
    /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).