Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3674772pxb; Mon, 24 Jan 2022 15:04:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwSMD9H/eW9HHdDpECsM1bfylKvkaWTsB88tXHCUkdJuh7fZZ0hL9uE8fd8395ePCDOWZue X-Received: by 2002:a63:554d:: with SMTP id f13mr3110877pgm.357.1643065460758; Mon, 24 Jan 2022 15:04:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643065460; cv=none; d=google.com; s=arc-20160816; b=gFoOwQq8FJY69ZC3j4edTdMVYOl5p3Zd/vRH+i6jrPF2g3ieAKWbUMbvE0ES1fzM4B 9OSSBhmPz0IB1v/xFXaeGdeZJbObSAks6S5/JLTvGAhgGyL+15UaXmbHJ3EYv5k9lHYH voPFQ+qPYIYZTUDZ6jaEVhFKE+dxYgcYMEWdkRBSAYZSA8+FV5fJ+9GonZrlw50zKiM7 QctNnZdJhJJUZk1Y1k3zB9adwG8G3agSuZanzZNLCY2o2Kdf9v70R5tpetlZoKeanEAd EvXZlwCj73+0SAMoyRwvIT7/RZhmAJKTn0kFakLRZoIkdGBlRZufM/Br+5akrdwpME45 5oFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kHi/Bp1BWXPBTS2U1exQnQ46JKlHveDvuVhDDhc/KJ4=; b=AX4QdWxrkjnSxcN3da4lZgOpERDIGpefEmvRyT47HdLzlymsMA2Hd3Nq2FBz+rmVr2 CbLZ4z/IQsNLQbQ4lGpa1DYh+2t6Ftco1FQ837lDrjHmj+9vztMfjMAKWTuA/zVSmKtw of/zxVSsMtkwKKwkaglk9fMP573JQkyPoCsaXPXZo3OuItz42aVmDrjMrq6ork9Oyzyx AXdhmyljhirew1MBowf8etTkISmLx6Q1na3/CTqpPJPnf3Rwp3L0sFCU/vJ4f4DgoJ9I MPJe9jcz4SqnKDihA1dx5GM9fhh92NE1/KVzScIo5fP6VAQgljwWPKmRFyl51/L3O8mp 058w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0VBmYDQx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s11si15105340pga.720.2022.01.24.15.04.08; Mon, 24 Jan 2022 15:04:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0VBmYDQx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1841131AbiAXW5l (ORCPT + 99 others); Mon, 24 Jan 2022 17:57:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1576490AbiAXV7S (ORCPT ); Mon, 24 Jan 2022 16:59:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CBEFC0C0928; Mon, 24 Jan 2022 12:39:45 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3FC3661383; Mon, 24 Jan 2022 20:39:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24603C340E5; Mon, 24 Jan 2022 20:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056784; bh=nzPRbG+YEleZyM90F7lOhrrmw0dnK62nvAH2uKUNkoE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0VBmYDQxLtsmWtO5l3hWpq7bCCTJGrnTIqjsPTuVHsBRD8mn2TwwuKoM0IFtXx4/E CPdz/XKrVRAGTIDOuHQWZZmXcROod8Mf5eVxkahhgT4ep/evRXVosBLQfL32/CqGH/ JdNoCDaJk3KrGzOEnsy+b0x8fx0FHHWR292LTR34= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jinzhou Su , Mario Limonciello , Huang Rui , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.15 599/846] ACPI: CPPC: Check present CPUs for determining _CPC is valid Date: Mon, 24 Jan 2022 19:41:56 +0100 Message-Id: <20220124184121.692162329@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mario Limonciello [ Upstream commit 2aeca6bd02776d7f56a49a32be0dd184f204d888 ] As this is a static check, it should be based upon what is currently present on the system. This makes probeing more deterministic. While local APIC flags field (lapic_flags) of cpu core in MADT table is 0, then the cpu core won't be enabled. In this case, _CPC won't be found in this core, and return back to _CPC invalid with walking through possible cpus (include disable cpus). This is not expected, so switch to check present CPUs instead. Reported-by: Jinzhou Su Signed-off-by: Mario Limonciello Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/cppc_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 3fbb17ecce2d5..6fe28a2d387bd 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -411,7 +411,7 @@ bool acpi_cpc_valid(void) struct cpc_desc *cpc_ptr; int cpu; - for_each_possible_cpu(cpu) { + for_each_present_cpu(cpu) { cpc_ptr = per_cpu(cpc_desc_ptr, cpu); if (!cpc_ptr) return false; -- 2.34.1