<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/regulator/core.c, branch linux-4.5.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>Merge remote-tracking branches 'regulator/topic/lp8788', 'regulator/topic/mt6311', 'regulator/topic/optional', 'regulator/topic/palmas' and 'regulator/topic/pv88060' into regulator-next</title>
<updated>2016-01-12T18:26:07+00:00</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2016-01-12T18:26:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3fbd90bf6b21453d235f533c5c5d335ecc1052eb'/>
<id>3fbd90bf6b21453d235f533c5c5d335ecc1052eb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge remote-tracking branches 'regulator/topic/const', 'regulator/topic/lm363x', 'regulator/topic/lockdep' and 'regulator/topic/lp872x' into regulator-next</title>
<updated>2016-01-12T18:26:05+00:00</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2016-01-12T18:26:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8bd31df8de3351465c5d202d1a6f0da5834726b9'/>
<id>8bd31df8de3351465c5d202d1a6f0da5834726b9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'regulator/topic/core' into regulator-next</title>
<updated>2016-01-12T18:26:05+00:00</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2016-01-12T18:26:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9fa295742d4f3064b1faf8fbbbcba21969ec9df6'/>
<id>9fa295742d4f3064b1faf8fbbbcba21969ec9df6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>regulator: core: remove some dead code</title>
<updated>2016-01-07T15:41:02+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2016-01-07T10:03:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=70dc6daff090afaab588e800fca3db59bfac694e'/>
<id>70dc6daff090afaab588e800fca3db59bfac694e</id>
<content type='text'>
Originally queue_delayed_work() used to negative error codes or 0 and 1
on success depending if the work was queued or not.  It caused a lot of
bugs where people treated all non-zero returns as failures so we changed
it to return bool instead in d4283e937861 ('workqueue: make queueing
functions return bool').  Now it never returns failure.

Checking for negative values causes a static checker warning since it is
impossible based on the bool type.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Originally queue_delayed_work() used to negative error codes or 0 and 1
on success depending if the work was queued or not.  It caused a lot of
bugs where people treated all non-zero returns as failures so we changed
it to return bool instead in d4283e937861 ('workqueue: make queueing
functions return bool').  Now it never returns failure.

Checking for negative values causes a static checker warning since it is
impossible based on the bool type.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regulator: core: use dev_to_rdev</title>
<updated>2016-01-05T14:20:50+00:00</updated>
<author>
<name>Geliang Tang</name>
<email>geliangtang@163.com</email>
</author>
<published>2016-01-05T14:07:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=83080a140874b6860b5191b375cfdad267eaa107'/>
<id>83080a140874b6860b5191b375cfdad267eaa107</id>
<content type='text'>
Use dev_to_rdev() instead of open-coding it.

Signed-off-by: Geliang Tang &lt;geliangtang@163.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use dev_to_rdev() instead of open-coding it.

Signed-off-by: Geliang Tang &lt;geliangtang@163.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regulator: core: Fix nested locking of supplies</title>
<updated>2015-12-02T17:22:10+00:00</updated>
<author>
<name>Thierry Reding</name>
<email>treding@nvidia.com</email>
</author>
<published>2015-12-02T15:54:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=70a7fb80e85ae7f78f8e90cec3fbd862ea6a4d4b'/>
<id>70a7fb80e85ae7f78f8e90cec3fbd862ea6a4d4b</id>
<content type='text'>
Commit fa731ac7ea04 ("regulator: core: avoid unused variable warning")
introduced a subtle change in how supplies are locked. Where previously
code was always locking the regulator of the current iteration, the new
implementation only locks the regulator if it has a supply. For any
given power tree that means that the root will never get locked.

On the other hand the regulator_unlock_supply() will still release all
the locks, which in turn causes the lock debugging code to warn about a
mutex being unlocked which wasn't locked.

Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: Fixes: fa731ac7ea04 ("regulator: core: avoid unused variable warning")
Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit fa731ac7ea04 ("regulator: core: avoid unused variable warning")
introduced a subtle change in how supplies are locked. Where previously
code was always locking the regulator of the current iteration, the new
implementation only locks the regulator if it has a supply. For any
given power tree that means that the root will never get locked.

On the other hand the regulator_unlock_supply() will still release all
the locks, which in turn causes the lock debugging code to warn about a
mutex being unlocked which wasn't locked.

Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: Fixes: fa731ac7ea04 ("regulator: core: avoid unused variable warning")
Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regulator: core: Ensure we lock all regulators</title>
<updated>2015-12-02T17:20:33+00:00</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2015-12-01T15:51:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=49a6bb7a1c0963f260e4b0dcc2c0e56ec65a28b2'/>
<id>49a6bb7a1c0963f260e4b0dcc2c0e56ec65a28b2</id>
<content type='text'>
The latest workaround for the lockdep interface's not using the second
argument of mutex_lock_nested() changed the loop missed locking the last
regulator due to a thinko with the loop termination condition exiting
one regulator too soon.

Reported-by: Tyler Baker &lt;tyler.baker@linaro.org&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The latest workaround for the lockdep interface's not using the second
argument of mutex_lock_nested() changed the loop missed locking the last
regulator due to a thinko with the loop termination condition exiting
one regulator too soon.

Reported-by: Tyler Baker &lt;tyler.baker@linaro.org&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regulator: core: fix regulator_lock_supply regression</title>
<updated>2015-11-27T16:37:04+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2015-11-27T13:46:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bb41897e38c53458a88b271f2fbcd905ee1f9584'/>
<id>bb41897e38c53458a88b271f2fbcd905ee1f9584</id>
<content type='text'>
As noticed by Geert Uytterhoeven, my patch to avoid a harmless build warning
in regulator_lock_supply() was total crap and introduced a real bug:

&gt; [ BUG: bad unlock balance detected! ]
&gt; kworker/u4:0/6 is trying to release lock (&amp;rdev-&gt;mutex) at:
&gt; [&lt;c0247b84&gt;] regulator_set_voltage+0x38/0x50

we still lock the regulator supplies, but not the actual regulators,
so we are missing a lock, and the unlock is unbalanced.

This rectifies it by first locking the regulator device itself before
using the same loop as before to lock its supplies.

Reported-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 716fec9d1965 ("[SUBMITTED] regulator: core: avoid unused variable warning")
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As noticed by Geert Uytterhoeven, my patch to avoid a harmless build warning
in regulator_lock_supply() was total crap and introduced a real bug:

&gt; [ BUG: bad unlock balance detected! ]
&gt; kworker/u4:0/6 is trying to release lock (&amp;rdev-&gt;mutex) at:
&gt; [&lt;c0247b84&gt;] regulator_set_voltage+0x38/0x50

we still lock the regulator supplies, but not the actual regulators,
so we are missing a lock, and the unlock is unbalanced.

This rectifies it by first locking the regulator device itself before
using the same loop as before to lock its supplies.

Reported-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 716fec9d1965 ("[SUBMITTED] regulator: core: avoid unused variable warning")
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regulator: core: avoid unused variable warning</title>
<updated>2015-11-20T18:04:34+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2015-11-20T14:24:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=fa731ac7ea04a7d3a5c6d2f568132478c02a83b3'/>
<id>fa731ac7ea04a7d3a5c6d2f568132478c02a83b3</id>
<content type='text'>
The second argument of the mutex_lock_nested() helper is only
evaluated if CONFIG_DEBUG_LOCK_ALLOC is set. Otherwise we
get this build warning for the new regulator_lock_supply
function:

drivers/regulator/core.c: In function 'regulator_lock_supply':
drivers/regulator/core.c:142:6: warning: unused variable 'i' [-Wunused-variable]

To avoid the warning, this restructures the code to make it
both simpler and to move the 'i++' outside of the mutex_lock_nested
call, where it is now always used and the variable is not
flagged as unused.

We had some discussion about changing mutex_lock_nested to an
inline function, which would make the code do the right thing here,
but in the end decided against it, in order to guarantee that
mutex_lock_nested() does not introduced overhead without
CONFIG_DEBUG_LOCK_ALLOC.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 9f01cd4a915 ("regulator: core: introduce function to lock regulators and its supplies")
Link: http://permalink.gmane.org/gmane.linux.kernel/2068900
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The second argument of the mutex_lock_nested() helper is only
evaluated if CONFIG_DEBUG_LOCK_ALLOC is set. Otherwise we
get this build warning for the new regulator_lock_supply
function:

drivers/regulator/core.c: In function 'regulator_lock_supply':
drivers/regulator/core.c:142:6: warning: unused variable 'i' [-Wunused-variable]

To avoid the warning, this restructures the code to make it
both simpler and to move the 'i++' outside of the mutex_lock_nested
call, where it is now always used and the variable is not
flagged as unused.

We had some discussion about changing mutex_lock_nested to an
inline function, which would make the code do the right thing here,
but in the end decided against it, in order to guarantee that
mutex_lock_nested() does not introduced overhead without
CONFIG_DEBUG_LOCK_ALLOC.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 9f01cd4a915 ("regulator: core: introduce function to lock regulators and its supplies")
Link: http://permalink.gmane.org/gmane.linux.kernel/2068900
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>regulator: Make bulk API support optional supplies</title>
<updated>2015-11-17T18:54:07+00:00</updated>
<author>
<name>Bjorn Andersson</name>
<email>bjorn.andersson@sonymobile.com</email>
</author>
<published>2015-11-10T06:20:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3ff3f518a135fa4592fe2817e9ac2cce1fa23dc2'/>
<id>3ff3f518a135fa4592fe2817e9ac2cce1fa23dc2</id>
<content type='text'>
Make it possible to use the bulk API with optional supplies, by allowing
the consumer to marking supplies as optional in the regulator_bulk_data.

Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@sonymobile.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make it possible to use the bulk API with optional supplies, by allowing
the consumer to marking supplies as optional in the regulator_bulk_data.

Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@sonymobile.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
