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:	Thu, 20 Dec 2012 09:51:53 -0800
From:	Doug Anderson <dianders@...omium.org>
To:	Vivek Gautam <gautamvivek1987@...il.com>
Cc:	Vivek Gautam <gautam.vivek@...sung.com>, linux-usb@...r.kernel.org,
	yulgon.kim@...sung.com, linux-samsung-soc@...r.kernel.org,
	Praveen Paneri <p.paneri@...sung.com>,
	gregkh@...uxfoundation.org, devicetree-discuss@...ts.ozlabs.org,
	jg1.han@...sung.com,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	balbi@...com, kishon@...com, Kukjin Kim <kgene.kim@...sung.com>,
	Alan Stern <stern@...land.harvard.edu>,
	Rob Herring <rob.herring@...xeda.com>,
	Sylwester Nawrocki <sylvester.nawrocki@...il.com>
Subject: Re: [PATCH v5 3/4] USB: ehci-s5p: Add phy driver support

On Wed, Dec 19, 2012 at 10:37 PM, Vivek Gautam
<gautamvivek1987@...il.com> wrote:
>
> On Thu, Dec 20, 2012 at 5:00 AM, Doug Anderson <dianders@...omium.org> wrote:
>>
>> On Tue, Dec 18, 2012 at 6:43 AM, Vivek Gautam <gautam.vivek@...sung.com> wrote:
>>> +static void s5p_ehci_phy_enable(struct s5p_ehci_hcd *s5p_ehci)
>>> +{
>>> +       struct platform_device *pdev = to_platform_device(s5p_ehci->dev);
>>> +
>>> +       if (s5p_ehci->phy) {
>>> +               samsung_usbphy_set_type(s5p_ehci->phy, USB_PHY_TYPE_HOST);
>>
>> This confuses me.  Why are you setting the type to host here?
>>
> Being in host controller, before calling usb_phy_init() we set type to
> Host since, with certain SOCs
> like 4210, same register has different bit settings for HOST type and
> device type. So setting this
> to Host type here make the flow of usb_phy_init to go in the direction of Host.

OK.  I think I need to study the code more...

>>>
>>> +       phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
>>> +       if (IS_ERR_OR_NULL(phy)) {
>>> +               /* Fallback to pdata */
>>> +               if (!pdata) {
>>> +                       dev_err(&pdev->dev, "no platform data or transceiver defined\n");
>>> +                       return -EPROBE_DEFER;
>>
>> Shouldn't you return -EINVAL like the old code did?
>
> We are deferring the probe since the usb-phy transceiver may get
> probed after ehci/ohci controllers.
> And if we return -EINVAL like the previous code, we would end up not
> setting the phy.

OK.  Something is wrong here then, since this really isn't an error:
* It should be commented about why you're deferring.
* You shouldn't have a dev_err for something that's not fatal.

Ideally we'd want something that would force probing to happen in the
right order.  I spent a little time looking and didn't see anything,
but maybe I'm missing something obvious.  If nothing pops out, the
defer seems OK as long as it is commented well.
--
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