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-next>] [day] [month] [year] [list]
Message-ID: <CEE6BB42CAD6E947908279175AF8470A025A8A54F4@EXDCVYMBSTM006.EQ1STM.local>
Date:	Wed, 2 Jun 2010 11:18:00 +0200
From:	Linus WALLEIJ <linus.walleij@...ricsson.com>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Cc:	Bengt JONSSON <bengt.g.jonsson@...ricsson.com>,
	Sundar R IYER <sundar.iyer@...ricsson.com>
Subject: RFC: Regulator Framework Voltage Setting

Hello,

we have a question regarding the regulator_set_voltage function in the 
regulator framework (drivers/regulator/core.c). The current 
implementation checks the input min and max arguments against the 
constraints and then calls the driver set_voltage operation directly 
without checking the other consumer requests.

In our view it should respect all consumer voltage settings. Then, the 
implementation would (roughly) be to iterate through all consumers and 
make sure all of their latest requests are satisfied.

Our questions:
- Is this the correct interpretation of the current functionality?
- Is the proposed behaviour what you would expect?
- Any other problems to consider?

Below we have given an example to clarify.

Best regards,

Bengt JONSSON
Sundar R IYER
Linus WALLEIJ



Here is an example with three users (consumers) connected to the same 
regulator_dev:

rdev ------ xreg (User X)
        |--- yreg (User Y)
        |--- zreg (User Z)

The users call the regulator framework like this:

1. User X calls regulator_set_voltage(xreg, 2000000, 3000000)
2. User Y calls regulator_set_voltage(yreg, 2100000, 3100000)
3. User Z calls regulator_set_voltage(zreg, 1900000, 2900000)
4. User Y calls regulator_set_voltage(yreg, 1900000, 3100000)
5. User Z calls regulator_set_voltage(zreg, 1900000, 3100000)
6. User X calls regulator_set_voltage(xreg, 4000000, 5000000). Here the 
call should fail.

Assuming there are no constraints, with current implementation, the 
requests would be sent unchanged to the driver. What we would expect 
from the regulator framework is this:

1. The framework calls rdev->desc->ops->set_voltage(rdev, 2000000, 3000000)
2. The framework calls rdev->desc->ops->set_voltage(rdev, 2100000, 3000000)
3. The framework calls rdev->desc->ops->set_voltage(rdev, 2100000, 2900000)
4. The framework calls rdev->desc->ops->set_voltage(rdev, 2000000, 2900000)
5. The framework calls rdev->desc->ops->set_voltage(rdev, 2000000, 3000000)
6. Failed because the ranges do not overlap.


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