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:	Tue, 31 Jul 2012 17:37:07 +0900
From:	Alex Courbot <acourbot@...dia.com>
To:	Simon Glass <sjg@...omium.org>
CC:	Stephen Warren <swarren@...dia.com>,
	Thierry Reding <thierry.reding@...onic-design.de>,
	Grant Likely <grant.likely@...retlab.ca>,
	Rob Herring <rob.herring@...xeda.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	Arnd Bergmann <arnd@...db.de>,
	"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-fbdev@...r.kernel.org" <linux-fbdev@...r.kernel.org>,
	"devicetree-discuss@...ts.ozlabs.org" 
	<devicetree-discuss@...ts.ozlabs.org>
Subject: Re: [RFC][PATCH v3 1/3] runtime interpreted power sequences

Hi Simon,

On 07/30/2012 08:00 PM, Simon Glass wrote:
> For the delay, I think milliseconds is reasonable. I suppose there is
> no reasonable need for microseconds?

I don't see any need for microseconds myself - anybody sees use for 
finer-grained delays?

Btw, I noticed I was using mdelay instead of msleep - caught and fixed that.

>> +Device tree
>> +-----------
>> +All the same, power sequences can be encoded as device tree nodes. The following
>> +properties and nodes are equivalent to the platform data defined previously:
>> +
>> +               power-supply = <&mydevice_reg>;
>> +               enable-gpio = <&gpio 6 0>;
>> +
>> +               power-on-sequence {
>> +                       regulator@0 {
>> +                               id = "power";
>
> Is there a reason not to put the phandle here, like:
>
>                                     id = <&mydevice_reg>;
>
> (or maybe 'device' instead of id?)

There is one reason, but it might be a bad one. On Tegra, PWM phandle 
uses an extra cell to encode the duty-cycle the PWM should have when we 
call get_pwm(). This makes it possible to address the same PWM with 
different phandles (and different duty cycles), which causes an issue to 
know whether a PWM is already used in a sequence (potentially resulting 
in multiple get_pwm calls on the same PWM, and also opens the door to 
ambiguities in behavior (what is the correct duty-cycle to use if 
several different values are passed?)

Maybe the problem lies in how PWM phandles are handled - if duty-cycle 
was not part of the information, we would not have this problem.

>> +Note that first, the phandles of the regulator and gpio used in the sequences
>> +are defined as properties. Then the sequence references them through the id
>> +property of every step. The name of sub-properties defines the type of the step.
>> +Valid names are "regulator", "gpio" and "pwm". Steps must be numbered
>> +sequentially.
>
> For the regulator and gpio types I think you only have an enable. For
> the pwm, what is the intended binding? Is that documented elsewhere?

Same thing, enable/disable which would call pwm_enable and pwm_disable. 
One could also image an additional property to set the duty cycle if it 
can be taken off the phandle.

> Also it might be worth mentioning how you get a struct power_seq from
> an fdt node, and perhaps given an example of a device which has an
> attached node, so we can see how it is referenced from the device
> (of_parse_power_seq I think). Do put the sequence inside the device
> node or reference it with a phandle?

Yes, this definitely needs more documentation - especially the DT part.

Thanks,
Alex.

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