From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A841FCD128A for ; Wed, 10 Apr 2024 12:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rXaOU6K9QLBrNTUsZzWUJFzICCPXEfes6bD/BgZcO0o=; b=czVqPWFFi/9PIp PH4i+lanwslQtFr+Y4+gH1vwlLwYy2aVgBTOLvTUOH7NRIGdjpX2P7ccQnkPo8QxhNnQCTGReO77f YHYxT8TkD6JHKeqF8lh0o8c1F0GrFl6cCGGgWMDnR2Jaus2gXdvcGlcS54HNN4g+ouHjdjlhh12ZR 9Wje6Gf4yPi4+7viKH9/pqzGVi78mGQ3JjxtWxOaK4/LcFiwVZcpEf2dI2agz8PtluZb+QcQsDODN zxswZBVgYBvEYImchkwWiCBjUaaEt9GOjAbrN1b8ZYi1LYzHaYFFKMhr5oyXMCTtb88ijhRGHPes7 Q9Rk3pG2QIHJttQaBLcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruXIZ-00000006viQ-0Aap; Wed, 10 Apr 2024 12:43:31 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruXIU-00000006vgC-2PWo; Wed, 10 Apr 2024 12:43:29 +0000 Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4VF2Wn6z5Vz6K6Cs; Wed, 10 Apr 2024 20:41:41 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id AB478140DD4; Wed, 10 Apr 2024 20:43:19 +0800 (CST) Received: from localhost (10.122.247.231) 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 13:43:19 +0100 Date: Wed, 10 Apr 2024 13:43:18 +0100 From: Jonathan Cameron To: "Rafael J. Wysocki" CC: Russell King , , , , , , , , , , , , , , , Salil Mehta , Jean-Philippe Brucker , , , James Morse Subject: Re: [PATCH RFC v4 02/15] ACPI: processor: Register all CPUs from acpi_processor_get_info() Message-ID: <20240410134318.0000193c@huawei.com> In-Reply-To: <20240322185327.00002416@Huawei.com> References: <20240322185327.00002416@Huawei.com> Organization: Huawei Technologies R&D (UK) Ltd. X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; x86_64-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.122.247.231] X-ClientProxiedBy: lhrpeml500006.china.huawei.com (7.191.161.198) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240410_054327_045966_CE017A45 X-CRM114-Status: GOOD ( 17.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > > > > > diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c > > > index 47de0f140ba6..13d052bf13f4 100644 > > > --- a/drivers/base/cpu.c > > > +++ b/drivers/base/cpu.c > > > @@ -553,7 +553,11 @@ static void __init cpu_dev_register_generic(void) > > > { > > > int i, ret; > > > > > > - if (!IS_ENABLED(CONFIG_GENERIC_CPU_DEVICES)) > > > + /* > > > + * When ACPI is enabled, CPUs are registered via > > > + * acpi_processor_get_info(). > > > + */ > > > + if (!IS_ENABLED(CONFIG_GENERIC_CPU_DEVICES) || !acpi_disabled) > > > return; > > > > Honestly, this looks like a quick hack to me and it absolutely > > requires an ACK from the x86 maintainers to go anywhere. > Will address this separately. > So do people prefer this hack, or something along lines of the following? static int __init cpu_dev_register_generic(void) { int i, ret = 0; for_each_online_cpu(i) { if (!get_cpu_device(i)) { ret = arch_register_cpu(i); if (ret) pr_warn("register_cpu %d failed (%d)\n", i, ret); } } //Probably just eat the error. return 0; } subsys_initcall_sync(cpu_dev_register_generic); Which may look familiar at it's effectively patch 3 from v3 which was dealing with CPUs missing from DSDT (something we think doesn't happen). It might be possible to elide the arch_register_cpu() in make_present() but that will mean we use different flows in this patch set for the hotplug and initially present cases which is a bit messy. I've tested this lightly on arm64 and x86 ACPI + DT booting and it "seems" fine. Jonathan > > > > > > > > for_each_present_cpu(i) { > > > -- > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel