--- - branch: MAIN date: Fri Dec 31 14:20:24 UTC 2021 files: - new: '1.118' old: '1.117' path: src/sys/dev/acpi/acpi_bat.c pathrev: src/sys/dev/acpi/acpi_bat.c@1.118 type: modified id: 20211231T142024Z.4163fa65a41d2942f04ad60816d6af0444061b45 log: | acpibat(4): Fix attach and detach ordering. On attach: Don't register acpibat_resume handler with pmf or acpibat_notify_handler with acpi until it is safe to call acpibat_update_info and acpibat_update_status. => This requires the sc->sc_sensor array to be allocated, so allocate that first. => This requires sc->sc_sme to be created, so defer them to config_interrupts after sysmon_envsys_register. => Make sure to register the notify handler before initially polling the info and status. On detach: Deregister pmf handler and acpi notifier before we destroy anything. module: src subject: 'CVS commit: src/sys/dev/acpi' unixtime: '1640960424' user: riastradh