Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1867071rwb; Fri, 19 Aug 2022 10:42:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR7V41AYRj/sudJjPsbODxXhR3rNI9ouo/eJQii6DfStTKb2BZP6uisKqHsrbdVb8qFv1RdF X-Received: by 2002:a17:903:1209:b0:16c:ece7:f68b with SMTP id l9-20020a170903120900b0016cece7f68bmr8446475plh.112.1660930934797; Fri, 19 Aug 2022 10:42:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930934; cv=none; d=google.com; s=arc-20160816; b=Mv3NbljCsY9WrpHJgZMqZ7Fglzq1gABkGl4fGQLqBNGRbJTUmW36ia1lq3td7jXH+o xfQuZuRPjGC4eZHJoXDI/5eXQ5GSe7WGnSs3/UABfnVcgGgxMvH2qswp2K9DryOa67Hl 2VyrYiFmYaVDRkFhOMPCJ0wluJ/io1ACELwJo3nt7Casc5WqPwYYsegV5aDyT3UgwhHN IuIAyi+oZxNSKYpLzBffAxnWChc3V25ZhKdizA/+RJo0t+Z6sVyQudUu+LVIJuROTtNi mg3c/SUJCGIAZr+bI7xbSEtahUUnSQeCxTJ6thZFei6WxDOCppcrvkt9D1gV3bqDIj4J A1Pg== 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 :message-id:date:subject:cc:to:from; bh=prplgp81gGgv25VBNXC3P72oApZ7PTj3b7L3oiHD7qY=; b=Pr6dit/CBEE2OJHzmDMov5EMCFTHJWnflLyJXXMBh3Gqq9aaSo1RikWyDBpesrXF8K fBpF6xqGVxMZ7jt+WvvHuRNVX4xwW7CQbN4YVRi3NEvdRPfVL4sUkSAlzZUAtwc8l92G 2JRs6skmsnNbjTf6WJz5/lUDWjzg5gGAZ98G6Aao6/358loepoIogZ+4M436FZo6cvfQ lo7eq75IT4fVDj197nt6rtKLu3vOQgWP5AMsiKS2SRioYHfrgUfVX7hOOe0YPZPT5KRY qFNeqXsxDLV5oPrSmHEismup97AVvIHTH1AY8C0pXS4o9qtlpjC9TtCSqlZdTAo8pdfY YF8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q68-20020a634347000000b00429f677c808si4669811pga.518.2022.08.19.10.42.02; Fri, 19 Aug 2022 10:42:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350086AbiHSRHO (ORCPT + 99 others); Fri, 19 Aug 2022 13:07:14 -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 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) -- 2.37.1