Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1232488

Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes

From Russell King - ARM Linux <linux@arm.linux.org.uk>
Newsgroups linux.kernel
Subject Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes
Date 2015-09-25 01:20 +0200
Message-ID <qcnXX-HD-3@gated-at.bofh.it> (permalink)
References <qcmSe-7CQ-1@gated-at.bofh.it> <qcn1U-7O4-5@gated-at.bofh.it> <qcnlg-8at-11@gated-at.bofh.it> <qcnEB-5s-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Sep 24, 2015 at 03:51:37PM -0700, David Miller wrote:
> From: Andrew Lunn <andrew@lunn.ch>
> Date: Fri, 25 Sep 2015 00:26:54 +0200
> 
> > On Thu, Sep 24, 2015 at 03:15:54PM -0700, David Miller wrote:
> >> From: Andrew Lunn <andrew@lunn.ch>
> >> Date: Thu, 24 Sep 2015 23:57:31 +0200
> >> 
> >> > I built the FEC driver as a module, and it won't unload:
> >> > 
> >> >  kernel:unregister_netdevice: waiting for eth1 to become free. Usage count = 1
> >> > unregister_netdevice: waiting for eth1 to become free. Usage count = 1
> >> > 
> >> > i assume because DSA holds a reference. I've not tried a fully module
> >> > build, DSA has issues with that.
> >> > 
> >> > Tested-by: Andrew Lunn <andrew@lunn.ch>
> >> 
> >> So, is this a regression?
> > 
> > Sorry, worded that badly. Since DSA is still active, it should not be
> > possible to unload the FEC driver. DSA should have a reference to it,
> > and mdio-mux also should have a reference to the mdio bus of the FEC
> > driver.
> > 
> > As Russell requested, i will re-test without his patches, just to make
> > sure.
> 
> Something needs to hold into the underlying device refcount of a DSA
> blob so that an unload can't even be attempted in that state.

Holding a reference on a struct device does _not_ stop the device
being unbound or the module driving it being removed.  It merely
stops the struct device from being freed before all references have
been dropped.

Devices are always free to be unbound from their bound drivers
irrespective of the struct device refcount.  Even taking a reference
on the module (via try_module_get()) does not stop this.

-- 
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-09-24 21:20 +0200
  Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes Andrew Lunn <andrew@lunn.ch> - 2015-09-25 00:10 +0200
    Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes David Miller <davem@davemloft.net> - 2015-09-25 00:20 +0200
      Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes Andrew Lunn <andrew@lunn.ch> - 2015-09-25 00:40 +0200
        Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes David Miller <davem@davemloft.net> - 2015-09-25 01:00 +0200
          Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-09-25 01:20 +0200
    Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-09-25 00:20 +0200
      Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes Andrew Lunn <andrew@lunn.ch> - 2015-09-25 01:00 +0200
        Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-09-25 01:40 +0200
  Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes Florian Fainelli <f.fainelli@gmail.com> - 2015-09-25 03:50 +0200
    Re: [PATCH v3 0/9] Phy, mdiobus, and netdev struct device fixes David Miller <davem@davemloft.net> - 2015-09-25 08:10 +0200

csiph-web