From nobody Wed Oct 1 23:46:54 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