From nobody Wed Oct 1 22:38:33 2025 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 AF8112D0298; Mon, 29 Sep 2025 09:38:11 +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=1759138693; cv=none; b=TRAXGaAmWNb8A9eBWMPcs6QjHRmkuCbkMYsWVq4mcx7plLlmNLG3EGsU0sdW3yB2rOBYeg1V1dmh7ICQaLMe+obrnrBdiTlj+MhUfiVKLwCHTYSS6T8JhcSa2D9OYMPpXlj4etbUFT+D9Wi+21D+M6CS9tM9kUU9s6HTSsD+sMc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759138693; c=relaxed/simple; bh=nRp17g1xjbnij/LqWRt+c8wZhAnlh0RnZ1ZS2TUNZ7I=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FHsAxXgm91r0eOOEnmLp3id5AT+uYYFZE3e+ONh2PKISrfILeAroNy17Dvzo7B4cWLDXcQIjvLzTlvqPdBUiHAwy5S2DxMgkFW+864xo4RG+bkP6jqwVPS6obCilBTD1dhxlr3bN/y3VtR4DESLWzvBnNXzu/8sUzqZHpArt9Bw= 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=X3fHrRgW; arc=none smtp.client-ip=45.249.212.188 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="X3fHrRgW" Received: from canpmsgout07.his.huawei.com (unknown [172.19.92.160]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4cZx1406vxztTrb; Mon, 29 Sep 2025 17:37:12 +0800 (CST) dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=RTh9uqnCsbUsYKMXste5LqujrX180HMZlmUL39niJlg=; b=X3fHrRgW/ro90YYeDfZ1jNqFky1scUK8I/7N325IAnbFPhPxQ6xJIDZ2sOWb+BOS3mSsaMm1a whw2wfEeMsOUjCBn/ExxX50KZ0xdAVcQ0PxsG9gUJOyPpeQEcFFOBnqNvDMDDSno0BPXB06/dux a7prJtvPEu72eqwPwjC0YVk= Received: from mail.maildlp.com (unknown [172.19.163.17]) by canpmsgout07.his.huawei.com (SkyGuard) with ESMTPS id 4cZx1j36tRzLlSD; Mon, 29 Sep 2025 17:37:45 +0800 (CST) Received: from dggemv712-chm.china.huawei.com (unknown [10.1.198.32]) by mail.maildlp.com (Postfix) with ESMTPS id EB26D1A0188; Mon, 29 Sep 2025 17:37:55 +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; Mon, 29 Sep 2025 17:37:55 +0800 Received: from localhost.localdomain (10.50.165.33) 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.11; Mon, 29 Sep 2025 17:37:55 +0800 From: Huisong Li To: , CC: , , , , , , , , Subject: [PATCH v1 1/9] ACPI: processor: idle: raise up log level when evaluate LPI failed Date: Mon, 29 Sep 2025 17:37:46 +0800 Message-ID: <20250929093754.3998136-2-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250929093754.3998136-1-lihuisong@huawei.com> References: <20250929093754.3998136-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: kwepems100001.china.huawei.com (7.221.188.238) To kwepemn100009.china.huawei.com (7.202.194.112) Content-Type: text/plain; charset="utf-8" According to ACPI spec, LPI package must be ACPI_TYPE_PACKAGE and the count of package must be greater than 4. And the count contained in package needs to be equal to the value of count field in LPI package. All are illegal and return failure. It is better for these verification to use error level log instead of debug so as to get detailed logs directly when initialization fails. Signed-off-by: Huisong Li --- drivers/acpi/processor_idle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 22b051b94a86..5acf12a0441f 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -908,7 +908,7 @@ static int acpi_processor_evaluate_lpi(acpi_handle hand= le, /* There must be at least 4 elements =3D 3 elements + 1 package */ if (!lpi_data || lpi_data->type !=3D ACPI_TYPE_PACKAGE || lpi_data->package.count < 4) { - pr_debug("not enough elements in _LPI\n"); + pr_err("not enough elements in _LPI\n"); ret =3D -ENODATA; goto end; } @@ -917,7 +917,7 @@ static int acpi_processor_evaluate_lpi(acpi_handle hand= le, =20 /* Validate number of power states. */ if (pkg_count < 1 || pkg_count !=3D lpi_data->package.count - 3) { - pr_debug("count given by _LPI is not valid\n"); + pr_err("count given by _LPI is not valid\n"); ret =3D -ENODATA; goto end; } --=20 2.33.0 From nobody Wed Oct 1 22:38:33 2025 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 AF7992D0292; Mon, 29 Sep 2025 09:38:11 +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=1759138695; cv=none; b=t9mjbVQGYw4V1MPvJQa0FRtP0RbIOcilRpOuJILHbYEsCWzLIY8fm89hgbnbHMpWXurdp1G/ZCFxQsKPfWVThStv1QpAscc5Ak210QjYW+AFFcAwxkAd7qssbX3wbKBVRXLt84tIApUgWhPGIGbK0AJRFHYOsTz8TgCb6NqVpys= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759138695; c=relaxed/simple; bh=ET17Ecn8UKDKY1b9r5nv3OFGUUXEXIalhxeaPZZ8X+Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZQWPZyfADADee4xzSjH73mbvAeukJ88yyp4K6JGOhL0xPAp64GjGSgsLmvwwJYncUmhZNpMDiABhOBQZCQlrdGnETEN8+3YewYq4Xj3RVHI8NZj5Zsjf/Fms42zvtkjlDd7Bq8oNNgaS535qslLC3rPyYSBA3d29H+shgq81EJ4= 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=LcL2lYzk; arc=none smtp.client-ip=45.249.212.188 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="LcL2lYzk" Received: from canpmsgout06.his.huawei.com (unknown [172.19.92.157]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4cZx136LlcztTny; Mon, 29 Sep 2025 17:37:11 +0800 (CST) dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=zZ7qeN7/pBD4pnUfMBd3WN5wX1rOHmBzXPGuoo+KwT0=; b=LcL2lYzk6tEp5cqqBTm3URVP3KF+0IKP7qsC5X91o7fQ6nbyAxJwoKX70rPJDdk2JZfxGTIyz KCgudePbYnOBx86SHQf4FxDaRo8QPY6FLkzhLUO7RrMoS2MnAr/oHE/HRS15SOSUzpI+MLAit2I fBtZ9TQAq+2s3KfRzz7JsO0= Received: from mail.maildlp.com (unknown [172.19.88.194]) by canpmsgout06.his.huawei.com (SkyGuard) with ESMTPS id 4cZx1j5LWNzRhQy; Mon, 29 Sep 2025 17:37:45 +0800 (CST) Received: from dggemv705-chm.china.huawei.com (unknown [10.3.19.32]) by mail.maildlp.com (Postfix) with ESMTPS id 7061E140132; Mon, 29 Sep 2025 17:37:56 +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; Mon, 29 Sep 2025 17:37:56 +0800 Received: from localhost.localdomain (10.50.165.33) 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.11; Mon, 29 Sep 2025 17:37:55 +0800 From: Huisong Li To: , CC: , , , , , , , , Subject: [PATCH v1 2/9] ACPI: processor: idle: Return failure if entry method is not buffer or integer type Date: Mon, 29 Sep 2025 17:37:47 +0800 Message-ID: <20250929093754.3998136-3-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250929093754.3998136-1-lihuisong@huawei.com> References: <20250929093754.3998136-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: kwepems100001.china.huawei.com (7.221.188.238) To kwepemn100009.china.huawei.com (7.202.194.112) Content-Type: text/plain; charset="utf-8" According to ACPI spec, entry method in LPI sub-package must be buffer or integer. However, acpi_processor_evaluate_lpi() regeards it as success and treat it as an effective LPI state. This is unreasonable and needs to return failure to prevent other problems from occurring. Fixes: a36a7fecfe60 ("ACPI / processor_idle: Add support for Low Power Idle= (LPI) states") Signed-off-by: Huisong Li --- drivers/acpi/processor_idle.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 5acf12a0441f..681587f2614b 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -958,7 +958,9 @@ static int acpi_processor_evaluate_lpi(acpi_handle hand= le, lpi_state->entry_method =3D ACPI_CSTATE_INTEGER; lpi_state->address =3D obj->integer.value; } else { - continue; + pr_err("Entry method in LPI sub-package must be buffer or integer.\n"); + ret =3D -EINVAL; + goto end; } =20 /* elements[7,8] skipped for now i.e. Residency/Usage counter*/ --=20 2.33.0 From nobody Wed Oct 1 22:38:33 2025 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 CB33B2D0601; Mon, 29 Sep 2025 09:38:11 +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=1759138694; cv=none; b=LUlC4K9wTPK4EiUcDemd4ssDEr29PgONptM8zsFz4YSPKzaTiUVeWojkDTKAVUNmn+Oea+1fH4ErrcxCkmisqJuORb7EjWjML8UjS1AmmW+lFHCiImKOzcrIpdrsqzOBW6jCIc5v+N/c415KdIDTpiAC8omzR6AKkcdjRoMaUSI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759138694; c=relaxed/simple; bh=fYwOECErA6ISUheQ7oOcD0ZnNryYdxvOax7G5YLyxOQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Gs/Zag003KmPsynBsSr1EuZUHItk7YlvwF7pZVP05zQeYBu66gcBu0HJlfhhw/Q9epyOhJROijRCZnzXihnJowU9rX5JqIf5MSwzKd7ec0I18UCXodcqM0i0HHQKKelc/ipOeI8mJH93aASXvqLGNDc+YNJWuDeJOuuX7Uss5Pw= 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=d9N1sQQ3; arc=none smtp.client-ip=45.249.212.188 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="d9N1sQQ3" Received: from canpmsgout11.his.huawei.com (unknown [172.19.92.148]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4cZx1B1My9ztTtP; Mon, 29 Sep 2025 17:37:18 +0800 (CST) dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=XDW8LrIGQZfT9ioHaiAGrXdgQchtR8sw+7/4eE7zjFM=; b=d9N1sQQ3gBLqMs9vA2lAnuXJFlQs0qCMo+rkY+cyC1E5ZVhgarHnPANECPSAsOlP0kX/XjJyv zT8iU4HhwRX7Od7GyXtsSbEbySzOHLz8vNP1KTOkDCvuOhbAlUUe8AO+M7rlnZ+y+QgsJdNT1IX FlSJr6Qrat4i3GsAJ/jS5Fw= Received: from mail.maildlp.com (unknown [172.19.88.163]) by canpmsgout11.his.huawei.com (SkyGuard) with ESMTPS id 4cZx1q2fhgzKm6W; Mon, 29 Sep 2025 17:37:51 +0800 (CST) Received: from dggemv706-chm.china.huawei.com (unknown [10.3.19.33]) by mail.maildlp.com (Postfix) with ESMTPS id C0DD6180044; Mon, 29 Sep 2025 17:38:01 +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; Mon, 29 Sep 2025 17:37:56 +0800 Received: from localhost.localdomain (10.50.165.33) 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.11; Mon, 29 Sep 2025 17:37:56 +0800 From: Huisong Li To: , CC: , , , , , , , , Subject: [PATCH v1 3/9] ACPI: processor: idle: Return failure when get lpi_state->arch_flags failed Date: Mon, 29 Sep 2025 17:37:48 +0800 Message-ID: <20250929093754.3998136-4-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250929093754.3998136-1-lihuisong@huawei.com> References: <20250929093754.3998136-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: kwepems100001.china.huawei.com (7.221.188.238) To kwepemn100009.china.huawei.com (7.202.194.112) Content-Type: text/plain; charset="utf-8" The architecture specific context loss flags is important for ARM. And this flag is used to control the execution of different code flows in acpi_processor_ffh_lpi_enter(). So it is better to return failure when get lpi_state->arch_flags failed. Fixes: a36a7fecfe60 ("ACPI / processor_idle: Add support for Low Power Idle= (LPI) states") Signed-off-by: Huisong Li --- drivers/acpi/processor_idle.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 681587f2614b..f36f9514b6c7 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -984,8 +984,11 @@ static int acpi_processor_evaluate_lpi(acpi_handle han= dle, if (obj_get_integer(pkg_elem + 2, &lpi_state->flags)) lpi_state->flags =3D 0; =20 - if (obj_get_integer(pkg_elem + 3, &lpi_state->arch_flags)) - lpi_state->arch_flags =3D 0; + if (obj_get_integer(pkg_elem + 3, &lpi_state->arch_flags)) { + pr_err("Get architecture specific context loss flags failed.\n"); + ret =3D -EINVAL; + goto end; + } =20 if (obj_get_integer(pkg_elem + 4, &lpi_state->res_cnt_freq)) lpi_state->res_cnt_freq =3D 1; --=20 2.33.0 From nobody Wed Oct 1 22:38:33 2025 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (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 D27B12D0C73; Mon, 29 Sep 2025 09:38:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759138695; cv=none; b=XTUYrznA3RRe5nppzJ/qGpLbEDcNi+Q1mStLSOWUl+twGQCINAfb05ZlFo7b+RS/cQ/xZnJaqcDDT97E16JUNJHI++omSRNgnPvei2+V3tpfEkR9OpFQzqRmcSHL1+rPsdsOIa0CPetg9g67/JYTy4X7J50go4R1UD1hSWaXtmM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759138695; c=relaxed/simple; bh=NTb4lUsX61zNEVNxD0FG221KpUCdLJX8HpZVWBDUEss=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BXUYDOHPoEeKalQXyJ25NMRo6yKbWtSm32BRVNSfc4xWg9WPtnFtUe/jZtc87oCHsxTXxSMfCgyc4Gp9v9UKktsaeKneAQtT+gZl86Me3JOTtOFCMNOo6XEOwtYpS5xlVr2FSp8QDDtuXE0BOnLmFlgd5Bd8X+GTndo06NFQPa0= 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=mo7Sa8Vj; arc=none smtp.client-ip=45.249.212.189 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="mo7Sa8Vj" Received: from canpmsgout12.his.huawei.com (unknown [172.19.92.144]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4cZwwh6P71zJsZ1; Mon, 29 Sep 2025 17:33:24 +0800 (CST) dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=/wkyv3RCRjtymdwhCTeRUrzyllXYW8Z+rSnNo2ni7ls=; b=mo7Sa8VjJUlWrzrugnU5PRpySx0GlmwTUWtRqX6X03t02UveqSwLecXU2eLCfFs3vN1lH4Kla lczSleQC1CzBfV02dDN/JeH2igOlsQ7e/1EhRfsn8VbYxetHSOWl6er1Q26plqAwMG93Z74aLb/ jov3Yjhg6Gt87KxUYyhW91g= Received: from mail.maildlp.com (unknown [172.19.163.17]) by canpmsgout12.his.huawei.com (SkyGuard) with ESMTPS id 4cZx255hkwznTWn; Mon, 29 Sep 2025 17:38:05 +0800 (CST) Received: from dggemv712-chm.china.huawei.com (unknown [10.1.198.32]) by mail.maildlp.com (Postfix) with ESMTPS id 750081A0188; Mon, 29 Sep 2025 17:37:57 +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; Mon, 29 Sep 2025 17:37:57 +0800 Received: from localhost.localdomain (10.50.165.33) 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.11; Mon, 29 Sep 2025 17:37:56 +0800 From: Huisong Li To: , CC: , , , , , , , , Subject: [PATCH v1 4/9] ACPI: processor: idle: Move the initialization of state->flags to acpi_processor_setup_cstates Date: Mon, 29 Sep 2025 17:37:49 +0800 Message-ID: <20250929093754.3998136-5-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250929093754.3998136-1-lihuisong@huawei.com> References: <20250929093754.3998136-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: kwepems100001.china.huawei.com (7.221.188.238) To kwepemn100009.china.huawei.com (7.202.194.112) Content-Type: text/plain; charset="utf-8" The acpi_processor_setup_cpuidle_cx() is called by acpi_processor_setup_cpuidle_dev() which is used to setup cpuidle device. However, acpi_processor_setup_cpuidle_cx() also initializes the states in acpi_idle_driver, which isn't good. And acpi_processor_setup_cstates() is aimed to initializes cstates in acpi_idle_driver. So the initialization of state->flags should be here. Signed-off-by: Huisong Li --- drivers/acpi/processor_idle.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index f36f9514b6c7..5684925338b3 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -737,13 +737,11 @@ static int acpi_processor_setup_cpuidle_cx(struct acp= i_processor *pr, { int i, count =3D ACPI_IDLE_STATE_START; struct acpi_processor_cx *cx; - struct cpuidle_state *state; =20 if (max_cstate =3D=3D 0) max_cstate =3D 1; =20 for (i =3D 1; i < ACPI_PROCESSOR_MAX_POWER && i <=3D max_cstate; i++) { - state =3D &acpi_idle_driver.states[count]; cx =3D &pr->power.states[i]; =20 if (!cx->valid) @@ -751,15 +749,6 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi= _processor *pr, =20 per_cpu(acpi_cstate[count], dev->cpu) =3D cx; =20 - if (lapic_timer_needs_broadcast(pr, cx)) - state->flags |=3D CPUIDLE_FLAG_TIMER_STOP; - - if (cx->type =3D=3D ACPI_STATE_C3) { - state->flags |=3D CPUIDLE_FLAG_TLB_FLUSHED; - if (pr->flags.bm_check) - state->flags |=3D CPUIDLE_FLAG_RCU_IDLE; - } - count++; if (count =3D=3D CPUIDLE_STATE_MAX) break; @@ -818,6 +807,15 @@ static int acpi_processor_setup_cstates(struct acpi_pr= ocessor *pr) if (cx->type !=3D ACPI_STATE_C1 && !acpi_idle_fallback_to_c1(pr)) state->enter_s2idle =3D acpi_idle_enter_s2idle; =20 + if (lapic_timer_needs_broadcast(pr, cx)) + state->flags |=3D CPUIDLE_FLAG_TIMER_STOP; + + if (cx->type =3D=3D ACPI_STATE_C3) { + state->flags |=3D CPUIDLE_FLAG_TLB_FLUSHED; + if (pr->flags.bm_check) + state->flags |=3D CPUIDLE_FLAG_RCU_IDLE; + } + count++; if (count =3D=3D CPUIDLE_STATE_MAX) break; --=20 2.33.0 From nobody Wed Oct 1 22:38:33 2025 Received: from canpmsgout01.his.huawei.com (canpmsgout01.his.huawei.com [113.46.200.216]) (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 C5B882C15BF; Mon, 29 Sep 2025 09:38:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.216 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759138688; cv=none; b=SnRlNFZTKWNbWWewp4oT5rF5bkIV2zj+nxTIMpi5UPUg9LS1XQeHvj/oO3N9OTbmAUxqyna7A4WjjLf/BTpUdo1/EfeR8MBjPetG06QVOY6GfcD5pTPhfIiBz+PZ28jXP1C59Vz8I3km87EG+UdPjyuHKxRuItygtGVUiDp80ao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759138688; c=relaxed/simple; bh=PCn+2NpYXNrTtMrEmgk/+v6MC0n2XLP6X3PNqVhZut0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NzPeki9i03ASHi3dcbZahmjsfFfwtmKjPz404/VawDnrAdsqv9+wcrABmgbzS9nMf/OUvTLO8pr/x+yJkwo6g7LLbVH8Jsx5OLXvgCmLR9o2RxHm6xzIxNe8kLtI1gvEz5YlIcLXUTBA0EqlL/FRClLbK6kwhR3RnzRyLWFZias= 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=E0KCWgMf; arc=none smtp.client-ip=113.46.200.216 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="E0KCWgMf" dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=8dVWRgn/1PPWXrvTyzsdcit7ANql16CIpeq1DEA+YKo=; b=E0KCWgMfC3GiaFCah31QN2vXY6uWZDnp4VUO7MUz8SRnRUlBNvo7lmWAHZJjQNk2EmCuYekqu Vkhi3H7ZCQovMl19oRRpfG0sgxJEhzmV6XliJHoGZ/9VBoIXBSgmO2HL5xLf+dSThokAgAm7GEf sTZ/w/hpZ3aaLZbQva/gz1I= Received: from mail.maildlp.com (unknown [172.19.163.48]) by canpmsgout01.his.huawei.com (SkyGuard) with ESMTPS id 4cZx1W3R3lz1T4Fq; Mon, 29 Sep 2025 17:37:35 +0800 (CST) Received: from dggemv705-chm.china.huawei.com (unknown [10.3.19.32]) by mail.maildlp.com (Postfix) with ESMTPS id DF5D41800B1; Mon, 29 Sep 2025 17:37:57 +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; Mon, 29 Sep 2025 17:37:57 +0800 Received: from localhost.localdomain (10.50.165.33) 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.11; Mon, 29 Sep 2025 17:37:56 +0800 From: Huisong Li To: , CC: , , , , , , , , Subject: [PATCH v1 5/9] ACPI: processor: idle: Add the verification of processor FFH LPI state Date: Mon, 29 Sep 2025 17:37:50 +0800 Message-ID: <20250929093754.3998136-6-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250929093754.3998136-1-lihuisong@huawei.com> References: <20250929093754.3998136-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: kwepems100001.china.huawei.com (7.221.188.238) To kwepemn100009.china.huawei.com (7.202.194.112) Content-Type: text/plain; charset="utf-8" Both ARM64 and RISCV architecture would validate Entry Method of LPI state and SBI HSM or PSCI cpu suspend. Driver should return failure if FFH of LPI state are not ok. Fixes: a36a7fecfe60 ("ACPI / processor_idle: Add support for Low Power Idle= (LPI) states") Signed-off-by: Huisong Li --- drivers/acpi/processor_idle.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 5684925338b3..b0d6b51ee363 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1264,7 +1264,7 @@ static int acpi_processor_setup_cpuidle_dev(struct ac= pi_processor *pr, =20 dev->cpu =3D pr->id; if (pr->flags.has_lpi) - return acpi_processor_ffh_lpi_probe(pr->id); + return 0; =20 return acpi_processor_setup_cpuidle_cx(pr, dev); } @@ -1275,7 +1275,13 @@ static int acpi_processor_get_power_info(struct acpi= _processor *pr) =20 ret =3D acpi_processor_get_lpi_info(pr); if (ret) - ret =3D acpi_processor_get_cstate_info(pr); + return acpi_processor_get_cstate_info(pr); + + if (pr->flags.has_lpi) { + ret =3D acpi_processor_ffh_lpi_probe(pr->id); + if (ret) + pr_err("Processor FFH LPI state is invalid.\n"); + } =20 return ret; } --=20 2.33.0 From nobody Wed Oct 1 22:38:33 2025 Received: from canpmsgout08.his.huawei.com (canpmsgout08.his.huawei.com [113.46.200.223]) (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 AB04A2C3272; Mon, 29 Sep 2025 09:38:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.223 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759138692; cv=none; b=OowUTBYVjSAAdRxymaF91di9ALzx+y9b9Bn4uqFtDfoEMK9uB0dgaR7Sq+mvjcLcFQ+FwNoJe7PuxFUuBobvlDGDvBaHgx2nsTQeqL327jFnacXDOlK1dgu8DIJiLm0gdqo4tx3NY932m2aVrLjNRGVqs/al2VPOulbuRzLBYUk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759138692; c=relaxed/simple; bh=tubl72UhDrFHQVJsm/Yz9qp/H+Ga2SHiF+48nRsljmI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f23j+h3eLirqEdagZJT/I1/xNB0Te1XDqPUlTEYzVVl+TA47vLolLlv3EWoj+HToTM0cz0ZtUm5hzQXqkxDEMOp7YuehNjmpsPB8aFFo+IkQgBQfDkWsGe4dIJtUYujesePiuxB2qG1WrA1lFE5EyFX5z2sSY2Ghii2DVuvw9U4= 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=G5ZzCj2y; arc=none smtp.client-ip=113.46.200.223 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="G5ZzCj2y" dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=tNDOWXHGWI4bT/ATvsza4bIqskro5wdK9eUa6kqQ8n4=; b=G5ZzCj2yANq6y40ZHll+Q18smpMQAysWPMm6YZxIeSeZ0V5MUNdGtMFba+XibdE0OWDbkxV4u VSHc1AW9mpnDzK9UJorlxSoxyOjpspDp6cET4fQJ5Ueo3RPAUFWRbONstCK2Sv4TrpaoGWAGX94 NHnmafIaZRKy0SMXmN/RQDg= Received: from mail.maildlp.com (unknown [172.19.88.163]) by canpmsgout08.his.huawei.com (SkyGuard) with ESMTPS id 4cZx1q2QbQzmVl6; Mon, 29 Sep 2025 17:37:51 +0800 (CST) Received: from dggemv706-chm.china.huawei.com (unknown [10.3.19.33]) by mail.maildlp.com (Postfix) with ESMTPS id C76F01800CF; Mon, 29 Sep 2025 17:38:01 +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; Mon, 29 Sep 2025 17:37:58 +0800 Received: from localhost.localdomain (10.50.165.33) 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.11; Mon, 29 Sep 2025 17:37:57 +0800 From: Huisong Li To: , CC: , , , , , , , , Subject: [PATCH v1 6/9] ACPI: processor: idle: Do not change power states if get power info failed Date: Mon, 29 Sep 2025 17:37:51 +0800 Message-ID: <20250929093754.3998136-7-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250929093754.3998136-1-lihuisong@huawei.com> References: <20250929093754.3998136-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: kwepems100001.china.huawei.com (7.221.188.238) To kwepemn100009.china.huawei.com (7.202.194.112) Content-Type: text/plain; charset="utf-8" Driver will update power states when processor power states have been changed. To prevent any other abnormal issues, here add the verification for the result of getting power information, don't change power states and one error log when get power information failed. Fixes: f427e5f1cf75 ("ACPI / processor: Get power info before updating the = C-states") Signed-off-by: Huisong Li --- drivers/acpi/processor_idle.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index b0d6b51ee363..92b231f5d514 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1315,6 +1315,7 @@ int acpi_processor_power_state_has_changed(struct acp= i_processor *pr) int cpu; struct acpi_processor *_pr; struct cpuidle_device *dev; + int ret =3D 0; =20 if (disabled_by_idle_boot_param()) return 0; @@ -1344,16 +1345,20 @@ int acpi_processor_power_state_has_changed(struct a= cpi_processor *pr) } =20 /* Populate Updated C-state information */ - acpi_processor_get_power_info(pr); - acpi_processor_setup_cpuidle_states(pr); + ret =3D acpi_processor_get_power_info(pr); + if (ret) + pr_err("Get processor-%u power information failed.\n", + pr->id); + else + acpi_processor_setup_cpuidle_states(pr); =20 /* Enable all cpuidle devices */ for_each_online_cpu(cpu) { _pr =3D per_cpu(processors, cpu); if (!_pr || !_pr->flags.power_setup_done) continue; - acpi_processor_get_power_info(_pr); - if (_pr->flags.power) { + ret =3D acpi_processor_get_power_info(_pr); + if (!ret && _pr->flags.power) { dev =3D per_cpu(acpi_cpuidle_device, cpu); acpi_processor_setup_cpuidle_dev(_pr, dev); cpuidle_enable_device(dev); @@ -1363,7 +1368,7 @@ int acpi_processor_power_state_has_changed(struct acp= i_processor *pr) cpus_read_unlock(); } =20 - return 0; + return ret; } =20 void acpi_processor_register_idle_driver(void) --=20 2.33.0 From nobody Wed Oct 1 22:38:33 2025 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 C46C02D3A80; Mon, 29 Sep 2025 09:38:14 +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=1759138698; cv=none; b=Ox1m6gNA//6+DpwuIBg9B00LGF4mH7XcZ1Lnpgz1HN1KX/c/mdAh+MIPeIF/9lg4aYFHpXwxhaXt5uWj6GguWqpYdsSCewmHEKD6yP+zw14Bdh65YFaYV1wyL0mV2bJYTNd4V47dgCEFv7dJoRJMq6Da521N/soD+M2Ehc+GxtY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759138698; c=relaxed/simple; bh=s9pgRD/nvyiC3pYMU/ZclMD5eVITzp/+oj2PQPt/mpE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ReFJz0r1dCBe8f4USroe+45ylO4V4ASdMQdKbZO4tBczLvLkhoc0sz1ucCG9dc53dLANLWoJ3UDYwEevqoCS1oCrXUVBUZ90VMB3GoxQAhScmuc4fe23emA+AEqWwATz3aW1IORmepjMUkGIH+vrRQqGBnvPIVo5JNnkCMFoq8U= 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=mrzoYxo5; 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="mrzoYxo5" Received: from canpmsgout11.his.huawei.com (unknown [172.19.92.148]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4cZx1j0cHGzvXFJ; Mon, 29 Sep 2025 17:37:45 +0800 (CST) dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=9hK46zEIfo+lO5v1S04j0fHnzaTj1dMCptjN/v2+PDI=; b=mrzoYxo5XHsOZuAxjCg1+uA8m4Hx5Dt3Y382K0huJE4O+9PwA9ABrbRPcCyu9FaiivgLTtrwE xn/7fHwny7CAa3DE2ATl/JEw75EMT7DDHgEiFQfYKOJO/XlvzIV5///PYKkj2VU0yLewt8GiI9+ GyrXMX0R7Mv+Qwfdyr/gzyI= Received: from mail.maildlp.com (unknown [172.19.88.214]) by canpmsgout11.his.huawei.com (SkyGuard) with ESMTPS id 4cZx1m2gZRzKm6W; Mon, 29 Sep 2025 17:37:48 +0800 (CST) Received: from dggemv712-chm.china.huawei.com (unknown [10.1.198.32]) by mail.maildlp.com (Postfix) with ESMTPS id C0A471A016C; Mon, 29 Sep 2025 17:37:58 +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; Mon, 29 Sep 2025 17:37:58 +0800 Received: from localhost.localdomain (10.50.165.33) 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.11; Mon, 29 Sep 2025 17:37:57 +0800 From: Huisong Li To: , CC: , , , , , , , , Subject: [PATCH v1 7/9] ACPI: processor: idle: Remove died codes about the verification of cstate count Date: Mon, 29 Sep 2025 17:37:52 +0800 Message-ID: <20250929093754.3998136-8-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250929093754.3998136-1-lihuisong@huawei.com> References: <20250929093754.3998136-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: kwepems100001.china.huawei.com (7.221.188.238) To kwepemn100009.china.huawei.com (7.202.194.112) Content-Type: text/plain; charset="utf-8" The acpi_processor_setup_cstates and acpi_processor_setup_cpuidle_cx will be called after successfully obtaining the power information. These setup functions have their own main role, but also verify the validity of cstate count. Actually, the acpi_processor_get_power_info_cst() will return failure if the cstate count is zero and acpi_processor_get_power_info() will return failure. So the verification of cstate count in these functions are died code. Signed-off-by: Huisong Li --- drivers/acpi/processor_idle.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 92b231f5d514..2d672afc7498 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -732,8 +732,8 @@ static int __cpuidle acpi_idle_enter_s2idle(struct cpui= dle_device *dev, return 0; } =20 -static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr, - struct cpuidle_device *dev) +static void acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr, + struct cpuidle_device *dev) { int i, count =3D ACPI_IDLE_STATE_START; struct acpi_processor_cx *cx; @@ -753,14 +753,9 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi= _processor *pr, if (count =3D=3D CPUIDLE_STATE_MAX) break; } - - if (!count) - return -EINVAL; - - return 0; } =20 -static int acpi_processor_setup_cstates(struct acpi_processor *pr) +static void acpi_processor_setup_cstates(struct acpi_processor *pr) { int i, count; struct acpi_processor_cx *cx; @@ -822,11 +817,6 @@ static int acpi_processor_setup_cstates(struct acpi_pr= ocessor *pr) } =20 drv->state_count =3D count; - - if (!count) - return -EINVAL; - - return 0; } =20 static inline void acpi_processor_cstate_first_run_checks(void) @@ -1246,7 +1236,8 @@ static int acpi_processor_setup_cpuidle_states(struct= acpi_processor *pr) if (pr->flags.has_lpi) return acpi_processor_setup_lpi_states(pr); =20 - return acpi_processor_setup_cstates(pr); + acpi_processor_setup_cstates(pr); + return 0; } =20 /** @@ -1266,7 +1257,8 @@ static int acpi_processor_setup_cpuidle_dev(struct ac= pi_processor *pr, if (pr->flags.has_lpi) return 0; =20 - return acpi_processor_setup_cpuidle_cx(pr, dev); + acpi_processor_setup_cpuidle_cx(pr, dev); + return 0; } =20 static int acpi_processor_get_power_info(struct acpi_processor *pr) --=20 2.33.0 From nobody Wed Oct 1 22:38:33 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 C55BF2C21F9; Mon, 29 Sep 2025 09:38:06 +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=1759138689; cv=none; b=Ae2lQVFf7/QKgStTLKSt7Qtrxj3YJ9qIuelGF2QedhAOGXwfyEv/HHGYtJvJRFRGbYuYKKD/yvpneMQMTJw4bk9OCXcq8C1ylQsn/B5k+eHesE6AzQyQGbzTDiiRchFMufTJFBB3ZoDDPDqGS2Tm9KWFz6l54CZmzPG3dkdsuj4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759138689; c=relaxed/simple; bh=zH1x339kthy7EbwSWXzqpQhEMlMBNP0qpMpcpW6PQHU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EbSQ3NDhw/EewqqxSqm1BWTzCxlxJ4V/PagJG1TGQYs16RPJMc2le49qG28AOgVyhUqxbxZat+qN+VVe96UkWqXE6XOYpZiBoU4SwJT9i9fvDa0D/yWuA3W9ouWaFBNKfW2gVOA1h/QQXlgbK7H7SN/Nr5QL4F/a3y6wwFHT/T0= 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=URFpKcM2; 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="URFpKcM2" dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=qTJs2ZpOerQeXEWOV9Z/f0oBIE1p3YB1jRJO+1Qveaw=; b=URFpKcM2HBF7Kcqlu3jc0EEoGikZumVcOlqvoTOddgUbmZPHkvf92ElHuIWHhCqB8qXmu3oP4 Hpi9tcEptmp7BiLwcbnVif10hfItsYWjuayiAlQCFGy5qivfFzvsGlU4ikJV7bkZ13AZLYUQQ3w lqm/8jIXtrx5ncUqeXTlS7A= Received: from mail.maildlp.com (unknown [172.19.163.252]) by canpmsgout02.his.huawei.com (SkyGuard) with ESMTPS id 4cZx1Q1vxjzcbZX; Mon, 29 Sep 2025 17:37:30 +0800 (CST) Received: from dggemv705-chm.china.huawei.com (unknown [10.3.19.32]) by mail.maildlp.com (Postfix) with ESMTPS id 651DD180B5F; Mon, 29 Sep 2025 17:37:59 +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; Mon, 29 Sep 2025 17:37:59 +0800 Received: from localhost.localdomain (10.50.165.33) 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.11; Mon, 29 Sep 2025 17:37:58 +0800 From: Huisong Li To: , CC: , , , , , , , , Subject: [PATCH v1 8/9] ACPI: processor: idle: Redefine setup idle functions to void Date: Mon, 29 Sep 2025 17:37:53 +0800 Message-ID: <20250929093754.3998136-9-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250929093754.3998136-1-lihuisong@huawei.com> References: <20250929093754.3998136-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: kwepems100001.china.huawei.com (7.221.188.238) To kwepemn100009.china.huawei.com (7.202.194.112) Content-Type: text/plain; charset="utf-8" Notice that the acpi_processor_setup_cpuidle_states() don't need to return any value because their callers don't check them anyway. In addition, acpi_processor_setup_lpi_states() wouldn't execute with failure. So redefine setup idle functions to void. No intentional functional impact. Signed-off-by: Huisong Li --- drivers/acpi/processor_idle.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 2d672afc7498..9f456a6fa584 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1183,7 +1183,7 @@ static int acpi_idle_lpi_enter(struct cpuidle_device = *dev, return -EINVAL; } =20 -static int acpi_processor_setup_lpi_states(struct acpi_processor *pr) +static void acpi_processor_setup_lpi_states(struct acpi_processor *pr) { int i; struct acpi_lpi_state *lpi; @@ -1191,7 +1191,7 @@ static int acpi_processor_setup_lpi_states(struct acp= i_processor *pr) struct cpuidle_driver *drv =3D &acpi_idle_driver; =20 if (!pr->flags.has_lpi) - return -EOPNOTSUPP; + return; =20 for (i =3D 0; i < pr->power.count && i < CPUIDLE_STATE_MAX; i++) { lpi =3D &pr->power.lpi_states[i]; @@ -1209,8 +1209,6 @@ static int acpi_processor_setup_lpi_states(struct acp= i_processor *pr) } =20 drv->state_count =3D i; - - return 0; } =20 /** @@ -1219,13 +1217,13 @@ static int acpi_processor_setup_lpi_states(struct a= cpi_processor *pr) * * @pr: the ACPI processor */ -static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr) +static void acpi_processor_setup_cpuidle_states(struct acpi_processor *pr) { int i; struct cpuidle_driver *drv =3D &acpi_idle_driver; =20 if (!pr->flags.power_setup_done || !pr->flags.power) - return -EINVAL; + return; =20 drv->safe_state_index =3D -1; for (i =3D ACPI_IDLE_STATE_START; i < CPUIDLE_STATE_MAX; i++) { @@ -1233,11 +1231,12 @@ static int acpi_processor_setup_cpuidle_states(stru= ct acpi_processor *pr) drv->states[i].desc[0] =3D '\0'; } =20 - if (pr->flags.has_lpi) - return acpi_processor_setup_lpi_states(pr); + if (pr->flags.has_lpi) { + acpi_processor_setup_lpi_states(pr); + return; + } =20 acpi_processor_setup_cstates(pr); - return 0; } =20 /** --=20 2.33.0 From nobody Wed Oct 1 22:38:33 2025 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 D936B2D0608; Mon, 29 Sep 2025 09:38:11 +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=1759138693; cv=none; b=h4hycMLG2rc1hfqW4DqMQaeAQv3O0sG0z+/oE/Puxjhfdop6JufSbhxHSsO9jKiYofuZKOc7pvtC7X2ko1LBcpnMu7QP6IDeMeiSX4cvxNZFjLF6A+XTPRJGyld7suuxPfjK6lYmxVN9qZg2r0ZOn31Gk07BC8yomGPPbvFxGnc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759138693; c=relaxed/simple; bh=zFOGrE/CYGwsYYDxIIzhVvqiouFsHkdPFeW73i51xdY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RxwT/qR01DCXiHy67bue6/VRmztebcmTtdl5y5ac7sTUkSdFWkYbrcpLtGObQW49i/4fvIrr8evb2NiasXuScBNAuxF0/kxWKOwJ/Q9gVaXdz1xiOq0AcBASXQHhkpY9dEmATYtNn/DIXtBL49l0xoNc23gag14tEcVN2YarUgU= 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=eLvwV85r; arc=none smtp.client-ip=45.249.212.188 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="eLvwV85r" Received: from canpmsgout07.his.huawei.com (unknown [172.19.92.160]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4cZx1B1418ztTsd; Mon, 29 Sep 2025 17:37:18 +0800 (CST) dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=rxoQ4li/dhzz7C7GNyqjThebbNS6Z9DLrv4WnFBVJxE=; b=eLvwV85r7/Cg3cS6yGcXSBVav1los6s18AXMlK1k5mB18LqCauQYbs2IIMm/qjJYKYnWxj+QL IPkjqBrr36F8Xz2WCTR6Kzh6mksMZ24mW4cmyfCGsY3EjHdlt1q+2v6MorVh7yPmtE3VUOz5oF8 R0COosYACcshfdbdSA24TeY= Received: from mail.maildlp.com (unknown [172.19.88.163]) by canpmsgout07.his.huawei.com (SkyGuard) with ESMTPS id 4cZx1q2JyFzLlSk; Mon, 29 Sep 2025 17:37:51 +0800 (CST) Received: from dggemv706-chm.china.huawei.com (unknown [10.3.19.33]) by mail.maildlp.com (Postfix) with ESMTPS id CE0941800D0; Mon, 29 Sep 2025 17:38:01 +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; Mon, 29 Sep 2025 17:37:59 +0800 Received: from localhost.localdomain (10.50.165.33) 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.11; Mon, 29 Sep 2025 17:37:58 +0800 From: Huisong Li To: , CC: , , , , , , , , Subject: [PATCH v1 9/9] ACPI: processor: idle: Redefine acpi_processor_setup_cpuidle_dev to void Date: Mon, 29 Sep 2025 17:37:54 +0800 Message-ID: <20250929093754.3998136-10-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250929093754.3998136-1-lihuisong@huawei.com> References: <20250929093754.3998136-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: kwepems100001.china.huawei.com (7.221.188.238) To kwepemn100009.china.huawei.com (7.202.194.112) Content-Type: text/plain; charset="utf-8" Notice that the acpi_processor_setup_cpuidle_dev() don't need to return any value because their callers don't check them anyway. So redefine the function to void. No intentional functional impact. Signed-off-by: Huisong Li --- drivers/acpi/processor_idle.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 9f456a6fa584..1c9f2911ef6c 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1246,18 +1246,17 @@ static void acpi_processor_setup_cpuidle_states(str= uct acpi_processor *pr) * @pr: the ACPI processor * @dev : the cpuidle device */ -static int acpi_processor_setup_cpuidle_dev(struct acpi_processor *pr, - struct cpuidle_device *dev) +static void acpi_processor_setup_cpuidle_dev(struct acpi_processor *pr, + struct cpuidle_device *dev) { if (!pr->flags.power_setup_done || !pr->flags.power || !dev) - return -EINVAL; + return; =20 dev->cpu =3D pr->id; if (pr->flags.has_lpi) - return 0; + return; =20 acpi_processor_setup_cpuidle_cx(pr, dev); - return 0; } =20 static int acpi_processor_get_power_info(struct acpi_processor *pr) --=20 2.33.0