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: <52CBFAC0.9040103@ti.com>
Date:	Tue, 7 Jan 2014 18:31:52 +0530
From:	Kishon Vijay Abraham I <kishon@...com>
To:	Heikki Krogerus <heikki.krogerus@...ux.intel.com>
CC:	<linux-omap@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>,
	<linux-samsung-soc@...r.kernel.org>,
	Tony Lindgren <tony@...mide.com>
Subject: Re: [PATCH 4/5] arm: omap3: twl: use the new lookup method with usb
 phy

Hi,

On Monday 16 December 2013 08:13 PM, Heikki Krogerus wrote:
> Hi,
> 
> On Mon, Dec 16, 2013 at 04:34:35PM +0530, Kishon Vijay Abraham I wrote:
>> On Monday 09 December 2013 08:38 PM, Heikki Krogerus wrote:
>>> Provide a complete association for the phy and it's user
>>> (musb) with the new phy_lookup_table.
>>>
>>> Signed-off-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
>>> ---
>>>  arch/arm/mach-omap2/twl-common.c | 15 ++++++---------
>>>  1 file changed, 6 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
>>> index b0d54da..972430b 100644
>>> --- a/arch/arm/mach-omap2/twl-common.c
>>> +++ b/arch/arm/mach-omap2/twl-common.c
>>> @@ -91,18 +91,13 @@ void __init omap_pmic_late_init(void)
>>>  }
>>>  
>>>  #if defined(CONFIG_ARCH_OMAP3)
>>> -struct phy_consumer consumers[] = {
>>> -	PHY_CONSUMER("musb-hdrc.0", "usb"),
>>> -};
>>> -
>>> -struct phy_init_data init_data = {
>>> -	.consumers = consumers,
>>> -	.num_consumers = ARRAY_SIZE(consumers),
>>> +static struct phy_lookup_table twl4030_usb_lookup = {
>>> +	.dev_id = "musb-hdrc.0",
>>> +	.table = PHY_LOOKUP("phy-twl4030_usb.0", NULL),
>>>  };
>>
>> had a similar approach during the initial version of phy framework [1] (see
>> phy_bind) but changed it later [2] . Here you should know the device names of
>> two devices and even if one of them started using DEVID_AUTO, it'll start
>> breaking. Such an approach needs to reviewed carefully.
> 
> If somebody creates a regression by changing something like the
> platform device id without checking all the users, he deserves to get
> into big trouble. I don't see why an individual framework should
> provide protection against such cases.
> 
> In any case, having two device names to deal with does not add any
> more risk. These associations should always be made in the place where
> the phy device is created so you will always know it's device name.

huh.. we should also know the 'controller' device name while defining these
associations and in some cases the controller device and phy device are created
in entirely different places.
> Normally the platform code creates these associations in the same
> place it creates the platform devices, so you definitely know what the
> device names will be.
> 
> In this case it's actually created in drivers/mfd/twl-core.c, so I do
> need to update this and move the lookup table there. We can still
> deliver the user name as platform data, though I believe it's always
> "musb". Maybe we could actually skip that and just hard code the name?

I would rather leave the way it is modelled now.

Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