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:	Mon, 9 Sep 2013 09:17:35 -0700
From:	Guenter Roeck <linux@...ck-us.net>
To:	Mark Brown <broonie@...nel.org>
Cc:	Wei Ni <wni@...dia.com>, khali@...ux-fr.org, swarren@...dotorg.org,
	lm-sensors@...sensors.org, linux-tegra@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/2] hwmon: (lm90) Add power control

On Mon, Sep 09, 2013 at 05:02:37PM +0100, Mark Brown wrote:
> On Mon, Sep 09, 2013 at 08:50:43AM -0700, Guenter Roeck wrote:
> > On Mon, Sep 09, 2013 at 02:50:22PM +0100, Mark Brown wrote:
> 
> > > And indeed it does this (well, it does whatever the driver says in terms
> > > of delay).  However it is possible that the lm90 needs this time for
> > > itself - if it's doing some sort of initialisation or callibration
> > > sequence then that'll happen after the supplies come up.  25ms did seem
> > > rather long, especially for such simple devices, but it's not beyond the
> > > bounds of possibility.
> 
> > Even then it would be unreasonable to enforce such a delay for every instance
> > of this driver, even if the regulator is a dummy one and/or has been enabled
> > already. Many if not almost all users of the driver work just fine as-is,
> > without additional enforced delay (and, for that matter, without regulator ;).
> 
> > If there is a delay, it would have to be optional: Only wait if the regulator
> > was really turned on by the call and not already active. I don't know if the
> > regulator subsystem has this capability; if not, maybe it should.
> 
> It does, though it gets complicated trying to use it for a case like
> this since you can't really tell if the regulator was powered on
> immediately before the device got probed by another device on the bus.
> 
Why not ? Just keep a timestamp.

> > On a higher level, I wonder if such functionality should be added in the i2c
> > subsystem and not in i2c client drivers. Has anyone thought about this ?
> 
> I'm not sure what the subsystem would do for such delays?  It's fairly
> common for things that need this to also want to do things like
> manipulate GPIOs as part of the power on sequence so the applicability
> is relatively limited, plus it's not even I2C specific, the same applies
> to other buses so it ought to be a driver core thing.
> 
Possibly. I just thought about i2c since it also takes care of basic
devicetree bindings. Something along the line of
	if devicetree bindings for this device declare one or more
	regulators, enable those regulators before calling the driver
	probe function.

That was not intended to solve the delay problem, though. The delay problem
seems to be more of a generic regulator problem and, as I suggested, should
be solved in the regulator subsystem.
	if the regulator is enabled and the device specifies a poweron delay,
	wait for the specified amount of time after (and only after) enabling
	the regulator.

> There was some work on a generic helper for power on sequences but it
> stalled since it wasn't accepted for the original purpose (LCD panel
> power ons IIRC).

Too bad. I think it could be kept quite simple, though, by handling it
through the regulator subsystem as suggested above. A generic binding
for a per-regulator and per-device poweron delay should solve that
and possibly even make it transparent to the actual driver code.

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