Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2820136lqt; Tue, 23 Apr 2024 02:36:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWrovu4R/4DR/0A3/a+eSbTtkJQMvfIT7ijYvEsc66tPXjAUEPs/0uwKRcX5SKdVouvl3WtgEtiDYcyM41+95fyKCXH2om3mIkSsDZQ6g== X-Google-Smtp-Source: AGHT+IF5tkNPvpHwnZdd4yq5Ob8BGdTKFGYp3Aj2wkelK/2lKd0f9KCupHKnrUF7gYr2g68d01t5 X-Received: by 2002:a05:6870:858c:b0:239:5b8:5c9e with SMTP id f12-20020a056870858c00b0023905b85c9emr14904453oal.11.1713864962674; Tue, 23 Apr 2024 02:36:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713864962; cv=pass; d=google.com; s=arc-20160816; b=BtXH22tG39xHHFz4KA+smPVj7JZZT7RRrvCvAsBuYFwoAydt4zwQVPgAaO8ooPdkCe EUcMTCbZK7TDZLQxt08pxq8bF2rRJlNkc8QksohsWDEFT8i3e0VHSMpaQDH2daKgSUFI OInzshCMAK64X5HpsDVOV/xUqsZaTB76fqNi2X0CJVG5qIEPhDS2YwG16SdvPt3OC2A0 vCxooLIK6uYV00ac3GYBhyGbBw+eJC0BxJusSwSQ1E2pXPZxVdqoMIoFUsAG5fTMrxVz z/RPeMkTUdPf/pSyf9kaCzj525T9xiIKPlarR1ETO7fKmeQDPw5IC3OrEzpitotaQwaM C0Nw== 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:dkim-signature; bh=t+z4nvbUckQ5CRY4gfTIcL8l4XpzNNzh8CBoo1dj44s=; fh=+15Kt0ooKhMO7tB+1XkOgB4PQslhcfRGJsAuArQtWsQ=; b=WI4B+fzjMaK5YAPmMV/r3cu90rw9YbfOL9cUZRKrbMrehCZFrUH38+PNL56UJmS2d+ 06Z82Vg7aVK3xQrYScn3g4awvcOB/bn0ndQXvmf1gvmYQWv3swOH6CtbcQzpHLQUi2AC MOz4Df2yap7fSCdJs6+LuJm0XW/tViNJ+ejx8WcohTmo508JH9LwzArVSl1BypUdYNPE isMEjNmyulMzn14kyuozifkQ2YzHT+NmF+9S9JHeiLHGNeVzZTO2SxhBnCBnK/77PJ5D AubUel1jPKrrT8SQZe/UpDnydS780/Q0hgFIHuGwXCNnlHY1l6lQ4gJUFlq7tAqSbqEv uY1w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LBqEG+4V; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-154789-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154789-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id h11-20020a63210b000000b005dc49a8c93fsi8869039pgh.764.2024.04.23.02.36.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 02:36:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154789-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LBqEG+4V; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-154789-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154789-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 02D4BB220E0 for ; Tue, 23 Apr 2024 09:31:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A49E25A0F4; Tue, 23 Apr 2024 09:31:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LBqEG+4V" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 BCCB151016; Tue, 23 Apr 2024 09:31:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713864687; cv=none; b=uELwyPpvpQ+Z+nmgosR5Y2rdyG7z4LjnIvq7E2InAbh8FPeIjKCu8PqJIhOeK2voCrGChX86MOqk7T+Wsb1bKGVeFxKDgg8Uw73aZZ295ockl9KCL5eANMNjo/ukhUsrbi4BHu9mV/2HSSpqYtJ8jyt/tYggQBxlNvKrgGKZMj4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713864687; c=relaxed/simple; bh=mCfFITSMnCflHebZWGZOERjPx9rq/bpE5SXgFwiJHz8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=hNjfUV7Rb26yDi6gQDmnhc1lsxs0giivxl6sKYxuMngzHKfNkpNwiZ1+a8Iep7NJ/Go04mqKrexhSCe6PlHokaAnMcOsZ260DSeWk0Fu9pgjXHcJuo9dkRqc2KrtNYje0KTcrkoiZAxDhsbvgf3ou60sZ7Z0Biouoy4hteF4lPI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LBqEG+4V; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BE49C4AF0B; Tue, 23 Apr 2024 09:31:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713864687; bh=mCfFITSMnCflHebZWGZOERjPx9rq/bpE5SXgFwiJHz8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=LBqEG+4VDH76Wzj3j/0ieKNlwWtnLoLwDo9wtFs4I19rtyemYkNNiQy4RqnBHyChx RR0fJjUL7C/bNvPLRLhBJKhs5MbowPS72vAoU1iHj6M2rYygNsh1nPK4Llt+Flsq4g RvgARe4pRKfaSCsmwB0nWtIv9W4+Uakle2S7TLmoo9DIzqy0QpOU7I3ha2wXygqe8q ssPoPWXf6+XL3YV7hnVlgVeLLJUpaUdBx2k8wDtuu+XHyBX9T69k+tEbG+Ct/q64FA +YWnSfjz7+6hYZ9bZfKMsIEYwXg2o15zuxJw9bnMXgcMTtPx5Niozg1vCNJmJj60B1 fQV5eu3Hr/sew== Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-5af12f48b72so213066eaf.3; Tue, 23 Apr 2024 02:31:27 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVVBxHV2PYsi+wvnh6oua8yZR6JmcJjisXi51Ng5fLYKTsoFBITm8yzOsBxAzD7k0ATjl1aIPIO6S8zasGGr3rvAcAMX1OW9rpgc287tGjNAoymSkqX759rJPJr5CgH1JkJjYyg05Wdi2LQQejJB50X41sWlgF9YnqiHIOai+iRflTg2TGISt7Y6gGduX6cxzavmEhCLoWdbLU2gwrLJw== X-Gm-Message-State: AOJu0YwYdNgyxmrqvC9Shvd6kzB/N1GkrmjIgtkMG0zrGlQBpY2koHTU i9yrg28qlg4PAhOlN1B6dNz/XSt0PsCTgVMD11CiI3AjTcvvEPp7jC68x/0NmzsnoBwqXAlcvXN 0SfwXbkqNUtaXbWtdE4v/Ht1g/fo= X-Received: by 2002:a05:6870:d68c:b0:22e:77b6:4f9d with SMTP id z12-20020a056870d68c00b0022e77b64f9dmr15761595oap.3.1713864686690; Tue, 23 Apr 2024 02:31:26 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240418135412.14730-1-Jonathan.Cameron@huawei.com> <20240418135412.14730-4-Jonathan.Cameron@huawei.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 23 Apr 2024 11:31:14 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 03/16] ACPI: processor: Drop duplicated check on _STA (enabled + present) To: Hanjun Guo Cc: Jonathan Cameron , Thomas Gleixner , Peter Zijlstra , 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, kvmarm@lists.linux.dev, x86@kernel.org, Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon , Ingo Molnar , Borislav Petkov , Dave Hansen , linuxarm@huawei.com, justin.he@arm.com, jianyong.wu@arm.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 23, 2024 at 8:49=E2=80=AFAM Hanjun Guo w= rote: > > On 2024/4/18 21:53, Jonathan Cameron wrote: > > The ACPI bus scan will only result in acpi_processor_add() being called > > if _STA has already been checked and the result is that the > > processor is enabled and present. Hence drop this additional check. > > > > Suggested-by: Rafael J. Wysocki > > Signed-off-by: Jonathan Cameron > > > > --- > > v7: No change > > v6: New patch to drop this unnecessary code. Now I think we only > > need to explicitly read STA to print a warning in the ARM64 > > arch_unregister_cpu() path where we want to know if the > > present bit has been unset as well. > > --- > > drivers/acpi/acpi_processor.c | 6 ------ > > 1 file changed, 6 deletions(-) > > > > diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processo= r.c > > index 7fc924aeeed0..ba0a6f0ac841 100644 > > --- a/drivers/acpi/acpi_processor.c > > +++ b/drivers/acpi/acpi_processor.c > > @@ -186,17 +186,11 @@ static void __init acpi_pcc_cpufreq_init(void) {} > > #ifdef CONFIG_ACPI_HOTPLUG_CPU > > static int acpi_processor_hotadd_init(struct acpi_processor *pr) > > { > > - unsigned long long sta; > > - acpi_status status; > > int ret; > > > > if (invalid_phys_cpuid(pr->phys_id)) > > return -ENODEV; > > > > - status =3D acpi_evaluate_integer(pr->handle, "_STA", NULL, &sta); > > - if (ACPI_FAILURE(status) || !(sta & ACPI_STA_DEVICE_PRESENT)) > > - return -ENODEV; > > - > > cpu_maps_update_begin(); > > cpus_write_lock(); > > Since the status bits were checked before acpi_processor_add() being > called, do we need to remove the if (!acpi_device_is_enabled(device)) > check in acpi_processor_add() as well? No, because its caller only checks the present bit. The function itself checks the enabled bit.