<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/power, branch v6.8</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2024-02-16T22:42:38Z</updated>
<entry>
<title>power: supply: bq27xxx-i2c: Do not free non existing IRQ</title>
<updated>2024-02-16T22:42:38Z</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2024-02-15T15:51:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2df70149e73e79783bcbc7db4fa51ecef0e2022c'/>
<id>urn:sha1:2df70149e73e79783bcbc7db4fa51ecef0e2022c</id>
<content type='text'>
The bq27xxx i2c-client may not have an IRQ, in which case
client-&gt;irq will be 0. bq27xxx_battery_i2c_probe() already has
an if (client-&gt;irq) check wrapping the request_threaded_irq().

But bq27xxx_battery_i2c_remove() unconditionally calls
free_irq(client-&gt;irq) leading to:

[  190.310742] ------------[ cut here ]------------
[  190.310843] Trying to free already-free IRQ 0
[  190.310861] WARNING: CPU: 2 PID: 1304 at kernel/irq/manage.c:1893 free_irq+0x1b8/0x310

Followed by a backtrace when unbinding the driver. Add
an if (client-&gt;irq) to bq27xxx_battery_i2c_remove() mirroring
probe() to fix this.

Fixes: 444ff00734f3 ("power: supply: bq27xxx: Fix I2C IRQ race on remove")
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Link: https://lore.kernel.org/r/20240215155133.70537-1-hdegoede@redhat.com
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: mm8013: select REGMAP_I2C</title>
<updated>2024-02-12T00:16:05Z</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2024-02-04T17:30:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=30d5297862410418bb8f8b4c0a87fa55c3063dd7'/>
<id>urn:sha1:30d5297862410418bb8f8b4c0a87fa55c3063dd7</id>
<content type='text'>
The driver uses regmap APIs so it should make sure they are available.

Fixes: c75f4bf6800b ("power: supply: Introduce MM8013 fuel gauge driver")
Cc:  &lt;stable@vger.kernel.org&gt;
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Reviewed-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Link: https://lore.kernel.org/r/20240204-mm8013-regmap-v1-1-7cc6b619b7d3@weissschuh.net
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>Revert "power: supply: qcom_battmgr: Register the power supplies after PDR is up"</title>
<updated>2024-01-26T21:45:58Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan+linaro@kernel.org</email>
</author>
<published>2024-01-23T16:00:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d0266d7ab1618482d58015d67a5220e590333298'/>
<id>urn:sha1:d0266d7ab1618482d58015d67a5220e590333298</id>
<content type='text'>
This reverts commit b43f7ddc2b7a5a90447d96cb4d3c6d142dd4a810.

The offending commit deferred power-supply class device registration
until the service-started notification is received.

This triggers a NULL pointer dereference during boot of the Lenovo
ThinkPad X13s and SC8280XP CRD as battery status notifications can be
received before the service-start notification:

	Unable to handle kernel NULL pointer dereference at virtual address 00000000000005c0
	...
	Call trace:
	 _acquire+0x338/0x2064
	 acquire+0x1e8/0x318
	 spin_lock_irqsave+0x60/0x88
	 _supply_changed+0x2c/0xa4
	 battmgr_callback+0x1d4/0x60c [qcom_battmgr]
	 pmic_glink_rpmsg_callback+0x5c/0xa4 [pmic_glink]
	 qcom_glink_native_rx+0x58c/0x7e8
	 qcom_glink_smem_intr+0x14/0x24 [qcom_glink_smem]
	 __handle_irq_event_percpu+0xb0/0x2d4
	 handle_irq_event+0x4c/0xb8

As trying to serialise this is non-trivial and risks missing
notifications, let's revert to registration during probe so that the
driver data is all set up once the service goes live.

The warning message during resume in case the aDSP firmware is not
running that motivated the change can be considered a feature and should
not be suppressed.

