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: <20160427182516.36bd5fb5@xhacker>
Date:	Wed, 27 Apr 2016 18:25:16 +0800
From:	Jisheng Zhang <jszhang@...vell.com>
To:	Mark Brown <broonie@...nel.org>
CC:	Felipe Balbi <felipe.balbi@...ux.intel.com>,
	<mathias.nyman@...ux.intel.com>, <gregkh@...uxfoundation.org>,
	<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>,
	<yendapally.reddy@...adcom.com>
Subject: Re: [RESEND PATCH v2 7/7] usb: xhci: plat: add vbus regulator
 control

Dear Mark,

On Wed, 27 Apr 2016 10:57:39 +0100 Mark Brown wrote:

> On Wed, Apr 27, 2016 at 08:37:20AM +0300, Felipe Balbi wrote:
> > Jisheng Zhang <jszhang@...vell.com> writes:  
> 
> > > +	vbus = devm_regulator_get(&pdev->dev, "vbus");  
> 
> > devm_regulator_get_optional() ??  
> 
> Does USB work without a VBUS?  Unless the answer is yes then I'd expect
> this to be just a normal regulator_get().

Per spec no. But the vbus may be transparent to SW on some platforms, so I
think devm_regulator_get_optional() is better.

> 
> >   
> > > +	if (PTR_ERR(vbus) == -ENODEV) {
> > > +		vbus = NULL;
> > > +	} else if (IS_ERR(vbus)) {
> > > +		ret = PTR_ERR(vbus);
> > > +		goto disable_clk;
> > > +	} else if (vbus) {
> > > +		ret = regulator_enable(vbus);
> > > +		if (ret) {
> > > +			dev_err(&pdev->dev,
> > > +				"failed to enable usb vbus regulator: %d\n",
> > > +				ret);
> > > +			goto disable_clk;
> > > +		}
> > > +	}  
> 
> This is all completely broken unless the supply is optional.

The supply is optional.

Thanks for your review,
Jisheng

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