Page MenuHomeFreeBSD

acpi_battery: Convert driver to CTLFLAG_MPSAFE
Needs ReviewPublic

Authored by guest-seuros on Jan 9 2026, 3:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 16, 4:41 PM
Unknown Object (File)
Fri, May 15, 2:11 PM
Unknown Object (File)
Tue, Apr 28, 3:46 AM
Unknown Object (File)
Fri, Apr 24, 1:47 AM
Unknown Object (File)
Apr 12 2026, 3:42 PM
Unknown Object (File)
Apr 8 2026, 3:04 AM
Unknown Object (File)
Apr 5 2026, 2:58 PM
Unknown Object (File)
Apr 4 2026, 10:47 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

guest-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().