From patchwork Mon Dec 6 12:29:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A. Shutemov" X-Patchwork-Id: 521653 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D233C433EF for ; Mon, 6 Dec 2021 12:30:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243115AbhLFMdf (ORCPT ); Mon, 6 Dec 2021 07:33:35 -0500 Received: from mga12.intel.com ([192.55.52.136]:62519 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243104AbhLFMde (ORCPT ); Mon, 6 Dec 2021 07:33:34 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10189"; a="217329014" X-IronPort-AV: E=Sophos;i="5.87,291,1631602800"; d="scan'208";a="217329014" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 04:30:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,291,1631602800"; d="scan'208";a="748024786" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 06 Dec 2021 04:30:01 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 797311A0; Mon, 6 Dec 2021 14:30:07 +0200 (EET) From: "Kirill A. Shutemov" To: rafael@kernel.org Cc: ak@linux.intel.com, bp@alien8.de, dan.j.williams@intel.com, dave.hansen@linux.intel.com, hpa@zytor.com, kirill.shutemov@linux.intel.com, knsathya@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, rjw@rjwysocki.net, sathyanarayanan.kuppuswamy@linux.intel.com, tglx@linutronix.de, tony.luck@intel.com, x86@kernel.org Subject: [PATCH 3/4] ACPI: processor idle: Only flush cache on entering C3 Date: Mon, 6 Dec 2021 15:29:51 +0300 Message-Id: <20211206122952.74139-4-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211206122952.74139-1-kirill.shutemov@linux.intel.com> References: <20211206122952.74139-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org According to the ACPI spec v6.4, section 8.2, cache flushing required on entering C3 power state. Avoid flushing cache on entering other power states. Signed-off-by: Kirill A. Shutemov --- 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 76ef1bcc8848..01495aca850e 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -567,7 +567,8 @@ static int acpi_idle_play_dead(struct cpuidle_device *dev, int index) { struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu); - ACPI_FLUSH_CPU_CACHE(); + if (cx->type == ACPI_STATE_C3) + ACPI_FLUSH_CPU_CACHE(); while (1) {