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: <548521D1.2060509@rock-chips.com>
Date:	Mon, 08 Dec 2014 11:58:09 +0800
From:	Yunzhi Li <lyz@...k-chips.com>
To:	Paul Zimmerman <Paul.Zimmerman@...opsys.com>,
	"heiko@...ech.de" <heiko@...ech.de>,
	"dianders@...omium.org" <dianders@...omium.org>
CC:	"olof@...om.net" <olof@...om.net>,
	"huangtao@...k-chips.com" <huangtao@...k-chips.com>,
	"ulrich.prinz@...glemail.com" <ulrich.prinz@...glemail.com>,
	"zyw@...k-chips.com" <zyw@...k-chips.com>,
	"cf@...k-chips.com" <cf@...k-chips.com>,
	"linux-rockchip@...ts.infradead.org" 
	<linux-rockchip@...ts.infradead.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 3/5] usb: dwc2: Add generic PHY framework support for
 dwc2 usb controler platform driver.

Hi Paul:

Thank you for replying.

On 2014/12/6 3:04, Paul Zimmerman wrote:
>> From: Yunzhi Li [mailto:lyz@...k-chips.com]
>> Sent: Friday, December 05, 2014 4:52 AM
>>
>> Get PHY parameters from devicetree and power off usb PHY during
>> system suspend.
>>
>> Signed-off-by: Yunzhi Li <lyz@...k-chips.com>
>> ---
>>
>>   drivers/usb/dwc2/gadget.c   | 33 ++++++++++++---------------------
>>   drivers/usb/dwc2/platform.c | 34 ++++++++++++++++++++++++++++++++++
>>   2 files changed, 46 insertions(+), 21 deletions(-)
>>
>> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
>> index 200168e..2601c61 100644
>> --- a/drivers/usb/dwc2/gadget.c
>> +++ b/drivers/usb/dwc2/gadget.c
>> [...]
>>
>>   	/*
>> -	 * Attempt to find a generic PHY, then look for an old style
>> -	 * USB PHY, finally fall back to pdata
>> +	 * If platform probe couldn't find a generic PHY or an old style
>> +	 * USB PHY, fall back to pdata
>>   	 */
>> -	phy = devm_phy_get(dev, "usb2-phy");
>> -	if (IS_ERR(phy)) {
>> -		uphy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
>> -		if (IS_ERR(uphy)) {
>> -			/* Fallback for pdata */
>> -			plat = dev_get_platdata(dev);
>> -			if (!plat) {
>> -				dev_err(dev,
>> -				"no platform data or transceiver defined\n");
>> -				return -EPROBE_DEFER;
>> -			}
>> -			hsotg->plat = plat;
>> -		} else
>> -			hsotg->uphy = uphy;
>> -	} else {
>> -		hsotg->phy = phy;
>> +	if (IS_ERR_OR_NULL(hsotg->phy) && IS_ERR_OR_NULL(hsotg->uphy)) {
>> +		plat = dev_get_platdata(dev);
>> +		if (!plat) {
>> +			dev_err(dev,
>> +			"no platform data or transceiver defined\n");
>> +			return -EPROBE_DEFER;
>> +		}
>> +		hsotg->plat = plat;
>> +	} else if (hsotg->phy) {
> You have changed the behavior here. Previously, the driver would work
> even if there were no phys or pdata defined. Now it will return
> -EPROBE_DEFER instead. Are you sure that won't break any existing
> platforms?
>
I don't really catch your meaning. Could you please point out where is 
the difference? Thanks .

In previous version, if there were no phy or usb_phy defined, 
devm_phy_get() and devm_usb_get_phy() both failed, then driver falls 
back to find pdata, if no pdata defined dev_get_platdata() returns NULL, 
then dwc2_gadget_init returns -EPROBE_DEFER and the dwc2_driver_probe 
fail. So I think, for the dwc2 driver without my patch, when 
CONFIG_USB_DWC2_PERIPHERAL or CONFIG_USB_DWC2_DUAL_ROLE selected, if 
there were no phys or pdata defined, the driver probe will also return 
-EPROBE_DEFER. And when only CONFIG_USB_DWC2_HOST selected, the previous 
version driver didn't care any thing about phy, in my patch it will try 
to find a phy when platform driver probe, but do not fail probe if there 
isn't a phy node.


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