From patchwork Thu Aug 18 21:16:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Linton X-Patchwork-Id: 598527 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 10BEBC00140 for ; Thu, 18 Aug 2022 21:24:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347096AbiHRVYq (ORCPT ); Thu, 18 Aug 2022 17:24:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347001AbiHRVYP (ORCPT ); Thu, 18 Aug 2022 17:24:15 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5DADD74E2B; Thu, 18 Aug 2022 14:16:58 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4F91D106F; Thu, 18 Aug 2022 14:16:29 -0700 (PDT) Received: from mammon-tx2.austin.arm.com (mammon-tx2.austin.arm.com [10.118.28.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9F3DC3F67D; Thu, 18 Aug 2022 14:16:27 -0700 (PDT) From: Jeremy Linton To: linux-acpi@vger.kernel.org Cc: rafael@kernel.or, lenb@kernel.org, viresh.kumar@linaro.org, robert.moore@intel.com, punit.agrawal@bytedance.com, lukasz.luba@arm.com, ionela.voinescu@arm.com, pierre.gondois@arm.com, linux-kernel@vger.kernel.org, devel@acpica.org, linux-pm@vger.kernel.org, Jeremy Linton Subject: [PATCH v3 0/2] Disable FIE on machines with slow counters Date: Thu, 18 Aug 2022 16:16:17 -0500 Message-Id: <20220818211619.4193362-1-jeremy.linton@arm.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org FIE assumes the delivered/relative perf registers are fast to read so it goes ahead and hits them quite frequently. On a couple Arm platforms though they end up in PCC regions which require mailbox handshaking with other parts of the platform. This results in a lot of overhead in the cppc_fie task. As such lets runtime disable FIE if we detect it enabled on one of those platforms. Also allow the user to manually enable/disable it via a module parameter. v1->v2: Apply Rafael's review comments. Move the MODULE_PARAM into the ifdef Fix compiler warning when ACPI_CPPC_LIB is disabled. v2->v3: Tristate the module param so FIE can be forced on/off Bump pr_debug to pr_info if FIE is disabled due to PCC regions Switch ACPI_CPPC_CPUFREQ_FIE off by default Jeremy Linton (2): ACPI: CPPC: Disable FIE if registers in PCC regions cpufreq: CPPC: Change FIE default drivers/acpi/cppc_acpi.c | 41 ++++++++++++++++++++++++++++++++++ drivers/cpufreq/Kconfig.arm | 2 +- drivers/cpufreq/cppc_cpufreq.c | 31 +++++++++++++++++++++---- include/acpi/cppc_acpi.h | 5 +++++ 4 files changed, 74 insertions(+), 5 deletions(-)