[PATCH] ACPI: scan: Drop power resource references for deferred devices
Rafael J. Wysocki (Intel)
rafael at kernel.org
Tue Aug 18 04:57:29 PDT 2026
On Tue, Aug 18, 2026 at 5:41 AM Peixin Xie
<peixin.xie at linux.spacemit.com> wrote:
>
> On Wed, Aug 12, 2026 at 03:15:27PM +0200, Rafael J. Wysocki wrote:
> > Have you considered dropping the acpi_bus_init_power() call from
> > acpi_bus_get_power_flags() and doing it only once when the device gets
> > ready for enumeration?
>
> Thank you for the suggestion. I tested this approach on the SpacemiT K3
> platform and it works as expected.
>
> In addition to removing the acpi_bus_init_power() call, I set
> device->flags.initialized to false at the end of acpi_bus_get_power_flags()
> to mark the device power state as not yet initialized.
Instead of doing this, IMV it would be better to remove the setting of
device->flags.initialized to 1 in acpi_init_device_object() and set it
to 1 in acpi_add_power_resource().
> This causes the existing path in acpi_bus_attach() to call acpi_bus_init_power() once the
> device is ready for enumeration.
>
> The power resource references are now balanced and runtime suspend and
> resume continue to work correctly. I will send a v2 in next couple days.
Please do, but please take the comment above into consideration.
Thanks!
More information about the linux-riscv
mailing list