Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2756118lqt; Mon, 22 Apr 2024 23:49:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXnCw/X9YBu7WlCSZqajC2RDLPJYrrJvm3B1YfpxSElFsB+as6/eNxGfzw06XYbRtALmA4fzwLOb4n/xc/RlHZQwfS7t7dJMS2rONsIpg== X-Google-Smtp-Source: AGHT+IEOaf9i3kBrqnoL/PYkDsJgIj1MXpmyGLeSS4K86cjz1H2xd72xSMtaBjhjTMp8iGUdiH5f X-Received: by 2002:a05:620a:4ad1:b0:78e:d77c:a23 with SMTP id sq17-20020a05620a4ad100b0078ed77c0a23mr12838411qkn.77.1713854989475; Mon, 22 Apr 2024 23:49:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713854989; cv=pass; d=google.com; s=arc-20160816; b=bPMu2nnaYS0oA3UAk7fzZPlYUkekS2mmdO+MzYPASbkSACXS60M/vu1cPQdfXtqrh7 yd/r6YdmBsXlXSme2f+hYmb8qzqmCxuQeDaE0hQ90cYfMAm2AcZ3eTRbgKj8u2JJ+NGO j4BONOZs3k9epo5IwGil9fq/wPK3rCH9i00EY8Okk1qATx5aoXXCvOcHXwlXHArUMD05 H58f+b64/qIc3g/LnXl4fPZOmKnD8HMsqcA9dzWGmlW0+sv1dpl6j1YxNQ/pLFaqOU20 WnQ4LoXxpbqegAoS4u3Jp/RK+bxL7GfzC5lm/ZpD5Xc0xEJdslHWcpIFP89nm5LEoyd3 adwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:user-agent:date :message-id:from:references:cc:to:subject; bh=62VfCLYodFwA9Jg8WKnSEOloILaaK8bXsd4CS/1cA5Q=; fh=S7HzysLzJEf2t9xHfpKwrx1jR0+E6OoCAaKUKAWYRPs=; b=iIN0Ztbj9AkQXYcZkqQkFOmj0dqnibVGj0VTRTlUN1xQjKQak1umq6n00WpaL9eJmw 96Z9ZqFooKG8qJmyNiGtQfknwjie3Td4LjjkNntgi5KNo75Y58eSOgthtobDK33tB798 wqYrCaT+qNefmegBrMgS3z/iHHGrBU0BN2oAQ9dZkKmB1dPgKsiHU3O9QBG5DuT0H3iA XKoIxEyTIy2YjOz3GnuWJEN8KRCTv410+s5c6Khq89AmPpuUauL+w46UjnIwZrruKiru BrqACiHScezRHNT7Wq95OekAGu6Wt6Q+LVou1TXY0f1semhqeV7JefnFzMwbj9jO7ap9 u93w==; 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-154573-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154573-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b16-20020a05620a0f9000b0078be2397abdsi12100939qkn.347.2024.04.22.23.49.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 23:49:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154573-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-154573-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154573-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 364881C21BFD for ; Tue, 23 Apr 2024 06:49:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00218374C2; Tue, 23 Apr 2024 06:49:20 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (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 30EFD31A8F; Tue, 23 Apr 2024 06:49:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713854959; cv=none; b=MKf+dcw4rSmj/AaPG+ZRRfYrwA5WJaWx03OTZ6nNPZMHQR1AzPtNM+NSnELSv0Vs/nRlk/J2VcV+YXtYE4e2q4TGXiwkSmsJYea/L/zQAguP7KmDxYFaJkctJxYSDIYI90lKejpgWP59PCXWmwr3j/KNcgBHBH2Kf+AocCOPN+A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713854959; c=relaxed/simple; bh=Aq1VgWGzGQgF1/SQ+Vi/rmVivciffKOD9w3vnI5XwbU=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=FQoluyPncW/S4bngjQb/QsmF7fVRAizwO7NBZmPe6cH/bgeaNB/zFB42l9x7Ly3rPkA483FTn2UYf48uqGV10zZ6n6zy+FrsjH/Sf+cANzLUsH3L2d/UtKWFDzjhPvmQoR2sL2FzyOVcvRKT0itBN9MRJHCwlCMZmiI0ERVxmQM= 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=45.249.212.188 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.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VNt166W9szXlvc; Tue, 23 Apr 2024 14:45:46 +0800 (CST) Received: from dggpemm500002.china.huawei.com (unknown [7.185.36.229]) by mail.maildlp.com (Postfix) with ESMTPS id 98DAC140427; Tue, 23 Apr 2024 14:49:14 +0800 (CST) Received: from [10.174.178.247] (10.174.178.247) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 23 Apr 2024 14:49:13 +0800 Subject: Re: [PATCH v7 03/16] ACPI: processor: Drop duplicated check on _STA (enabled + present) To: Jonathan Cameron , Thomas Gleixner , Peter Zijlstra , , , , , , , , , Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon CC: Ingo Molnar , Borislav Petkov , Dave Hansen , , , References: <20240418135412.14730-1-Jonathan.Cameron@huawei.com> <20240418135412.14730-4-Jonathan.Cameron@huawei.com> From: Hanjun Guo Message-ID: Date: Tue, 23 Apr 2024 14:49:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20240418135412.14730-4-Jonathan.Cameron@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500002.china.huawei.com (7.185.36.229) 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_processor.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 = 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? Thanks Hanjun