<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/power, branch v5.15.7</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.7</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.7'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-11-18T18:16:58+00:00</updated>
<entry>
<title>power: supply: bq27xxx: Fix kernel crash on IRQ handler register error</title>
<updated>2021-11-18T18:16:58+00:00</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2021-10-31T15:25:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3f49a9d356bdb741fbabf4ac0f6a341e0bdc3fd7'/>
<id>urn:sha1:3f49a9d356bdb741fbabf4ac0f6a341e0bdc3fd7</id>
<content type='text'>
[ Upstream commit cdf10ffe8f626d8a2edc354abf063df0078b2d71 ]

When registering the IRQ handler fails, do not just return the error code,
this will free the devm_kzalloc()-ed data struct while leaving the queued
work queued and the registered power_supply registered with both of them
now pointing to free-ed memory, resulting in various kernel crashes
soon afterwards.

Instead properly tear-down things on IRQ handler register errors.

Fixes: 703df6c09795 ("power: bq27xxx_battery: Reorganize I2C into a module")
Cc: Andrew F. Davis &lt;afd@ti.com&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@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: supply: max17040: fix null-ptr-deref in max17040_probe()</title>
<updated>2021-11-18T18:16:52+00:00</updated>
<author>
<name>Yang Yingliang</name>
<email>yangyingliang@huawei.com</email>
</author>
<published>2021-10-08T06:31:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=40f7932e8ca4190dfb00e0a7460c8f75155ad27f'/>
<id>urn:sha1:40f7932e8ca4190dfb00e0a7460c8f75155ad27f</id>
<content type='text'>
[ Upstream commit 1d422ecfc48ee683ae1ccc9217764f6310c0ffce ]

Add check the return value of devm_regmap_init_i2c(), otherwise
later access may cause null-ptr-deref as follows:

KASAN: null-ptr-deref in range [0x0000000000000360-0x0000000000000367]
RIP: 0010:regmap_read+0x33/0x170
Call Trace:
  max17040_probe+0x61b/0xff0 [max17040_battery]
 ? write_comp_data+0x2a/0x90
 ? max17040_set_property+0x1d0/0x1d0 [max17040_battery]
 ? tracer_hardirqs_on+0x33/0x520
 ? __sanitizer_cov_trace_pc+0x1d/0x50
 ? _raw_spin_unlock_irqrestore+0x4b/0x60
 ? trace_hardirqs_on+0x63/0x2d0
 ? write_comp_data+0x2a/0x90
 ? __sanitizer_cov_trace_pc+0x1d/0x50
 ? max17040_set_property+0x1d0/0x1d0 [max17040_battery]
 i2c_device_probe+0xa31/0xbe0

Fixes: 6455a8a84bdf ("power: supply: max17040: Use regmap i2c")
Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Yang Yingliang &lt;yangyingliang@huawei.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.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: rt5033_battery: Change voltage values to µV</title>
<updated>2021-11-18T18:16:51+00:00</updated>
<author>
<name>Jakob Hauser</name>
<email>jahau@rocketmail.com</email>
</author>
<published>2021-10-08T08:32:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2225dade4147a3ee1b3e68e1026bec4d447425fa'/>
<id>urn:sha1:2225dade4147a3ee1b3e68e1026bec4d447425fa</id>
<content type='text'>
[ Upstream commit bf895295e9a73411889816f1a0c1f4f1a2d9c678 ]

Currently the rt5033_battery driver provides voltage values in mV. It
should be µV as stated in Documentation/power/power_supply_class.rst.

Fixes: b847dd96e659 ("power: rt5033_battery: Add RT5033 Fuel gauge device driver")
Cc: Beomho Seo &lt;beomho.seo@samsung.com&gt;
Cc: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: Jakob Hauser &lt;jahau@rocketmail.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-reset: check properly the return value of devm_of_iomap</title>
<updated>2021-11-18T18:16:49+00:00</updated>
<author>
<name>Claudiu Beznea</name>
<email>claudiu.beznea@microchip.com</email>
</author>
<published>2021-09-30T10:09:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a1e06f92b2dbc1898b127e867f4e715d85ba46ed'/>
<id>urn:sha1:a1e06f92b2dbc1898b127e867f4e715d85ba46ed</id>
<content type='text'>
[ Upstream commit f558c8072c3461b65c12c0068b108f78cebc8246 ]

