From nobody Wed Apr 8 01:18:32 2026 Received: from canpmsgout12.his.huawei.com (canpmsgout12.his.huawei.com [113.46.200.227]) (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 A767D2DA74C; Wed, 11 Mar 2026 06:50:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.227 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773211853; cv=none; b=fdjEBawJ/yRCKUgUv8ebx7cp9FfbRpozdYjQRiCgMlOJSlQQntF/XTm33cYYzGQ/bXJFCNd5GWcCoqlp2lCMivKuwXLRKd1VPFUnPETgOHRk8KerfTUD5e2q6nzjAJFGhtVJJJmV7URkIbe0TrARo9ShnfKuF4nADtvgXHEDJc8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773211853; c=relaxed/simple; bh=Q6CKFPfaXJz12EdiAH3MJV99GCxNQ6/Q7oV43BU3u48=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EYvA4MK9pfzuGdg4j38dfEwNgO4s9Y+lubiY2nhURoO2qxjQX2tnLHN8bRnS6rLZwFOUrnRqV/WMzPAE/44WDsqK98R5U7NLfW2r135M5pSgslyg5t0Ax0dpcKFooPArmKlB29iUSmbiHofiXYw13c7oXD5cIPy565VxUm2tKxM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=h-partners.com; dkim=pass (1024-bit key) header.d=h-partners.com header.i=@h-partners.com header.b=mG0pHGTb; arc=none smtp.client-ip=113.46.200.227 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=h-partners.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=h-partners.com header.i=@h-partners.com header.b="mG0pHGTb" dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=AiNsR4vA4BYYNyWCsTWxpkWmyNNQxSWFyNkGX29NIQY=; b=mG0pHGTbN6sBCCGoecKOF02nxr2r4NnU1i5zrYCL/zp6hxVixbYk/h0eY/1qz3rE3KCLgNx0l 6oLM2ElKPUkEYYtMff3SBvQSTz5KeeesdIQ3beR6reh6QCjH+uqPQ748Xlhn5ZjgF+OBMuDmKWk Qi5ii3dQoNeAmfWb8VDKx2c= Received: from mail.maildlp.com (unknown [172.19.163.200]) by canpmsgout12.his.huawei.com (SkyGuard) with ESMTPS id 4fW1TD5rtmznTVP; Wed, 11 Mar 2026 14:45:04 +0800 (CST) Received: from dggemv712-chm.china.huawei.com (unknown [10.1.198.32]) by mail.maildlp.com (Postfix) with ESMTPS id A396C40563; Wed, 11 Mar 2026 14:50:40 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv712-chm.china.huawei.com (10.1.198.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 11 Mar 2026 14:50:40 +0800 Received: from localhost.localdomain (10.50.163.32) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Wed, 11 Mar 2026 14:50:39 +0800 From: Huisong Li To: , , CC: , , , , , , , , , Subject: [PATCH v2 1/3] ACPI: processor: idle: Remove redundant cstate check in acpi_processor_power_init Date: Wed, 11 Mar 2026 14:50:36 +0800 Message-ID: <20260311065038.4151558-2-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20260311065038.4151558-1-lihuisong@huawei.com> References: <20260311065038.4151558-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems100002.china.huawei.com (7.221.188.206) To kwepemn100009.china.huawei.com (7.202.194.112) Content-Type: text/plain; charset="utf-8" The function acpi_processor_cstate_first_run_checks() is responsible for updating max_cstate and performing initial hardware validation. Currently, this function is invoked within acpi_processor_power_init(). However, the initialization flow already ensures this is called during acpi_processor_register_idle_driver(). Therefore, the call in acpi_processor_power_init() is redundant and effectively performs no work. Signed-off-by: Huisong Li --- drivers/acpi/processor_idle.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index f6c72e3a2be1..abcdc8f858e1 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1409,8 +1409,6 @@ void acpi_processor_power_init(struct acpi_processor = *pr) if (disabled_by_idle_boot_param()) return; =20 - acpi_processor_cstate_first_run_checks(); - if (!acpi_processor_get_power_info(pr)) pr->flags.power_setup_done =3D 1; =20 --=20 2.33.0 From nobody Wed Apr 8 01:18:32 2026 Received: from canpmsgout10.his.huawei.com (canpmsgout10.his.huawei.com [113.46.200.225]) (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 98CB3367F5E; Wed, 11 Mar 2026 06:50:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.225 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773211852; cv=none; b=GFD7FOX2k3HR+F9TlSCfsrCVkdQ+GYoORgoaIS3lCxIMqyROiYYni3iM2kAQ7BRh4Ir4/ilWc5l+SlPrc377aVP1WuTIcOjMZwy0n6PzBCxJTUhabXRFfsQb7IqhKvaBQ3ECPwt/7rRJdDHpXPZVBPyYpl0+k4qT+BIBFXYO7ug= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773211852; c=relaxed/simple; bh=lAnPD2Pf8pKM0S8dX6Jy7HPgOEQFGRIz8NWOF+uuxi8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VTfz5trdUIshkME+A+xb5GnFAhLhZScEmhQZHaduVlVN7Bnx2lbaJT56RAJiUihUlpCe/7iHMOFF8L5csq2f7HiVE3/8XVHXOfAUBpUOurbD+TH0xwEKGL8W8yViZ4O2eb2VTZ68uuDeGvuGb+Mq23Khtq98k74T+XP3BjoaIms= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=h-partners.com; dkim=pass (1024-bit key) header.d=h-partners.com header.i=@h-partners.com header.b=lXZRHCQp; arc=none smtp.client-ip=113.46.200.225 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=h-partners.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=h-partners.com header.i=@h-partners.com header.b="lXZRHCQp" dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=YieaDh5dmfo2YQisWC3c1tq3cHHE7rO8nEG0Wp8iFbo=; b=lXZRHCQpylbRSWd39qulSwCC8Mn9ZiirTk09w+EZvGLofD0u2QnLtKej6A/7XftRfShuDTEP4 MHNJ9iSVTD7xVYGwyY5Ht/vGpU3q/3P2TWFGgMUKW7lzNXesBXC1e+fUvpHoMAqRqfCiCaC/Ok+ yWvVp1LA7XY9EvH3sDwSOBo= Received: from mail.maildlp.com (unknown [172.19.163.127]) by canpmsgout10.his.huawei.com (SkyGuard) with ESMTPS id 4fW1V42w3nz1K9Bb; Wed, 11 Mar 2026 14:45:48 +0800 (CST) Received: from dggemv705-chm.china.huawei.com (unknown [10.3.19.32]) by mail.maildlp.com (Postfix) with ESMTPS id 5DB4F40570; Wed, 11 Mar 2026 14:50:41 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv705-chm.china.huawei.com (10.3.19.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 11 Mar 2026 14:50:40 +0800 Received: from localhost.localdomain (10.50.163.32) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Wed, 11 Mar 2026 14:50:40 +0800 From: Huisong Li To: , , CC: , , , , , , , , , Subject: [PATCH v2 2/3] ACPI: processor: idle: Move max_cstate update out of the loop Date: Wed, 11 Mar 2026 14:50:37 +0800 Message-ID: <20260311065038.4151558-3-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20260311065038.4151558-1-lihuisong@huawei.com> References: <20260311065038.4151558-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems100002.china.huawei.com (7.221.188.206) To kwepemn100009.china.huawei.com (7.202.194.112) Content-Type: text/plain; charset="utf-8" The acpi_processor_cstate_first_run_checks() function, which updates max_cstate on certain platforms, only needs to be executed once. Move this call outside of the loop to avoid redundant executions. Signed-off-by: Huisong Li --- drivers/acpi/processor_idle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index abcdc8f858e1..62277daf874e 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1357,6 +1357,8 @@ void acpi_processor_register_idle_driver(void) int ret =3D -ENODEV; int cpu; =20 + acpi_processor_cstate_first_run_checks(); + /* * ACPI idle driver is used by all possible CPUs. * Use the processor power info of one in them to set up idle states. @@ -1368,7 +1370,6 @@ void acpi_processor_register_idle_driver(void) if (!pr) continue; =20 - acpi_processor_cstate_first_run_checks(); ret =3D acpi_processor_get_power_info(pr); if (!ret) { pr->flags.power_setup_done =3D 1; --=20 2.33.0 From nobody Wed Apr 8 01:18:32 2026 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (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 941AC2BD030; Wed, 11 Mar 2026 06:50:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773211850; cv=none; b=LTjd+0Tj07mmWd9wSWAMLyVZOXsw5+rukU05mxdmXDQ+Ls4FqqBixBCUkBkST1rLFc5C/7bV65hxqt30PF6zmOstaUjCsiovpKEicK6SyMqXN1w2mVrihWiGtEljtPlJdaZT4cDMsh7tsFKl5hQ4zgq87eoMFGNA7fIrpvYI/T8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773211850; c=relaxed/simple; bh=WBG3DdS9aSPwT59t9MPSjkCd+rnbHUrXkAGc4IColQk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gpp7ckF8LZXzCA9ko/WUijDaHK/M0wRYKUZLop1HFxbKKegQEIWxYItLEeg9iffJ8rMRwxC2tv3VX4PEEl71eFhdEJ0Wc+9DAEysMzHiPC9rt9g3nulghKlzyGLC6P694wZGwZ/+hnriGiwVlA/6PF/vxDD02NSt8qljMNR+Plw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=h-partners.com; dkim=pass (1024-bit key) header.d=h-partners.com header.i=@h-partners.com header.b=iWIEnsPo; dkim=pass (1024-bit key) header.d=h-partners.com header.i=@h-partners.com header.b=iWIEnsPo; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=h-partners.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=h-partners.com header.i=@h-partners.com header.b="iWIEnsPo"; dkim=pass (1024-bit key) header.d=h-partners.com header.i=@h-partners.com header.b="iWIEnsPo" dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=OJNCWKq2Nq8agRkMz+zeQ0G+NaWHhRKP1hrXGss1IbM=; b=iWIEnsPoiEG+y7Ch5AjcEYNMjA+2TKGXhTnvJHjr6TkcR4RTyZpVhrNmDCL0eMHJlmuBkaX79 sjbQvfJCXrLnrjY38/gYsqBtLBI0lUqjc2ssGk3aMew3p4JKWO/kLMdv5pcQeJOMIQV3gfmu0uh duBvQ2n+U+jvVlmFS97cPcM= Received: from canpmsgout04.his.huawei.com (unknown [172.19.92.133]) by szxga01-in.huawei.com (SkyGuard) with ESMTPS id 4fW1Zy2WdDz1BG3p; Wed, 11 Mar 2026 14:50:02 +0800 (CST) dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=OJNCWKq2Nq8agRkMz+zeQ0G+NaWHhRKP1hrXGss1IbM=; b=iWIEnsPoiEG+y7Ch5AjcEYNMjA+2TKGXhTnvJHjr6TkcR4RTyZpVhrNmDCL0eMHJlmuBkaX79 sjbQvfJCXrLnrjY38/gYsqBtLBI0lUqjc2ssGk3aMew3p4JKWO/kLMdv5pcQeJOMIQV3gfmu0uh duBvQ2n+U+jvVlmFS97cPcM= Received: from mail.maildlp.com (unknown [172.19.163.0]) by canpmsgout04.his.huawei.com (SkyGuard) with ESMTPS id 4fW1Tz6rFdz1prLY; Wed, 11 Mar 2026 14:45:43 +0800 (CST) Received: from dggemv706-chm.china.huawei.com (unknown [10.3.19.33]) by mail.maildlp.com (Postfix) with ESMTPS id 81A0340561; Wed, 11 Mar 2026 14:50:41 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv706-chm.china.huawei.com (10.3.19.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 11 Mar 2026 14:50:41 +0800 Received: from localhost.localdomain (10.50.163.32) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Wed, 11 Mar 2026 14:50:40 +0800 From: Huisong Li To: , , CC: , , , , , , , , , Subject: [PATCH v2 3/3] ACPI: processor: idle: Remove redundant static variable and rename cstate check function Date: Wed, 11 Mar 2026 14:50:38 +0800 Message-ID: <20260311065038.4151558-4-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20260311065038.4151558-1-lihuisong@huawei.com> References: <20260311065038.4151558-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems100002.china.huawei.com (7.221.188.206) To kwepemn100009.china.huawei.com (7.202.194.112) Content-Type: text/plain; charset="utf-8" The function acpi_processor_cstate_first_run_checks() is currently called only once during initialization in acpi_processor_register_idle_driver(). Because its execution is already limited by the caller's lifecycle, the internal static 'first_run' variable is redundant and can be safely removed. Additionally, the current function name is no longer descriptive of its behavior. Rename the function to acpi_processor_update_max_cstate() to better reflect its actual purpose. Signed-off-by: Huisong Li --- drivers/acpi/processor_idle.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 62277daf874e..d12da8cb8706 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -819,19 +819,13 @@ static void acpi_processor_setup_cstates(struct acpi_= processor *pr) drv->state_count =3D count; } =20 -static inline void acpi_processor_cstate_first_run_checks(void) +static inline void acpi_processor_update_max_cstate(void) { - static int first_run; - - if (first_run) - return; dmi_check_system(processor_power_dmi_table); max_cstate =3D acpi_processor_cstate_check(max_cstate); if (max_cstate < ACPI_C_STATES_MAX) pr_notice("processor limited to max C-state %d\n", max_cstate); =20 - first_run++; - if (nocst) return; =20 @@ -840,7 +834,7 @@ static inline void acpi_processor_cstate_first_run_chec= ks(void) #else =20 static inline int disabled_by_idle_boot_param(void) { return 0; } -static inline void acpi_processor_cstate_first_run_checks(void) { } +static inline void acpi_processor_update_max_cstate(void) { } static int acpi_processor_get_cstate_info(struct acpi_processor *pr) { return -ENODEV; @@ -1357,7 +1351,7 @@ void acpi_processor_register_idle_driver(void) int ret =3D -ENODEV; int cpu; =20 - acpi_processor_cstate_first_run_checks(); + acpi_processor_update_max_cstate(); =20 /* * ACPI idle driver is used by all possible CPUs. --=20 2.33.0