[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZUT+/rpSrMMH12mu@shell.armlinux.org.uk>
Date: Fri, 3 Nov 2023 14:09:02 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Cc: James Morse <james.morse@....com>, 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, Salil Mehta <salil.mehta@...wei.com>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
jianyong.wu@....com, justin.he@....com
Subject: Re: [RFC PATCH v2 22/35] ACPI: Check _STA present bit before making
CPUs not present
On Thu, Sep 14, 2023 at 03:31:10PM +0100, Jonathan Cameron wrote:
> On Wed, 13 Sep 2023 16:38:10 +0000
> James Morse <james.morse@....com> wrote:
> > -#ifdef CONFIG_ACPI_HOTPLUG_PRESENT_CPU
> > /* Removal */
> > -static void acpi_processor_post_eject(struct acpi_device *device)
> > +static void acpi_processor_make_not_present(struct acpi_device *device)
> > {
> > struct acpi_processor *pr;
> >
> > - if (!device || !acpi_driver_data(device))
> > + if (!IS_ENABLED(CONFIG_ACPI_HOTPLUG_PRESENT_CPU))
>
> Would it be possible to do all the ifdef to IS_ENABLED changes in a separate
> patch? I haven't figure out if any of them have dependencies on the other
> changes, but they do create a bunch of noise I'd rather not see in the more
> complex corners of this.
I'm also wondering why we want to do this check here, rather than...
> > +static void acpi_processor_post_eject(struct acpi_device *device)
> > +{
> > + struct acpi_processor *pr;
> > + unsigned long long sta;
> > + acpi_status status;
... here, because none of the code below has any effect if
acpi_processor_make_not_present() merely returns. So the below seems
like a waste of code space when CONFIG_ACPI_HOTPLUG_PRESENT_CPU is
disabled.
> > +
> > + if (!device)
> > + return;
> > +
> > + pr = acpi_driver_data(device);
> > + if (!pr || pr->id >= nr_cpu_ids || invalid_phys_cpuid(pr->phys_id))
> > + return;
> > +
> > + status = acpi_evaluate_integer(pr->handle, "_STA", NULL, &sta);
> > + if (ACPI_FAILURE(status))
> > + return;
> > +
> > + if (cpu_present(pr->id) && !(sta & ACPI_STA_DEVICE_PRESENT)) {
> > + acpi_processor_make_not_present(device);
> > + return;
> > + }
> > +}
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists