Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp134773lqj; Wed, 10 Apr 2024 06:25:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXgIcrgB5D4TgUIZqXspsVRbJdDokVxhoR1QhPxhziE7r9JAMtVRuZ/4vFvQECKeNny4peYqC78dVkDL2FNxNLe1uG6aifLl3lCx74Wwg== X-Google-Smtp-Source: AGHT+IFjte8E41rh+kMAnqD4zEKTu7odiMquWsQr4Mx7FXFTjBuszhQydSYwOY9qC7AAl4G6tnai X-Received: by 2002:a17:907:369:b0:a51:d716:65e with SMTP id rs9-20020a170907036900b00a51d716065emr1324683ejb.8.1712755553200; Wed, 10 Apr 2024 06:25:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712755553; cv=pass; d=google.com; s=arc-20160816; b=tIUbbp5W4okvu+T0bJ15vWtfQlv4ajFSzf3cIcnW/Q3rEL57B/2fvQWvoNXBMAs2Ox c4+ANvlkqla77P6xJWTeslcoNHDZCeGhlxrYxq+NSYhyfOcJBTYvJK4FlFatwOfRtlK3 GLnpZzIiggG/XGYF2cmuJWIhWqg6yviW2U5BQ5mhuxsCP/vqE/Fa1/eavWPCqoqjPZtC fvZ6Uzu3VJ9ZPCB9YdvHj5IKE3UKl4yC5vCQFpljP3hXY1HpxzE+ASpjKU5ucMf0OVcM uBYXcMNrEE5q5gomF4cIPWSWMn0Ogly0O+7GcErug40r2daGo1ZsweI7H5NM9jUVVY2m KSrw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=BxoJJ+Oh05hb5wBoTp/0ATccULWiElQS+AOXcmfTyfU=; fh=zEGmk4gArVX7ZXZHkgebk1BFRVO0MfMywHhteVOCv8w=; b=u+umQmj6U2ccy9LhEMuzwA6E9zB03ALIGiR5TSNhBQV3IPIDrwP/BA5DZKWDdqn+ux MLLhiO4gHyZmVWwvJ9VGyqNFVeeqNcx96u1CiEsl0hVzh3va15ytjycfOp66CL2F6O/1 HZ57qUpfqfWh/dnW8Ksk+B26YA/z7w0xtTd5IRviOoB/o4Q97yix+umjmEHOAZvzs+4f nr3kCrLWGAAJ82qGyn15rdLIU0KPS5z9SFpFNHeF4hTqWmkQYct35fZo4chIbgQrkUrD +tqi4ovlWbLlBx8JYadKh7IVAhKJTVmlo3pWQz7eKjoAsWE3hwJM6u0y+e3cDWfroNK7 2+DQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-138592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138592-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id us9-20020a170906bfc900b00a4df40d1ab4si5588566ejb.690.2024.04.10.06.25.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 06:25:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-138592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138592-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CE4821F2CE17 for ; Wed, 10 Apr 2024 13:25:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 116FF15EFD8; Wed, 10 Apr 2024 13:24:07 +0000 (UTC) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8EB115E7FD; Wed, 10 Apr 2024 13:24:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712755446; cv=none; b=Pj/pvOy8GxzMrR5yb5Z3ECKagAFsbH6hYP4K4nMAgZjpeUU5dgErz+epnhXoH4pfRFmjxS1hPICj0Pf24Ni5THZYC07lGiDzdUut4sVM2WqefP2X1bKNb3V8JRvxfoo1CEb3mIM037g9dmKI4KJkKKthOqldipQGL0Co3UDvrY0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712755446; c=relaxed/simple; bh=smc0dd2Hljy1BFflS7XGq1OlXzh6nMSx794vVITK+uM=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gyLYDWS3oVYaFdvYuDqTElkwvUvWx1vwQtQjz4+xxQhdiXGfIKGU+kg61NpPQjmLP7aO7UnSURRpUFXUNTYqwpeTrE7IevAD0vaouHTtldPnFi9nZHophCcDvI1+Hr8Yi+TTbF7ym0MGKDK8qW8sVMR1QROQm21zFxPe1O72LIs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4VF3Qk73l2z67G9n; Wed, 10 Apr 2024 21:22:22 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id CB063140CF4; Wed, 10 Apr 2024 21:24:00 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 10 Apr 2024 14:24:00 +0100 Date: Wed, 10 Apr 2024 14:23:59 +0100 From: Jonathan Cameron To: Miguel Luis CC: "Rafael J. Wysocki" , Len Brown , , , Subject: Re: [RFC PATCH 3/4] ACPI: processor: refactor acpi_processor_get_info: isolate acpi_{map|unmap}_cpu under CONFIG_ACPI_HOTPLUG_CPU Message-ID: <20240410142359.00003dea@Huawei.com> In-Reply-To: <20240409150536.9933-4-miguel.luis@oracle.com> References: <20240409150536.9933-1-miguel.luis@oracle.com> <20240409150536.9933-4-miguel.luis@oracle.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500002.china.huawei.com (7.191.160.78) To lhrpeml500005.china.huawei.com (7.191.163.240) On Tue, 9 Apr 2024 15:05:32 +0000 Miguel Luis wrote: > mapping and unmaping a cpu at the stage of extra cpu enumeration is > architecture specific which depends on CONFIG_ACPI_HOTPLUG_CPU so let's > isolate that functionality from architecture independent one. Should we consider renaming acpi_map_cpu() to arch_acpi_map_cpu() to make the arch specific nature of that call more obvious? I think that has caused more confusion in the discussion than whether it is hotplug specific or not. As mentioned in patch 2, fairly sure this needs to go before that patch. Jonathan > > Signed-off-by: Miguel Luis > --- > drivers/acpi/acpi_processor.c | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) > > diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c > index 9ea58b61d741..c6e2f64a056b 100644 > --- a/drivers/acpi/acpi_processor.c > +++ b/drivers/acpi/acpi_processor.c > @@ -194,8 +194,21 @@ static void acpi_processor_hotplug_delay_init(struct acpi_processor *pr) > pr_info("CPU%d has been hot-added\n", pr->id); > pr->flags.need_hotplug_init = 1; > } > +static int acpi_processor_hotplug_map_cpu(struct acpi_processor *pr) > +{ > + return acpi_map_cpu(pr->handle, pr->phys_id, pr->acpi_id, &pr->id); > +} > +static void acpi_processor_hotplug_unmap_cpu(struct acpi_processor *pr) > +{ > + acpi_unmap_cpu(pr->id); > +} > #else > static void acpi_processor_hotplug_delay_init(struct acpi_processor *pr) {} > +static int acpi_processor_hotplug_map_cpu(struct acpi_processor *pr) > +{ > + return 0; > +} > +static void acpi_processor_hotplug_unmap_cpu(struct acpi_processor *pr) {} > #endif /* CONFIG_ACPI_HOTPLUG_CPU */ > > /* Enumerate extra CPUs */ > @@ -215,13 +228,13 @@ static int acpi_processor_enumerate_extra(struct acpi_processor *pr) > cpu_maps_update_begin(); > cpus_write_lock(); > > - ret = acpi_map_cpu(pr->handle, pr->phys_id, pr->acpi_id, &pr->id); > + ret = acpi_processor_hotplug_map_cpu(pr); > if (ret) > goto out; > > ret = arch_register_cpu(pr->id); > if (ret) { > - acpi_unmap_cpu(pr->id); > + acpi_processor_hotplug_unmap_cpu(pr); > goto out; > } >