<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/acpi/sbs.c, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-11-03T16:29:52+00:00</updated>
<entry>
<title>ACPI: SBS: Fix present test in acpi_battery_read()</title>
<updated>2025-11-03T16:29:52+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@linaro.org</email>
</author>
<published>2025-10-31T13:03:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=01e11d18da818eabdb3769081e7123ed8bfe863c'/>
<id>urn:sha1:01e11d18da818eabdb3769081e7123ed8bfe863c</id>
<content type='text'>
The battery-&gt;present variable is a 1 bit bitfield in a u8.  This means
that the "state &amp; (1 &lt;&lt; battery-&gt;id)" test will only work when
"battery-&gt;id" is zero, otherwise -&gt;present is zero.  Fix this by adding
a !!.

Fixes: db1c291af7ad ("ACPI: SBS: Make SBS reads table-driven.")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Link: https://patch.msgid.link/aQSzr4NynN2mpEvG@stanley.mountain
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: SBS: Use strscpy() instead of strcpy()</title>
<updated>2024-11-05T20:35:36+00:00</updated>
<author>
<name>Muhammad Qasim Abdul Majeed</name>
<email>qasim.majeed20@gmail.com</email>
</author>
<published>2024-09-15T18:38:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c4ff125e372552ae0446ca9c810ae00f056b2753'/>
<id>urn:sha1:c4ff125e372552ae0446ca9c810ae00f056b2753</id>
<content type='text'>
Replace strcpy() with strscpy() in the ACPI SBS driver.

strcpy() has been deprecated because it is generally unsafe, so it
is better to eliminate it from the kernel source.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Muhammad Qasim Abdul Majeed &lt;qasim.majeed20@gmail.com&gt;
Link: https://patch.msgid.link/20240915183822.34588-7-qasim.majeed20@gmail.com
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: SBS: manage alarm sysfs attribute through psy core</title>
<updated>2024-06-13T19:30:00+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2024-06-09T11:13:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6bad28cfc30988a845fb3f59a99f4b8a4ce8fe95'/>
<id>urn:sha1:6bad28cfc30988a845fb3f59a99f4b8a4ce8fe95</id>
<content type='text'>
Let the power supply core register the attribute.

This ensures that the attribute is created before the device is
announced to userspace, avoiding a race condition.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: SBS: constify powersupply properties</title>
<updated>2024-06-13T19:26:14+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2024-06-09T07:27:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=41653463e1eadd4386acaa2ec55202536d20a60f'/>
<id>urn:sha1:41653463e1eadd4386acaa2ec55202536d20a60f</id>
<content type='text'>
The arrays are never modified, make them const.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: AC: Properly notify powermanagement core about changes</title>
<updated>2024-05-28T19:56:40+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2024-05-26T21:40:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ac62f52138f752d6c74adc6321e4996d84caf5bb'/>
<id>urn:sha1:ac62f52138f752d6c74adc6321e4996d84caf5bb</id>
<content type='text'>
The powermanagement core does various actions when a powersupply changes.
It calls into notifiers, LED triggers, other power supplies and emits an uevent.

To make sure that all these actions happen properly call power_supply_changed().

Reported-by: Rajas Paranjpe &lt;paranjperajas@gmail.com&gt;
Closes: https://github.com/MrChromebox/firmware/issues/420#issuecomment-2132251318
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Reviewed-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: SBS: Fix handling of Smart Battery Selectors</title>
<updated>2023-03-30T17:01:05+00:00</updated>
<author>
<name>Armin Wolf</name>
<email>W_Armin@gmx.de</email>
</author>
<published>2023-03-24T20:26:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3bd554e03ef412438b42862cb088ddc4e2a2561b'/>
<id>urn:sha1:3bd554e03ef412438b42862cb088ddc4e2a2561b</id>
<content type='text'>
The "Smart Battery Selector" standard says that when writing
SelectorState (0x1), the nibbles which should not be modified
need to be masked with 0xff. This is necessary since in contrast
to a "Smart Battery Manager", the last three nibbles are writable.

Failing to do so might trigger the following cycle:
1. Host accidentally changes power source of the system (3rd nibble)
   when selecting a battery.
2. Power source is invalid, Selector changes to another power source.
3. Selector notifies host that it changed the power source.
4. Host re-reads some batteries.
5. goto 1 for each re-read battery.

