Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 E46E0332610; Sat, 12 Sep 2026 11:33:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789212819; cv=none; b=pyUBQJc5csEkQAc8JxsgSbuu01bB4V8SV4Oo2oTBeLON4Ng9cE6OfholfEpjcN7UbbCjafNWsQWbT6y1gpqk8jc9LRiFmVKm1xplsI3VvlB3X1dMAApkVYBeS+ZXFcHhUi55iD018Zf8/do6/LK0OPLiWdUWGrtdFgOQthV99y8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789212819; c=relaxed/simple; bh=760p52riHhKPNsBVhsfQZQM5X8eoebscv7FxUJlO9es=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HjL0Uex9zDpwi+W/JW2k6uJybJTPX1NSuzWV7PBEYyTLrosqvkw5VSv7FdPbk5qSoFYF5k07o8VcepWaIzWvlH/NqXBo8+HJyRfrnZZB0kc0YpPjqk803d9RBXgIdU+61KaZQ9YWJpj834eH6GKdnI6e+/dCZOpjaaqzd2jtQrM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=gynFNYFp; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="gynFNYFp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4D601F000FF; Sat, 12 Sep 2026 11:33:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789212817; bh=yOlAd7ZfYgLjzwzK/qpTjDCFzCQtPCvtuF0QB2Gs9p4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gynFNYFpFrGBruW4BkWVaJDZHnAUZ95TjYWyCDNJ4kL46FRgwU0svfVjHrMWDb6vj G+nSGhheDmI5NZ0Jd6J+utoFysHLp5o6o4CJcq+v9jCggBRT5iQzarUDhltNsQKYIX I16QVBEJD6VTO9+ffcaNMO4i5kXATLXoEMO7LRJk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Huisong Li , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 6.18 1512/1518] ACPI: processor: idle: Move max_cstate update out of the loop Date: Sat, 12 Sep 2026 09:01:21 +0200 Message-ID: <20260912065657.771316937@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065623.398859879@linuxfoundation.org> References: <20260912065623.398859879@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Huisong Li [ Upstream commit 1f23194c8b8208bf3a43beb6c97d4c843197b6f6 ] 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 Link: https://patch.msgid.link/20260311065038.4151558-3-lihuisong@huawei.com Signed-off-by: Rafael J. Wysocki Stable-dep-of: 66c62e6773c5 ("ACPI: processor: Add cpuidle driver check in acpi_processor_register_idle_driver()") Signed-off-by: Sasha Levin --- 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 5edbc13723361..2de87e5011f5d 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1377,6 +1377,8 @@ void acpi_processor_register_idle_driver(void) int ret = -ENODEV; int cpu; + 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. @@ -1388,7 +1390,6 @@ void acpi_processor_register_idle_driver(void) if (!pr) continue; - acpi_processor_cstate_first_run_checks(); ret = acpi_processor_get_power_info(pr); if (!ret) { pr->flags.power_setup_done = 1; -- 2.53.0