From patchwork Fri Aug 19 16:25:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Linton X-Patchwork-Id: 598750 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 048C7C28B2B for ; Fri, 19 Aug 2022 17:07:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349154AbiHSRHL (ORCPT ); Fri, 19 Aug 2022 13:07:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349680AbiHSRGg (ORCPT ); Fri, 19 Aug 2022 13:06:36 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 85E8C13DEAE; Fri, 19 Aug 2022 09:27:27 -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 71A7BED1; Fri, 19 Aug 2022 09:26:25 -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 669263F66F; Fri, 19 Aug 2022 09:26:23 -0700 (PDT) From: Jeremy Linton To: linux-acpi@vger.kernel.org Cc: rafael@kernel.org, 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 v4 0/2] Disable FIE on machines with slow counters Date: Fri, 19 Aug 2022 11:25:45 -0500 Message-Id: <20220819162547.141333-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 v3->v4: No functional change, resend due to email addr issues 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(-)