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]
Message-ID: <5123A32D.4030005@pengutronix.de>
Date:	Tue, 19 Feb 2013 17:07:09 +0100
From:	Marc Kleine-Budde <mkl@...gutronix.de>
To:	balbi@...com
CC:	Arnd Bergmann <arnd@...db.de>, linux-usb@...r.kernel.org,
	linux@....linux.org.uk, mchehab@...hat.com, davem@...emloft.net,
	tony@...mide.com, gregkh@...uxfoundation.org,
	broonie@...nsource.wolfsonmicro.com, linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org, kishon <kishon@...com>,
	eballetbo@...il.com, santosh.shilimkar@...com,
	linux-arm-kernel@...ts.infradead.org, rob@...dley.net,
	netdev@...r.kernel.org, swarren@...dia.com, javier@...hile0.org,
	linux-omap@...r.kernel.org, akpm@...ux-foundation.org,
	cesarb@...arb.net
Subject: Re: [PATCH v2 0/5] Generic PHY Framework

On 02/19/2013 04:05 PM, Felipe Balbi wrote:
> Hi,
> 
> On Tue, Feb 19, 2013 at 02:34:40PM +0000, Arnd Bergmann wrote:
>> On Tuesday 19 February 2013, Felipe Balbi wrote:
>>> On Tue, Feb 19, 2013 at 12:33:54PM +0000, Arnd Bergmann wrote:
>>>>> Currently drivers/phy and drivers/net/phy are independent and are not 
>>>>> related to each other. There are some fundamental differences on how 
>>>>> these frameworks work. IIUC, the *net* uses bus layer (MDIO bus) to 
>>>>> match a PHY device with a PHY driver and the Ethernet device uses the 
>>>>> bus layer to get the PHY.
>>>>> The Generic PHY Framework however doesn't have any bus layer. The PHY 
>>>>> should be like any other Platform Devices and Drivers and the framework 
>>>>> will provide some APIs to register with the framework. And there are 
>>>>> other APIs which any controller can use to get the PHY (for e.g., in the 
>>>>> case of dt boot, it can use phandle to get a reference to the PHY).
>>>>
>>>> Hmm, I think the use of a bus_type for a PHY actually sounds quite
>>>> appropriate. The actual PHY device would then be a child of the
>>>
>>> really ? I'm not so sure, the *bus* used by the PHY is ULPI, UTMI,
>>> UTMI+, PIP3, I2C, etc... adding another 'fake' bus representation is a
>>> bit overkill IMO.
>>>
>>> Imagine an I2C-controlled PHY driver like isp1301, that driver will have
>>> to register i2c_driver and phy_driver, which looks weird to me. If the
>>> only substitute for class is a bus, we can't drop classes just yet, I'm
>>> afraid.
>>>
>>> Imagine a regulator bus, a pwm bus, an LED bus etc. They don't make
>>> sense IMHO.
>>
>> It's a fine line, but I think a phy is something that resembles a device
>> more than an LED does. When I read patch 1, I also noticed and commented
>> on the fact that it does use a 'class'. Now, according to Greg, we should
>> use 'bus_type' instead of 'class' in new code. I originally disagreed with
>> that concept, but he's the boss here and it's good if he has a vision
>> how things should be lined out.
>>
>> In practice, there is little difference between a 'bus_type' and a 'class',
>> so just replace any instance of the former with the latter in your head
>> when reading the code ;-)
> 
> it's not so simple :-) if we must use bus_type we need to introduce all
> the device/driver matching mechanism which isn't necessary with a class.

You have the code for phy <-> device matching in your framework anyway.
Using the bus infrastructure brings changes the open coded matching into
bus callbacks.

regards,
Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


Download attachment "signature.asc" of type "application/pgp-signature" (264 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