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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 07 May 2014 18:01:51 +0200
From:	Daniel Mack <zonque@...il.com>
To:	Florian Fainelli <f.fainelli@...il.com>
CC:	David Miller <davem@...emloft.net>,
	netdev <netdev@...r.kernel.org>,
	Grant Likely <grant.likely@...aro.org>,
	Rob Herring <robh+dt@...nel.org>,
	Mugunthan V N <mugunthanvnm@...com>
Subject: Re: [PATCH] net: mdio: of_mdio: check for already registered phy
 before creating new instances

(+ Mugunthan V N)

Hi Florian,

On 05/07/2014 02:55 AM, Florian Fainelli wrote:
> 2014-05-06 8:21 GMT-07:00 Daniel Mack <zonque@...il.com>:
>> In of_mdiobus_register_phy(), check if the phy with the given address is
>> already registered within the mii bus before calling phy_device_create()
>> or get_phy_device().
> 
> I am not exactly sure how you could be in that sort of situation.
> of_mdiobus_register() handles two different cases at the moment:
> 
> 1) PHY child nodes have a valid 'reg' property, and this property is
> used to register the PHY at the given address
> 2) if a PHY child node does not have a valid 'reg' property, which
> will trigger an auto-scan and then we iterate through all 32 addresses
> of the bus, we skip over PHYs that are already registered
> 
>>
>> This allows us to augment auto-probed phy devices with extra information
>> via DT. Without this patch, a second instance of the phydev is created
>> unnecessarily.
> 
> Which piece of code is doing the auto-probing in your case? One of the
> very first things that of_mdiobus_register() does is set the PHY mask
> to 0xffffffff to prevent the default PHY probing method to trigger,
> since we are using information from the Device Tree right after that.

Ah, ok. So what happens here is that of_mdiobus_register() sets the
phy_mask to ~0, but mdiobus_register() calls bus->reset(), which resets
the mask to ffffffef in my case. bus->reset is davinci_mdio_reset() in
my case.

Is the davinci mdio driver doing anything wrong by touching
bus->phy_mask? Another solution would be to split mdiobus_register() and
create a mdiobus_register_noscan() or something, and then call that from
of_mdiobus_register().


Thanks,
Daniel

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