<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/power, branch v4.19.112</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.112</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.112'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-02-11T12:34:02+00:00</updated>
<entry>
<title>power: supply: ltc2941-battery-gauge: fix use-after-free</title>
<updated>2020-02-11T12:34:02+00:00</updated>
<author>
<name>Sven Van Asbroeck</name>
<email>thesven73@gmail.com</email>
</author>
<published>2019-09-19T15:11:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d12fbc55c1e9d293cdb73695377b7cd6421ca7d6'/>
<id>urn:sha1:d12fbc55c1e9d293cdb73695377b7cd6421ca7d6</id>
<content type='text'>
commit a60ec78d306c6548d4adbc7918b587a723c555cc upstream.

This driver's remove path calls cancel_delayed_work().
However, that function does not wait until the work function
finishes. This could mean that the work function is still
running after the driver's remove function has finished,
which would result in a use-after-free.

Fix by calling cancel_delayed_work_sync(), which ensures that
that the work is properly cancelled, no longer running, and
unable to re-schedule itself.

This issue was detected with the help of Coccinelle.

Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Sven Van Asbroeck &lt;TheSven73@gmail.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>power: supply: Init device wakeup after device_add()</title>
<updated>2020-01-27T13:51:08+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>swboyd@chromium.org</email>
</author>
<published>2019-08-01T21:33:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8a1327879fc76e10ccc8908a9beb2db1b905c1ad'/>
<id>urn:sha1:8a1327879fc76e10ccc8908a9beb2db1b905c1ad</id>
<content type='text'>
[ Upstream commit 8288022284859acbcc3cf1a073a1e2692d6c2543 ]

We may want to use the device pointer in device_init_wakeup() with
functions that expect the device to already be added with device_add().
For example, if we were to link the device initializing wakeup to
something in sysfs such as a class for wakeups we'll run into an error.
It looks like this code was written with the assumption that the device
would be added before initializing wakeup due to the order of operations
in power_supply_unregister().

Let's change the order of operations so we don't run into problems here.

Fixes: 948dcf966228 ("power_supply: Prevent suspend until power supply events are processed")
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Tri Vo &lt;trong@android.com&gt;
Cc: Kalesh Singh &lt;kaleshsingh@google.com&gt;
Cc: Ravi Chandra Sadineni &lt;ravisadineni@chromium.org&gt;
Cc: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: supply: cpcap-battery: Fix signed counter sample register</title>
<updated>2019-12-17T19:35:37+00:00</updated>
<author>
<name>Tony Lindgren</name>
<email>tony@atomide.com</email>
</author>
<published>2019-04-07T18:12:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=52600d00af628c0d14a4ed9ccf7fc1dba38a666e'/>
<id>urn:sha1:52600d00af628c0d14a4ed9ccf7fc1dba38a666e</id>
<content type='text'>
[ Upstream commit c68b901ac4fa969db8917b6a9f9b40524a690d20 ]

The accumulator sample register is signed 32-bits wide register on
droid 4. And only the earlier version of cpcap has a signed 24-bits
wide register. We're currently passing it around as unsigned, so
let's fix that and use sign_extend32() for the earlier revision.

Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>PM / AVS: SmartReflex: NULL check before some freeing functions is not needed</title>
<updated>2019-12-05T08:20:02+00:00</updated>
<author>
<name>Thomas Meyer</name>
<email>thomas@m3y3r.de</email>
</author>
<published>2018-12-02T20:52:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4d54a79695246ef5c40bd0ab4bd0ff00ae8f7927'/>
<id>urn:sha1:4d54a79695246ef5c40bd0ab4bd0ff00ae8f7927</id>
<content type='text'>
[ Upstream commit 14d338a857f05f894ba3badd9e6d3039c68b8180 ]

NULL check before some freeing functions is not needed.

Signed-off-by: Thomas Meyer &lt;thomas@m3y3r.de&gt;
Reviewed-by: Kevin Hilman &lt;khilman@baylibre.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: supply: twl4030_charger: disable eoc interrupt on linear charge</title>
<updated>2019-11-20T17:47:01+00:00</updated>
<author>
<name>Andreas Kemnade</name>
<email>andreas@kemnade.info</email>
</author>
<published>2018-09-17T05:00:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0ede78b3576c649696f1fec8baea478537fcc877'/>
<id>urn:sha1:0ede78b3576c649696f1fec8baea478537fcc877</id>
<content type='text'>
[ Upstream commit 079cdff3d0a09c5da10ae1be35def7a116776328 ]