Fixes: b43f7ddc2b7a ("power: supply: qcom_battmgr: Register the power supplies after PDR is up")
Signed-off-by: Johan Hovold &lt;johan+linaro@kernel.org&gt;
Reviewed-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Link: https://lore.kernel.org/r/20240123160053.18331-1-johan+linaro@kernel.org
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: bq24190_charger: Fix "initializer element is not constant" error</title>
<updated>2024-01-19T00:03:17Z</updated>
<author>
<name>Nathan Chancellor</name>
<email>nathan@kernel.org</email>
</author>
<published>2024-01-03T16:57:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=17d49b7e47a1001c8796f05f4a2bbdef0a998213'/>
<id>urn:sha1:17d49b7e47a1001c8796f05f4a2bbdef0a998213</id>
<content type='text'>
When building with a version of GCC prior to 8.x, there is an error
around non-constant initializer elements:

  drivers/power/supply/bq24190_charger.c:1978:16: error: initializer element is not constant
     .vbus_desc = bq24190_vbus_desc,
                  ^~~~~~~~~~~~~~~~~
  drivers/power/supply/bq24190_charger.c:1978:16: note: (near initialization for 'bq24190_chip_info_tbl[0].vbus_desc')
  drivers/power/supply/bq24190_charger.c:1989:16: error: initializer element is not constant
     .vbus_desc = bq24190_vbus_desc,
                  ^~~~~~~~~~~~~~~~~
  drivers/power/supply/bq24190_charger.c:1989:16: note: (near initialization for 'bq24190_chip_info_tbl[1].vbus_desc')
  drivers/power/supply/bq24190_charger.c:2000:16: error: initializer element is not constant
     .vbus_desc = bq24190_vbus_desc,
                  ^~~~~~~~~~~~~~~~~
  drivers/power/supply/bq24190_charger.c:2000:16: note: (near initialization for 'bq24190_chip_info_tbl[2].vbus_desc')
  drivers/power/supply/bq24190_charger.c:2011:16: error: initializer element is not constant
     .vbus_desc = bq24190_vbus_desc,
                  ^~~~~~~~~~~~~~~~~
  drivers/power/supply/bq24190_charger.c:2011:16: note: (near initialization for 'bq24190_chip_info_tbl[3].vbus_desc')
  drivers/power/supply/bq24190_charger.c:2022:16: error: initializer element is not constant
     .vbus_desc = bq24296_vbus_desc,
                  ^~~~~~~~~~~~~~~~~
  drivers/power/supply/bq24190_charger.c:2022:16: note: (near initialization for 'bq24190_chip_info_tbl[4].vbus_desc')

Clang versions prior to 17.x show a similar error:

  drivers/power/supply/bq24190_charger.c:1978:16: error: initializer element is not a compile-time constant
                  .vbus_desc = bq24190_vbus_desc,
                               ^~~~~~~~~~~~~~~~~
  1 error generated.

Newer compilers have decided to accept these structures as compile time
constants as an extension. To resolve this issue for all supported
compilers, change the vbus_desc member in 'struct bq24190_chip_info' to
a pointer, as it is only ever passed by reference anyways, and adjust
the assignments accordingly.

Closes: https://github.com/ClangBuiltLinux/linux/issues/1973
Fixes: b150a703b56f ("power: supply: bq24190_charger: Add support for BQ24296")
Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reviewed-by: Justin Stitt &lt;justinstitt@google.com&gt;
Link: https://lore.kernel.org/r/20240103-fix-bq24190_charger-vbus_desc-non-const-v1-1-115ddf798c70@kernel.org
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>Merge power-supply fixes for 6.7 cycle</title>
<updated>2024-01-14T20:38:31Z</updated>
<author>
<name>Sebastian Reichel</name>
<email>sebastian.reichel@collabora.com</email>
</author>
<published>2024-01-14T20:38:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=05599b5f56b750b5a92ff7f2c081945210816f83'/>
<id>urn:sha1:05599b5f56b750b5a92ff7f2c081945210816f83</id>
<content type='text'>
Merge power-supply fixes branch, which I never send for
the v6.7 cycle.

Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: bq24190_charger: Add support for BQ24296</title>
<updated>2023-12-24T23:58:14Z</updated>
<author>
<name>Hermes Zhang</name>
<email>chenhuiz@axis.com</email>
</author>
<published>2023-12-08T03:47:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b150a703b56fb6eb282d059b421652ccd9155c23'/>
<id>urn:sha1:b150a703b56fb6eb282d059b421652ccd9155c23</id>
<content type='text'>
The BQ24296 is most similar to the BQ24196, but the:
1. OTG config is split from CHG config (REG01)
2. ICHG (Fast Charge Current limit) range is smaller (&lt;=3008mA)
3. NTC fault is simplified to 2 bits

