lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 22 Jul 2014 14:31:42 -0700
From:	Florian Fainelli <f.fainelli@...il.com>
To:	Ezequiel Garcia <ezequiel.garcia@...e-electrons.com>
Cc:	netdev <netdev@...r.kernel.org>,
	David Miller <davem@...emloft.net>,
	Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
	Gregory Clement <gregory.clement@...e-electrons.com>
Subject: Re: [RFC 0/2] net: phy: Prevent an MDIO bus from being unloaded while
 in use

2014-07-21 11:55 GMT-07:00 Ezequiel Garcia <ezequiel.garcia@...e-electrons.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().

A common place that is guaranteed to be called by all
phy_{connect,attach}{,_direct} is phy_attach_direct(), presumably
right after the call to device_bind_driver for instance?

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

Ah, indeed, I guess a coccinelle spatch could clean up this redundant
assignment for a bunch of drivers then.

>
> /*
>  * 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



-- 
Florian
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