[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231215161539.00000940@Huawei.com>
Date: Fri, 15 Dec 2023 16:15:39 +0000
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
CC: "Rafael J. Wysocki" <rafael@...nel.org>, <linux-pm@...r.kernel.org>,
<loongarch@...ts.linux.dev>, <linux-acpi@...r.kernel.org>,
<linux-arch@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <linux-riscv@...ts.infradead.org>,
<kvmarm@...ts.linux.dev>, <x86@...nel.org>,
<acpica-devel@...ts.linuxfoundation.org>, <linux-csky@...r.kernel.org>,
<linux-doc@...r.kernel.org>, <linux-ia64@...r.kernel.org>,
<linux-parisc@...r.kernel.org>, Salil Mehta <salil.mehta@...wei.com>,
Jean-Philippe Brucker <jean-philippe@...aro.org>, <jianyong.wu@....com>,
<justin.he@....com>, James Morse <james.morse@....com>
Subject: Re: [PATCH RFC v3 01/21] ACPI: Only enumerate enabled (or
functional) devices
On Fri, 15 Dec 2023 15:31:55 +0000
"Russell King (Oracle)" <linux@...linux.org.uk> 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@...nel.org> wrote:
> > >
> > > On Thu, Dec 14, 2023 at 7:10 PM Russell King (Oracle)
> > > <linux@...linux.org.uk> 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.
Powered by blists - more mailing lists