lkml.org 
[lkml]   [2023]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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@arm.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!

    \
     
     \ /
      Last update: 2023-11-20 13:47    [W:7.967 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site