This loop might also be entered when a battery which is not present
is selected for SMBus access. In the end some workqueues fill up,
which causes the system to lockup upon suspend/shutdown.

Fix this by correctly masking the value to be written, and avoid
selecting batteries which are absent.

Tested on a Acer Travelmate 4002WLMi.

Signed-off-by: Armin Wolf &lt;W_Armin@gmx.de&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: make remove callback of ACPI driver void</title>
<updated>2022-11-23T18:11:22+00:00</updated>
<author>
<name>Dawei Li</name>
<email>set_pte_at@outlook.com</email>
</author>
<published>2022-11-13T16:26:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6c0eb5ba3500f6da367351ff3c4452c029cb72fa'/>
<id>urn:sha1:6c0eb5ba3500f6da367351ff3c4452c029cb72fa</id>
<content type='text'>
For bus-based driver, device removal is implemented as:
1 device_remove()-&gt;
2   bus-&gt;remove()-&gt;
3     driver-&gt;remove()

Driver core needs no inform from callee(bus driver) about the
result of remove callback. In that case, commit fc7a6209d571
("bus: Make remove callback return void") forces bus_type::remove
be void-returned.

Now we have the situation that both 1 &amp; 2 of calling chain are
void-returned, so it does not make much sense for 3(driver-&gt;remove)
to return non-void to its caller.

So the basic idea behind this change is making remove() callback of
any bus-based driver to be void-returned.

This change, for itself, is for device drivers based on acpi-bus.

Acked-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Acked-by: Lee Jones &lt;lee@kernel.org&gt;
Acked-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Dawei Li &lt;set_pte_at@outlook.com&gt;
Reviewed-by: Maximilian Luz &lt;luzmaximilian@gmail.com&gt;  # for drivers/platform/surface/*
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: Drop parent field from struct acpi_device</title>
<updated>2022-08-24T18:55:24+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2022-08-24T16:59:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=62fcb99bdf10fed34b4fe6e225489fe4be2d0536'/>
<id>urn:sha1:62fcb99bdf10fed34b4fe6e225489fe4be2d0536</id>
<content type='text'>
The parent field in struct acpi_device is, in fact, redundant,
because the dev.parent field in it effectively points to the same
object and it is used by the driver core.

Accordingly, the parent field can be dropped from struct acpi_device
and for this purpose define acpi_dev_parent() to retrieve a parent
struct acpi_device pointer from the dev.parent field in struct
acpi_device.  Next, update all of the users of the parent field
in struct acpi_device to use acpi_dev_parent() instead of it and
drop it.

While at it, drop the ACPI_IS_ROOT_DEVICE() macro that is only used
in one place in a confusing way.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Mark Brown &lt;broonie@kernel.org&gt;
Acked-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Acked-by: Wei Liu &lt;wei.liu@kernel.org&gt;
Reviewed-by: Punit Agrawal &lt;punit.agrawal@bytedance.com&gt;
</content>
</entry>
<entry>
<title>ACPI: sbs: Unify the message printing</title>
<updated>2021-06-07T13:36:46+00:00</updated>
<author>
<name>Hanjun Guo</name>
<email>guohanjun@huawei.com</email>
</author>
<published>2021-06-02T08:54:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f7e02c8d2344c9c2f124f71f53a900feb946eb8c'/>
<id>urn:sha1:f7e02c8d2344c9c2f124f71f53a900feb946eb8c</id>
<content type='text'>
Using pr_fmt() and pr_*() macros to unify the message printing.

While at it, fix the obvious coding style issue when scanning
the code.

Signed-off-by: Hanjun Guo &lt;guohanjun@huawei.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: SBS: Simplify the code using module_acpi_driver()</title>
<updated>2020-11-17T17:12:34+00:00</updated>
<author>
<name>Hanjun Guo</name>
<email>guohanjun@huawei.com</email>
</author>
<published>2020-11-13T02:25:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e882b0953ccc7ad9938251f9c7e00411a4ac48d7'/>
<id>urn:sha1:e882b0953ccc7ad9938251f9c7e00411a4ac48d7</id>
<content type='text'>
Using the module_acpi_driver() to simplify the code.

Signed-off-by: Hanjun Guo &lt;guohanjun@huawei.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
