Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp915966rwb; Thu, 18 Aug 2022 14:51:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR7qG3SIy4CY11kvEzV/0qMdj18ylz/xJAbmvV0IzMKi72vMOP3Ygx2uJSu+OOK7agmnjeGM X-Received: by 2002:a62:1441:0:b0:536:ac1:504b with SMTP id 62-20020a621441000000b005360ac1504bmr340118pfu.71.1660859495233; Thu, 18 Aug 2022 14:51:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660859495; cv=none; d=google.com; s=arc-20160816; b=bVzo6eR/20WJ42GUr/2yaWvdBCV/K9rINo2EADurKy+/UXXIK7+H4FUB1Myn9cLTqP xxqkYMrJ4Ng8+Pjijp8lToA5K+EQFe1dAkxbryNNSMGOdSSHtUfw5py5CYWAsVd/d9US PQJfHPH4zb1YZHwS1ZpyR3F7Vfjn1Jd+smZPZsV+XD1CNzm1ZqySlVc407MnAGOG+9rR MJ9OA6m60gIqNBz7A6ePHJxby0JF8pdotBUFTihT9DUK1V+0L4bNXmKjjSZFWimFTg2h cOqpkf70MwyxGD1mGN1UPhjYuQts+QF/BOmbe/Dcw5zKi5Jm1GJbX3qos3ikNO/4vdv4 6lWA== 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=7pQpjl0+9f9TtXnwutw8gwwzyfPdwQsICXBXxcNL5Ws=; b=ZTe2Lt6zz0VPSxaeRZPdWPvvJrjN65HlFmalLe2m+tvsETeegzxWT0PRfRMPFXQUh/ 1t8aDWk/6+AnC1n5qk6g6cCGU0w12WNSbMJQ5uruv1fgMDTU6HQrilvGJgXsZR/MjaTV 7P8mOSexcFOiBE+2X3Cz+Ae8chKtJjqUoqOJWnz43P+PQSW875QRczrxisTRxKaJaszH ACu1HAW2nF/cosBlwi22fdMh4lem8zuzf5+oPIYIO2Y4G7432yjlOpfOxSaG/jhT8zSu fn/aM/3cxXDzC3NQxbfKr6YIypm2cAFnnhUOU/atzfacyj768BBx3O2UV8xsvZAhuA2X AkIg== 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 h11-20020a056a00218b00b0052e3d468e9esi2529131pfi.369.2022.08.18.14.51.24; Thu, 18 Aug 2022 14:51:35 -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 S1347130AbiHRVYr (ORCPT + 99 others); Thu, 18 Aug 2022 17:24:47 -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 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 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