Re: [PATCH RFC v3 01/21] ACPI: Only enumerate enabled (or functional) devices
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: "Russell King (Oracle)" <linux@xxxxxxxxxxxxxxx>
- Subject: Re: [PATCH RFC v3 01/21] ACPI: Only enumerate enabled (or functional) devices
- From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
- Date: Fri, 15 Dec 2023 16:15:39 +0000
- Cc: "Rafael J. Wysocki" <rafael@xxxxxxxxxx>, <linux-pm@xxxxxxxxxxxxxxx>, <loongarch@xxxxxxxxxxxxxxx>, <linux-acpi@xxxxxxxxxxxxxxx>, <linux-arch@xxxxxxxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>, <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, <linux-riscv@xxxxxxxxxxxxxxxxxxx>, <kvmarm@xxxxxxxxxxxxxxx>, <x86@xxxxxxxxxx>, <acpica-devel@xxxxxxxxxxxxxxxxxxxxxxxxx>, <linux-csky@xxxxxxxxxxxxxxx>, <linux-doc@xxxxxxxxxxxxxxx>, <linux-ia64@xxxxxxxxxxxxxxx>, <linux-parisc@xxxxxxxxxxxxxxx>, Salil Mehta <salil.mehta@xxxxxxxxxx>, Jean-Philippe Brucker <jean-philippe@xxxxxxxxxx>, <jianyong.wu@xxxxxxx>, <justin.he@xxxxxxx>, James Morse <james.morse@xxxxxxx>
- In-reply-to: <ZXxxa+XZjPZtNfJ+@shell.armlinux.org.uk>
- Organization: Huawei Technologies Research and Development (UK) Ltd.
- References: <ZXmn46ptis59F0CO@shell.armlinux.org.uk> <E1rDOfs-00DvjY-HQ@rmk-PC.armlinux.org.uk> <20231214173241.0000260f@Huawei.com> <CAJZ5v0jymOtZ0y65K9wE8FJk+ZKwP+FoGm4AKHXcYVfQJL9MVw@mail.gmail.com> <ZXtFBYJEX2RrFrwj@shell.armlinux.org.uk> <CAJZ5v0h2Keyb-gFWFuPsKtwqjXvM2snyGpo6MMfFzaXKbfEpgw@mail.gmail.com> <CAJZ5v0h3WWtvrbxRpaGfq6c756k+L1SzZ1Gv3A14JxXHNcUMKA@mail.gmail.com> <ZXxxa+XZjPZtNfJ+@shell.armlinux.org.uk>
On Fri, 15 Dec 2023 15:31:55 +0000
"Russell King (Oracle)" <linux@xxxxxxxxxxxxxxx> wrote:
> On Thu, Dec 14, 2023 at 07:37:10PM +0100, Rafael J. Wysocki wrote:
> > On Thu, Dec 14, 2023 at 7:16 PM Rafael J. Wysocki <rafael@xxxxxxxxxx> wrote:
> > >
> > > On Thu, Dec 14, 2023 at 7:10 PM Russell King (Oracle)
> > > <linux@xxxxxxxxxxxxxxx> wrote:
> > > > I guess we need something like:
> > > >
> > > > if (device->status.present)
> > > > return device->device_type != ACPI_BUS_TYPE_PROCESSOR ||
> > > > device->status.enabled;
> > > > else
> > > > return device->status.functional;
> > > >
> > > > so we only check device->status.enabled for processor-type devices?
> > >
> > > Yes, something like this.
> >
> > However, that is not sufficient, because there are
> > ACPI_BUS_TYPE_DEVICE devices representing processors.
> >
> > I'm not sure about a clean way to do it ATM.
>
> Ok, how about:
>
> static bool acpi_dev_is_processor(const struct acpi_device *device)
> {
> struct acpi_hardware_id *hwid;
>
> if (device->device_type == ACPI_BUS_TYPE_PROCESSOR)
> return true;
>
> if (device->device_type != ACPI_BUS_TYPE_DEVICE)
> return false;
>
> list_for_each_entry(hwid, &device->pnp.ids, list)
> if (!strcmp(ACPI_PROCESSOR_OBJECT_HID, hwid->id) ||
> !strcmp(ACPI_PROCESSOR_DEVICE_HID, hwid->id))
> return true;
>
> return false;
> }
>
> and then:
>
> if (device->status.present)
> return !acpi_dev_is_processor(device) || device->status.enabled;
> else
> return device->status.functional;
>
> ?
>
Changing it to CPU only for now makes sense to me and I think this code snippet should do the
job. Nice and simple.
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]