Page MenuHomeFreeBSD

acpi_battery: Convert driver to CTLFLAG_MPSAFE
Needs ReviewPublic

Authored by seuros on Jan 9 2026, 3:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 28, 4:24 PM
Unknown Object (File)
Thu, Sep 24, 2:38 PM
Unknown Object (File)
Thu, Sep 24, 4:32 AM
Unknown Object (File)
Wed, Sep 23, 3:46 PM
Unknown Object (File)
Wed, Sep 23, 9:09 AM
Unknown Object (File)
Wed, Sep 23, 8:31 AM
Unknown Object (File)
Sep 5 2026, 2:43 AM
Unknown Object (File)
Sep 4 2026, 7:40 PM
Subscribers
None

Details

Reviewers
jhb
imp
markj
Summary

Replaced CTLFLAG_NEEDGIANT with CTLFLAG_MPSAFE for all battery status sysctls.

The driver uses ACPI_SERIAL locks for correct synchronization and does not require Giant lock.

Test Plan

hw.acpi.battery.* were functional after the conversion.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

seuros requested review of this revision.Jan 9 2026, 3:22 PM
seuros created this revision.

acpi_battery_get_battinfo() calls into the newbus layer and accesses some structures that are synchronized by the Giant lock. I think we need to at least acquire bus_topo_lock() in acpi_battery_get_battinfo().