From nobody Tue Dec 2 00:26:08 2025 Received: from canpmsgout02.his.huawei.com (canpmsgout02.his.huawei.com [113.46.200.217]) (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 5AD6B2D73A9; Tue, 25 Nov 2025 07:29:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.217 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764055781; cv=none; b=YJOCK7BoOG3u7qOu6hm8aR4m6x2hw39k3UBvfvVsbIZmQvZe6wa5um1x3pevi2p5nf+fPcT3FNgyaw9tgiV9sS1bKoGmM6kN3sA4V6EFeRUUsFqehg4cjsGpTCC9orK5WyzWxA15uYOinZadA42ZHBiqXCLaEs9yDE6KI5JWfAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764055781; c=relaxed/simple; bh=teSNBsRwcRRwniPEDYSxcu3kWy7IPtFhJxEjSGZwADo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oas5F7LF+uX+XHEruSekO+a2XttMo6XhH8BKodURiweg+ckvuAKMnGk3lrxy49VJIdMP9HMBuSolePXeORuYUU91sJhi5DcWdjgS5FpE8fQBT96tc3rNyM7zK2jxickvTYriRBL5KJa44beXtN8LSN8zLoTYjqXEtGqTWPVTRZs= 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=JjwnHsMd; arc=none smtp.client-ip=113.46.200.217 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="JjwnHsMd" dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=F4LQMeD2kHahQ+1nrC+W98OH/wc9EAR9nP6PI06pBgQ=; b=JjwnHsMd/YQmZmbQAerSzyVF7La1XUJTn3RjVH/oo2ECvqBGnyz/5vNmT4mhLn5nrEKMi3bwK xSnosaN+KYmTQ55sZbCZAvo3C5nBF1hb1hAnvSwft4J64W+njuFlYM7TB5kYmfHjccvASFEBXn2 tWp2o/RQ8iwZ0Z6ZpYTm1zg= Received: from mail.maildlp.com (unknown [172.19.88.105]) by canpmsgout02.his.huawei.com (SkyGuard) with ESMTPS id 4dFvQz4lBRzcZxk; Tue, 25 Nov 2025 15:27:23 +0800 (CST) Received: from dggemv706-chm.china.huawei.com (unknown [10.3.19.33]) by mail.maildlp.com (Postfix) with ESMTPS id BD8241402C1; Tue, 25 Nov 2025 15:29:36 +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; Tue, 25 Nov 2025 15:29:36 +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; Tue, 25 Nov 2025 15:29:35 +0800 From: Huisong Li To: , CC: , , , , , , , , Subject: [PATCH 3/3] ACPI: processor: idle: Update idle states from avaiable power information Date: Tue, 25 Nov 2025 15:29:33 +0800 Message-ID: <20251125072933.3706006-4-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20251125072933.3706006-1-lihuisong@huawei.com> References: <20251125072933.3706006-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: kwepems500001.china.huawei.com (7.221.188.70) To kwepemn100009.china.huawei.com (7.202.194.112) Content-Type: text/plain; charset="utf-8" Currently, the ACPI power notify makes it once per system instead of once p= er-cpu. And driver selects the notify on CPU0 to update idle states. The same idle state is used for all CPUs. An avaiable power information is obtained successfully from any CPUs can be used to populate the ACPI idle states as acpi_processor_register_idle_driver() did. So keep the same logical to get avaiable power information from online CPUs instead of CPU0 to update idle states in power notify. Signed-off-by: Huisong Li --- drivers/acpi/processor_idle.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index cd4d1d8d70b0..8d3122a4e6d0 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1332,19 +1332,26 @@ int acpi_processor_power_state_has_changed(struct a= cpi_processor *pr) * * The same idle state is used for all CPUs. * The old idle state may not be usable anymore if fail to get - * ACPI power information of CPU0. + * available ACPI power information from any online CPU. * The cpuidle of all CPUs should be disabled. */ - ret =3D acpi_processor_get_power_info(pr); + ret =3D -ENODEV; + for_each_online_cpu(cpu) { + _pr =3D per_cpu(processors, cpu); + if (!_pr && !_pr->flags.power_setup_done) + continue; + ret =3D acpi_processor_get_power_info(_pr); + if (!ret) { + acpi_processor_setup_cpuidle_states(_pr); + break; + } + } if (ret) { /* Ensure cpuidle of offline CPUs are inavaliable. */ disable_cpuidle(); - pr_err("Get processor-%u power information failed, disable cpuidle of a= ll CPUs\n", - pr->id); + pr_err("No available ACPI power information, disable cpuidle of all CPU= s.\n"); goto release_lock; } - - acpi_processor_setup_cpuidle_states(pr); enable_cpuidle(); =20 /* Enable all cpuidle devices */ --=20 2.33.0