HomeFreeBSD

Fix startup race initialising ACPI CM battery structures on MacBookPro.

Description

Fix startup race initialising ACPI CM battery structures on MacBookPro.

During acpi_cmbat_attach() the acpi_cmbat_init_battery() notification
handler is registered. It has been observed this notification handler
can be called instantly, before the attach routine has returned. In
the notification handler there is a call to device_is_attached() which
returns false. Because the softc is set we know an attach is in
progress and the fix is simply to wait and try again in this case.

Reviewed by: avg @
MFC after: 1 week

Details

Provenance
hselaskyAuthored on
Reviewer
avg
Parents
rS314327: MFC r292782: Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c
Branches
Unknown
Tags
Unknown