This avoids getting woken up from suspend after power interruptions
when the bci wrongly thinks the battery is full just because
of input current going low because of low input power

Signed-off-by: Andreas Kemnade &lt;andreas@kemnade.info&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: supply: twl4030_charger: fix charging current out-of-bounds</title>
<updated>2019-11-20T17:47:01+00:00</updated>
<author>
<name>Andreas Kemnade</name>
<email>andreas@kemnade.info</email>
</author>
<published>2018-09-17T05:20:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=773fb69e430751062015467e9f97f35158bd3bf9'/>
<id>urn:sha1:773fb69e430751062015467e9f97f35158bd3bf9</id>
<content type='text'>
[ Upstream commit 8314c212f995bc0d06b54ad02ef0ab4089781540 ]

the charging current uses unsigned int variables, if we step back
if the current is still low, we would run into negative which
means setting the target to a huge value.
Better add checks here.

Signed-off-by: Andreas Kemnade &lt;andreas@kemnade.info&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: supply: max8998-charger: Fix platform data retrieval</title>
<updated>2019-11-20T17:46:47+00:00</updated>
<author>
<name>Tomasz Figa</name>
<email>tomasz.figa@gmail.com</email>
</author>
<published>2018-07-17T16:05:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=925c19a8c6bb37f76f625c29fd7a59699dc8d1bc'/>
<id>urn:sha1:925c19a8c6bb37f76f625c29fd7a59699dc8d1bc</id>
<content type='text'>
[ Upstream commit cb90a2c6f77fe9b43d1e3f759bb2f13fe7fa1811 ]

Since the max8998 MFD driver supports instantiation by DT, platform data
retrieval is handled in MFD probe and cell drivers should get use
the pdata field of max8998_dev struct to obtain them.

Fixes: ee999fb3f17f ("mfd: max8998: Add support for Device Tree")
Signed-off-by: Tomasz Figa &lt;tomasz.figa@gmail.com&gt;
Signed-off-by: Paweł Chmiel &lt;pawel.mikolaj.chmiel@gmail.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: reset: at91-poweroff: do not procede if at91_shdwc is allocated</title>
<updated>2019-11-20T17:46:46+00:00</updated>
<author>
<name>Claudiu Beznea</name>
<email>claudiu.beznea@microchip.com</email>
</author>
<published>2018-08-30T11:50:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=82d8a34470e96e192290885ffb54422b6f42700f'/>
<id>urn:sha1:82d8a34470e96e192290885ffb54422b6f42700f</id>
<content type='text'>
[ Upstream commit 9f1e44774be578fb92776add95f1fcaf8284d692 ]

There should be only one instance of struct shdwc in the system. This is
referenced through at91_shdwc. Return in probe if at91_shdwc is already
allocated.

Signed-off-by: Claudiu Beznea &lt;claudiu.beznea@microchip.com&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@microchip.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: supply: ab8500_fg: silence uninitialized variable warnings</title>
<updated>2019-11-20T17:46:45+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2018-09-10T08:39:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1fb3d279a38471134e68dd7da647bc7eb9ae9513'/>
<id>urn:sha1:1fb3d279a38471134e68dd7da647bc7eb9ae9513</id>
<content type='text'>
[ Upstream commit 54baff8d4e5dce2cef61953b1dc22079cda1ddb1 ]

If kstrtoul() fails then we print "charge_full" when it's uninitialized.
The debug printk doesn't add anything so I deleted it and cleaned these
two functions up a bit.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>power: supply: max14656: fix potential use-after-free</title>
<updated>2019-11-06T12:05:39+00:00</updated>
<author>
<name>Sven Van Asbroeck</name>
<email>thesven73@gmail.com</email>
</author>
<published>2019-02-15T21:43:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1b6901f3c6008d2e05f0b47848b2a64bffe55942'/>
<id>urn:sha1:1b6901f3c6008d2e05f0b47848b2a64bffe55942</id>
<content type='text'>
[ Upstream commit 252fbeb86ceffa549af9842cefca2412d53a7653 ]

Explicitly cancel/sync the irq_work delayed work, otherwise
there's a chance that it will run after the device is removed,
which would result in a use-after-free.

Note that cancel/sync should happen:
- after irq's have been disabled, as the isr re-schedules the work
- before the power supply is unregistered, because the work func
    uses the power supply handle.

Cc: Alexander Kurz &lt;akurz@blala.de&gt;
Signed-off-by: Sven Van Asbroeck &lt;TheSven73@gmail.com&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
