Re: [PATCH] ACPI: scan: Drop power resource references for deferred devices

"Rafael J. Wysocki (Intel)" <[email protected]>
Newsgroups dev.linux.lists.spacemit,org.infradead.lists.linux-riscv,org.kernel.vger.linux-acpi,org.kernel.vger.linux-kernel
Message-ID <CAJZ5v0jwAvynHo+ctq_CJJCKPDFct7DBj8SbDhKvWp7KZM0wwQ@mail.gmail.com>
On Tue, Aug 18, 2026 at 5:41 AM Peixin Xie
<[email protected]> 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!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.