Signed-off-by: Hermes Zhang &lt;chenhuiz@axis.com&gt;
Link: https://lore.kernel.org/r/20231208034708.1248389-3-Hermes.Zhang@axis.com
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: qcom_battmgr: Register the power supplies after PDR is up</title>
<updated>2023-12-24T23:02:03Z</updated>
<author>
<name>Konrad Dybcio</name>
<email>konrad.dybcio@linaro.org</email>
</author>
<published>2023-12-18T14:41:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b43f7ddc2b7a5a90447d96cb4d3c6d142dd4a810'/>
<id>urn:sha1:b43f7ddc2b7a5a90447d96cb4d3c6d142dd4a810</id>
<content type='text'>
Currently, a not-yet-entirely-initialized battmgr (e.g. with pd-mapper
not having yet started or ADSP not being up etc.) results in a couple of
zombie power supply devices hanging around.

This is particularly noticeable when trying to suspend the device (even
s2idle): the PSY-internal thermal zone is inaccessible and returns
-ENODEV, which causes log spam.

Register the power supplies only after we received some notification
indicating battmgr is ready to take off.

Signed-off-by: Konrad Dybcio &lt;konrad.dybcio@linaro.org&gt;
Tested-by: Luca Weiss &lt;luca.weiss@fairphone.com&gt;
Link: https://lore.kernel.org/r/20231218-topic-battmgr_fixture_attempt-v1-1-6145745f34fe@linaro.org
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: Fix null pointer dereference in smb2_probe</title>
<updated>2023-12-24T22:43:28Z</updated>
<author>
<name>Kunwu Chan</name>
<email>chentao@kylinos.cn</email>
</author>
<published>2023-11-24T07:50:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=88f04bc3e737155e13caddf0ba8ed19db87f0212'/>
<id>urn:sha1:88f04bc3e737155e13caddf0ba8ed19db87f0212</id>
<content type='text'>
devm_kasprintf and devm_kzalloc return a pointer to dynamically
allocated memory which can be NULL upon failure.

Fixes: 8648aeb5d7b7 ("power: supply: add Qualcomm PMI8998 SMB2 Charger driver")
Signed-off-by: Kunwu Chan &lt;chentao@kylinos.cn&gt;
Link: https://lore.kernel.org/r/20231124075021.1335289-1-chentao@kylinos.cn
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: reset: at91: Drop '__init' from at91_wakeup_status()</title>
<updated>2023-12-24T22:43:10Z</updated>
<author>
<name>Nathan Chancellor</name>
<email>nathan@kernel.org</email>
</author>
<published>2023-11-20T22:35:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=195c3167865454ea909d717557c8585ccfe1b2a3'/>
<id>urn:sha1:195c3167865454ea909d717557c8585ccfe1b2a3</id>
<content type='text'>
When building with clang, there are two section mismatch warnings:

  WARNING: modpost: vmlinux: section mismatch in reference: at91_poweroff_probe+0x7c (section: .text) -&gt; at91_wakeup_status (section: .init.text)
  WARNING: modpost: vmlinux: section mismatch in reference: at91_shdwc_probe+0xcc (section: .text) -&gt; at91_wakeup_status (section: .init.text)

Drop '__init' from at91_wakeup_status() to clear up the mismatch.

Fixes: dde74a5de817 ("power: reset: at91-sama5d2_shdwc: Stop using module_platform_driver_probe()")
Fixes: 099806de68b7 ("power: reset: at91-poweroff: Stop using module_platform_driver_probe()")
Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@microchip.com&gt;
Reviewed-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: Use multiple MODULE_AUTHOR statements</title>
<updated>2023-12-24T21:59:28Z</updated>
<author>
<name>Charalampos Mitrodimas</name>
<email>charmitro@posteo.net</email>
</author>
<published>2023-11-18T13:29:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3cbbe1be0e3bd4cac5502eb141dd257ab34a4460'/>
<id>urn:sha1:3cbbe1be0e3bd4cac5502eb141dd257ab34a4460</id>
<content type='text'>
This resolves checkpatch warning "quoted string split across lines" on:
	1640: WARNING: quoted string split across lines
	1641: WARNING: quoted string split across lines

The motive to use multiple MODULE_AUTHOR statements came from this
comment from "include/linux/module.h":
	/*
	 * Author(s), use "Name &lt;email&gt;" or just "Name", for multiple
	 * authors use multiple MODULE_AUTHOR() statements/lines.
	 */
	#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)

Signed-off-by: Charalampos Mitrodimas &lt;charmitro@posteo.net&gt;
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
</feed>