devm_of_iomap() returns error code or valid pointer. Check its return
value with IS_ERR().

Fixes: bd3127733f2c ("power: reset: at91-reset: use devm_of_iomap")
Reported-by: Cristian Birsan &lt;cristian.birsan@microchip.com&gt;
Signed-off-by: Claudiu Beznea &lt;claudiu.beznea@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: max17042_battery: Clear status bits in interrupt handler</title>
<updated>2021-11-18T18:16:08+00:00</updated>
<author>
<name>Sebastian Krzyszkowiak</name>
<email>sebastian.krzyszkowiak@puri.sm</email>
</author>
<published>2021-09-14T12:18:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4c264dfbb6a453a6c837d404a5997329598786ca'/>
<id>urn:sha1:4c264dfbb6a453a6c837d404a5997329598786ca</id>
<content type='text'>
commit 0cf48167b87e388fa1268c9fe6d2443ae7f43d8a upstream.

The gauge requires us to clear the status bits manually for some alerts
to be properly dismissed. Previously the IRQ was configured to react only
on falling edge, which wasn't technically correct (the ALRT line is active
low), but it had a happy side-effect of preventing interrupt storms
on uncleared alerts from happening.

Fixes: 7fbf6b731bca ("power: supply: max17042: Do not enforce (incorrect) interrupt trigger type")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Sebastian Krzyszkowiak &lt;sebastian.krzyszkowiak@puri.sm&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.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: max17042_battery: use VFSOC for capacity when no rsns</title>
<updated>2021-11-18T18:16:02+00:00</updated>
<author>
<name>Henrik Grimler</name>
<email>henrik@grimler.se</email>
</author>
<published>2021-09-29T18:14:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4ee77bdef8e4a118184a722c695882fcd8b79903'/>
<id>urn:sha1:4ee77bdef8e4a118184a722c695882fcd8b79903</id>
<content type='text'>
commit 223a3b82834f036a62aa831f67cbf1f1d644c6e2 upstream.

On Galaxy S3 (i9300/i9305), which has the max17047 fuel gauge and no
current sense resistor (rsns), the RepSOC register does not provide an
accurate state of charge value. The reported value is wrong, and does
not change over time. VFSOC however, which uses the voltage fuel gauge
to determine the state of charge, always shows an accurate value.

For devices without current sense, VFSOC is already used for the
soc-alert (0x0003 is written to MiscCFG register), so with this change
the source of the alert and the PROP_CAPACITY value match.

Fixes: 359ab9f5b154 ("power_supply: Add MAX17042 Fuel Gauge Driver")
Cc: &lt;stable@vger.kernel.org&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Suggested-by: Wolfgang Wiedmeyer &lt;wolfgit@wiedmeyer.de&gt;
Signed-off-by: Henrik Grimler &lt;henrik@grimler.se&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.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: max17042_battery: Prevent int underflow in set_soc_threshold</title>
<updated>2021-11-18T18:16:02+00:00</updated>
<author>
<name>Sebastian Krzyszkowiak</name>
<email>sebastian.krzyszkowiak@puri.sm</email>
</author>
<published>2021-09-14T12:18:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=165ca6e8ac5bb208f8b72c4e39e0b0f5ff4d6009'/>
<id>urn:sha1:165ca6e8ac5bb208f8b72c4e39e0b0f5ff4d6009</id>
<content type='text'>
commit e660dbb68c6b3f7b9eb8b9775846a44f9798b719 upstream.

max17042_set_soc_threshold gets called with offset set to 1, which means
that minimum threshold value would underflow once SOC got down to 0,
causing invalid alerts from the gauge.

