Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp25968rdb; Mon, 22 Jan 2024 10:44:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGukdAL5dMw+faRbN7LmVoOtyjqUCK7SIV78RodJzIJqsujXsN+Bj2H5F+FvFmNH1A/h1G4 X-Received: by 2002:a17:902:ab8a:b0:1d6:efee:a1f2 with SMTP id f10-20020a170902ab8a00b001d6efeea1f2mr1771948plr.115.1705949052312; Mon, 22 Jan 2024 10:44:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705949052; cv=pass; d=google.com; s=arc-20160816; b=V9fdzhRzPz93qmRfBTGhM/pKvMwL2YEN8rwNIRJ4TCyh3uK2J1ivithlS0AjzPpeZb priF33xaVAa+hdh2sRydN226KiHL84D2l1yQHrb1YbQsOTd+LclslZSdhZoqanRodTeZ gKIs65/qGaX00Rax3eSSRohny68C/EE4xcNBXoqlp3C2iUzIj1SjPJE5a01CbLGVylgu /C/uqVFJwbOyOG1s3APjH3/IrV1+kVyOeZh7gJlkx1PY7rPCxOWZcuAUem0o8N4Kf5Tx GADcOFZN+DSo5FQcrgcgUp8FIG5zJGitDq9Wa+lyhEAryBcylwwFVZ531ygZk8U/enR6 qu8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=s26G0NnkppbXguh7peNPWPJ5jelauHZoMn0Xk4NSQUw=; fh=Duma29u/+J8+20O4Tq0VrEXqbYtZZunJw5+0btwJnkI=; b=nqN5s9vL3IwDVuQDGpHo5/GB58vJjv5F8wXvlCayQmCS4wNEA8XzZQE5dYtePVToL3 4hFV3fiIRHT68VqKy/TtQL7ouIRUK0KrcqWRHM3LS/jorEJDP6hhY/OUDokNu03KpnU7 XvlXtzCjqp89NnC8nGLm7c175hNImCGn/+HFc7AOjGZ+B+Rsu3SRYhMWEKPe9dQKItF/ Ce8COKnKQDGB60X/jorLHAEhwTwDuoKGnS4yht4x3/x3CJCAtJpD/HB9t9WXbuKf7Aqv L1JtBdkeyvWQ/KyiyBmXIx56UGiezuWv6BXyAwL/2lHMKj1DEMp/mUsTpAU+m+kvoR75 Ogkw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-33891-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33891-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t9-20020a170902e84900b001d75f05e653si1049754plg.175.2024.01.22.10.44.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 10:44:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33891-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-33891-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33891-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2677B28DC73 for ; Mon, 22 Jan 2024 18:31:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7911E5576F; Mon, 22 Jan 2024 18:03:54 +0000 (UTC) Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8163155769; Mon, 22 Jan 2024 18:03:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705946633; cv=none; b=m0KmqlLQghRNEXDewsogkOIUMCFgHCBnXSM6ia7mJDb6mtcaxnjSdqym3OU+oBoFT7P/0g8oB4zN5nlwevKMuTOD6oU6JRWEuEu8E8I40x3deC59gCIWuaE7mPS/CJBOU20bHkEgXNCtfDKNWXFqbta092g6hXjYqRySriResLE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705946633; c=relaxed/simple; bh=Fh6Mfh+ZfjN747uqw1yJY2/Biltz7BVQb6iuhi4PHr8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=rtYADGuDh0NnJf/KSD0EaVAZwzDP+83qmyrNq3aJbF6eaaL4zEHzuUOBidWZEHKK/FuussvfY1sMjZQQKETkS0R1RqfmQcrhQuE5xbQOiXUxVnM7a2pwlIxiP6UVOI/rPJbviGnkIq1v5O8BuInAHhnRzcnulglq3Jv0xPHmU1Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.219.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-68197b99138so219246d6.1; Mon, 22 Jan 2024 10:03:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705946631; x=1706551431; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s26G0NnkppbXguh7peNPWPJ5jelauHZoMn0Xk4NSQUw=; b=f9sj8dapz8X8s4X3rV7CprJ4yVeGEoaicBNlidoCaSjayweKFDw/PcvRUBrg/YCxmi a+rpuUJYG3ww7Tx71XUdvnDc+IHZ1UIltCJM38MJzu6ACo1VbbFBz3hQUPvoXJgRVtdm +Duv+eDNfM9T1ILJmxw3/p/26plcEi8Ums4q43FDoD/YPhnW1+La3M2la2iSAHWfUres BGz/iiWlr4lGOQwwjbBwLrLIsvNyr5Ysj+qQYg86jmvBmIxsBOp0clHXDDB3mH1iaWDz SmcR4vaTtgHc/S8updpLDKvE0HmyemNypUaJewLmInX+1YNwdh8irNp9j0fQHwUn0hVw hizw== X-Gm-Message-State: AOJu0YzpKSZgMLO8owwP/NzVyChGP+JCTvPwJk7rJh7QVSnjZaC68sV5 Ofp8gX/ZrAQWnZ27ua6C5rk3IOTIQfe9P70ZQsBG8GnWKFwqkZezKhpIcwIiF8bqUoCYGSSdJ+y F/qM9B7On8XvDtCou/+FbN1VApeiPS5Zjyos= X-Received: by 2002:a4a:cb87:0:b0:599:9e03:68da with SMTP id y7-20020a4acb87000000b005999e0368damr789760ooq.0.1705946610762; Mon, 22 Jan 2024 10:03:30 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240122174449.00002f78@Huawei.com> In-Reply-To: <20240122174449.00002f78@Huawei.com> From: "Rafael J. Wysocki" Date: Mon, 22 Jan 2024 19:03:19 +0100 Message-ID: Subject: Re: [PATCH RFC v3 04/21] ACPI: processor: Register all CPUs from acpi_processor_get_info() To: Jonathan Cameron Cc: "Rafael J. Wysocki" , Russell King , linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, acpica-devel@lists.linuxfoundation.org, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jan 22, 2024 at 6:44=E2=80=AFPM Jonathan Cameron wrote: > > On Mon, 18 Dec 2023 21:30:50 +0100 > "Rafael J. Wysocki" wrote: > > > On Wed, Dec 13, 2023 at 1:49=E2=80=AFPM Russell King wrote: > > > > > > From: James Morse > > > > > > To allow ACPI to skip the call to arch_register_cpu() when the _STA > > > value indicates the CPU can't be brought online right now, move the > > > arch_register_cpu() call into acpi_processor_get_info(). > > > > This kind of looks backwards to me and has a potential to become > > super-confusing. > > > > I would instead add a way for the generic code to ask the platform > > firmware whether or not the given CPU is enabled and so it can be > > registered. > > Hi Rafael, > > The ACPI interpreter isn't up at this stage so we'd need to pull that > forwards. I'm not sure if we can pull the interpreter init early enough. Well, this patch effectively defers the AP registration to the time when acpi_processor_get_info() runs and the interpreter is up and running then. For consistency, it would be better to defer the AP registration in general to that point. > Perhaps pushing the registration back in all cases is the way to go? > Given the acpi interpretter is initialized via subsys_initcall() it would > need to be after that - I tried pushing cpu_dev_register_generic() > immediately after acpi_bus_init() and that seems fine. Sounds promising. > We can't leave the rest of cpu_dev_init() that late because a bunch > of other stuff relies on it (CPU freq blows up first as a core_init() > on my setup). I see. > So to make this work we need it to always move the registration later > than the necessary infrastructure, perhaps to subsys_initcall_sync() > as is done for missing CPUs (we'd need to combine the two given that > needs to run after this, or potentially just stop checking for acpi_disab= led > and don't taint the kernel!). I think this is probably the most consiste= nt > option on basis it at least moves the registration to the same point > whatever is going on and can easily use the arch callback you suggest > to hide away the logic on deciding if a CPU is there or not. I agree.