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: <5176743A.9070201@ti.com>
Date:	Tue, 23 Apr 2013 14:44:58 +0300
From:	Taras Kondratiuk <taras@...com>
To:	Mark Brown <broonie@...nel.org>
CC:	<lgirdwood@...il.com>, <rjw@...k.pl>, <viresh.kumar@...aro.org>,
	<shawn.guo@...aro.org>, <cpufreq@...r.kernel.org>,
	<linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	Philip Rakity <prakity@...dia.com>,
	Eric Miao <eric.y.miao@...il.com>,
	"grygorii.strashko" <grygorii.strashko@...com>,
	Andrii Tseglytskyi <andrii.tseglytskyi@...com>
Subject: Re: [RFC PATCH 1/2] regulator: core: Add regulator_set_voltage_min()

On 04/23/2013 11:48 AM, Mark Brown wrote:
> On Mon, Apr 22, 2013 at 07:49:37PM +0300, Taras Kondratiuk wrote:
>
>> Yeah. Sure 4kV is not a real request, but
>> max will be limited by system constrains.
>> According to regulator_set_voltage() documentation
>> system constraints should be set before calling this function,
>> so I assume I can rely on them. No?
>> Another possible implementation is below, but prefer initial one.
> I just don't see any reason for this API.  The driver setting the
> voltage ought to have some idea of what the chip limits are too for
> safety.
Let's take an example.
One regulator supplies CPU and GPU inside of SoC.
                       +-------------+
                       | SoC         |
               VDD_CPU |    +-----+  |
             +------------->| CPU |  |
+-------+   |         |    +-----+  |
| Reg X |---+         |             |
+------ +   | VDD_GPU |    +-----+  |
             +------------->| GPU |  |
                       |    +-----+  |
                       +-------------+

GPU voltage is regulated by some devfreq driver.
CPU voltage is regulated by generic cpufreq-cpu0 driver.
Both drivers know only about their operational points.
They don't know anything about chip limits.

I see two options here:
1. Pass somehow chip limits to drivers so they can limit their request.
    Pros: No need for regulator_set_voltage_min()
    Cons: a) Need to pass info about chip limits to driver. New API?
          b) CPU and GPU may have different limits,
             so after very first request voltage may violate
             CPU or GPU range.
2. Define chip limits in Reg X constraints.
    Pros: Limits will be applied to driver's request transparently.
          No need to pass info about limits to driver.
          Limits are set before the first request, so no violation.
    Cons: regulator_set_voltage_min() is needed.

IMHO option #2 is better.
Do you see other ways?

-- 
BR
Taras Kondratiuk | GlobalLogic

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