Fixes: e5f3872d2044 ("max17042: Add support for signalling change in SOC")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Sebastian Krzyszkowiak &lt;sebastian.krzyszkowiak@puri.sm&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.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>Merge tag 'for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply</title>
<updated>2021-08-30T18:47:32+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2021-08-30T18:47:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4520dcbe0df41385288f24e61f322ee97063fa03'/>
<id>urn:sha1:4520dcbe0df41385288f24e61f322ee97063fa03</id>
<content type='text'>
Pull power supply and reset updates from Sebastian Reichel:
 "Battery/charger related:
   - cros-peripheral-charger: new driver
   - mt6360-charger: new driver
   - simple-battery: support reading chemistry info
   - max17042-battery: add max77849 support
   - sbs-battery: add time_to_empty_now support
   - smb347-charger: prepare USB OTG support
   - rn5t618: add voltage_now support
   - axp288: cleanup &amp; optimizations
   - max17042_battery: cleanups
   - ab8500: cleanups
   - misc minor cleanups and DT binding fixes

  reset related:
   - tps65086-restart: new driver
   - linkstation-poweroff: support NETGEAR ReadyNAS Duo v2"

* tag 'for-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (51 commits)
  power: supply: core: Fix parsing of battery chemistry/technology
  power: supply: max17042_battery: log SOC threshold using debug log level
  power: supply: max17042_battery: more robust chip type checks
  power: supply: max17042_battery: fix typo in MAx17042_TOFF
  power: supply: max17042_battery: clean up MAX17055_V_empty
  power: supply: smb347-charger: Implement USB VBUS regulator
  power: supply: smb347-charger: Add missing pin control activation
  power: supply: smb347-charger: Utilize generic regmap caching
  power: supply: smb347-charger: Make smb347_set_writable() IRQ-safe
  dt-bindings: power: supply: smb347-charger: Document USB VBUS regulator
  power: reset: Add TPS65086 restart driver
  dt-bindings: power: supply: max17042: describe interrupt
  power: supply: max17042: remove duplicated STATUS bit defines
  power: supply: max17042: handle fails of reading status register
  power: supply: core: Parse battery chemistry/technology
  dt-bindings: power: Extend battery bindings with chemistry
  power: reset: linkstation-poweroff: add new device
  power: reset: linkstation-poweroff: prepare for new devices
  power: supply: bq24735: reorganize ChargeOption command macros
  power: supply: rn5t618: Add voltage_now property
  ...
</content>
</entry>
<entry>
<title>power: supply: core: Fix parsing of battery chemistry/technology</title>
<updated>2021-08-20T16:57:56+00:00</updated>
<author>
<name>Dmitry Osipenko</name>
<email>digetx@gmail.com</email>
</author>
<published>2021-08-19T23:51:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c9398455b046fc7a44b6dd53d9d6fe4b11c21700'/>
<id>urn:sha1:c9398455b046fc7a44b6dd53d9d6fe4b11c21700</id>
<content type='text'>
The power_supply_get_battery_info() fails if device-chemistry property
is missing in a device-tree because error variable is propagated to the
final return of the function, fix it.

Fixes: 4eef766b7d4d ("power: supply: core: Parse battery chemistry/technology")
Signed-off-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: max17042_battery: log SOC threshold using debug log level</title>
<updated>2021-08-17T13:33:52+00:00</updated>
<author>
<name>Sebastian Krzyszkowiak</name>
<email>sebastian.krzyszkowiak@puri.sm</email>
</author>
<published>2021-08-16T16:50:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eaa2c490514d2d49c3ef1764530234d07f422289'/>
<id>urn:sha1:eaa2c490514d2d49c3ef1764530234d07f422289</id>
<content type='text'>
There's no need to print a message on every change in battery percentage
on regular log levels.

Signed-off-by: Sebastian Krzyszkowiak &lt;sebastian.krzyszkowiak@puri.sm&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
</feed>
