From patchwork Tue Jun 6 14:00:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Rui" X-Patchwork-Id: 103852 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3434328vqr; Tue, 6 Jun 2023 07:24:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6D8/FgKXlmwgoOnn7eBR44wP8GM7/aSwtxAJ4dKiUACgPuwiZflE7zA6vqOItH3z4yMnMC X-Received: by 2002:ac8:7c46:0:b0:3f5:37eb:1fba with SMTP id o6-20020ac87c46000000b003f537eb1fbamr2723505qtv.23.1686061491137; Tue, 06 Jun 2023 07:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686061491; cv=none; d=google.com; s=arc-20160816; b=fCVLflrjKHWUE6/ziOc13XZd32JvX0lP3iH0aHBEgU2yL4AAxnzDCA+K4Vs1zA/PJ8 um0QBH2uC21zK4Rdo6xzC6WEwFVZxtMYlwlN6Yk8ogONvqoWQViph3KMDeTeECbQWvOZ //2RHeuabBOE/tglNUrXwgCpudksHmiPavDlcxS6lwzg6p1Rerjnywkwtf1j6ef2RYO2 bhsMXbOIKt8FFd/R19xtkg7XzaG4izYvWuDee7MIz93ViPAA2THiGlQAGoT4Xn4FCZ3B mr7rRdvKR4jdDqIzpsRPTLBcf2qEL3GPfCCrpXWTYiRPnzuBlvPBzw8Rr9qcOgO20r+i vmCw== 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:dkim-signature; bh=iJKYwdu1Lpl9aRfpV6JbZvrtPxprqv/QJa7Aj9Nn7Qo=; b=zJmIafmTujo7eZ4npyK6U6lMR47h/A70U9Va6hzP9YEac5qFP5x6uJyZHKI3VQ2LvW dMWNUmoCUs6DPokPH2gYT5YaiOy78VUviExeZYDHApjpAKKdTPfUoy1zy5e0iSYSKgrp lYQtt4dOgJYEUr1BpIIevIPPk8jGINHJYmW+uyTsBD+2JJxYnTZokJx9RpD+DXL1D0ON ZT6tDLSZHQqBIqRUhLt0Y5nOMZUa6zh9xS8DtG8dGxMGD5tfoCll+LyiI9WZH9hyhtJn 8rkj9In7xcLgCW/Pb+oletly0+XrJZ6zBolpYl0iEnICiajWAUmIPx3wgI3ghmVlD/JG QGJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RaNkACGu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b4-20020ac85bc4000000b003d53cbf0ecbsi4065931qtb.413.2023.06.06.07.24.35; Tue, 06 Jun 2023 07:24:51 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=RaNkACGu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237522AbjFFOAT (ORCPT + 99 others); Tue, 6 Jun 2023 10:00:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237283AbjFFOAO (ORCPT ); Tue, 6 Jun 2023 10:00:14 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 608F28F; Tue, 6 Jun 2023 07:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686060013; x=1717596013; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=+YfBe28FJBeWLtVuxtwibWtJc96Mf0mg0trJtgQ5LNo=; b=RaNkACGuPWjLX49AcNF2OIeE2kh2L9B2OBm73zV0cikAwhbcYybG0JHT HP1VeLo2k7SKVZZNtq32N7MBqeSQmI2BWE88d4SgbMRsharbNZ1qFDoxr 1elRVUNcdRLC/+Ui/qUZ3u0BckD6GUaQh+xTOpemfj+1jZmMQsiqAyptX 4tvwrEomkghPayjX4p91AwLZ0SqUnmrDOFsF2gA8UppeLRYbKqI7SnFer 3+cfF5CrmWiBDN3CbCZE5J706juFi0TQ6PkvX4sgnaQ3vrSaZWFxiBZaz IuOZNoE91V8flp+CoU+nUiq+K8BV8kfDJDMbvyEu5HOdmd5usrSagOUXo g==; X-IronPort-AV: E=McAfee;i="6600,9927,10732"; a="337030889" X-IronPort-AV: E=Sophos;i="6.00,221,1681196400"; d="scan'208";a="337030889" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2023 07:00:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10732"; a="955762442" X-IronPort-AV: E=Sophos;i="6.00,221,1681196400"; d="scan'208";a="955762442" Received: from lwang35-mobl1.ccr.corp.intel.com (HELO rzhang1-mobl7.ccr.corp.intel.com) ([10.254.212.138]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2023 07:00:11 -0700 From: Zhang Rui To: linux-pm@vger.kernel.org, rafael.j.wysocki@intel.com, daniel.lezcano@linaro.org Cc: linux-kernel@vger.kernel.org, arnd@arndb.de Subject: [PATCH] powercap: intel_rapl: Fix CONFIG_IOSF_MBI dependency Date: Tue, 6 Jun 2023 22:00:00 +0800 Message-Id: <20230606140000.385223-1-rui.zhang@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767963613763402693?= X-GMAIL-MSGID: =?utf-8?q?1767963613763402693?= After commit 3382388d7148 ("intel_rapl: abstract RAPL common code"), accessing to IOSF_MBI interface is done in the RAPL common code. Thus it is the CONFIG_INTEL_RAPL_CORE that has dependency of CONFIG_IOSF_MBI, while CONFIG_INTEL_RAPL_MSR does not. This problem was not exposed previously because all the previous RAPL common code users, aka, the RAPL MSR and MMIO I/F drivers, have CONFIG_IOSF_MBI selected. Fix the CONFIG_IOSF_MBI dependency in RAPL code. This also fixes a build time failure when the RAPL TPMI I/F driver is introduced without selecting CONFIG_IOSF_MBI. x86_64-linux-ld: vmlinux.o: in function `set_floor_freq_atom': intel_rapl_common.c:(.text+0x2dac9b8): undefined reference to `iosf_mbi_write' x86_64-linux-ld: intel_rapl_common.c:(.text+0x2daca66): undefined reference to `iosf_mbi_read' Reference to iosf_mbi.h is also removed from the RAPL MSR I/F driver. Fixes: 3382388d7148 ("intel_rapl: abstract RAPL common code") Reported-by: Arnd Bergmann Link: https://lore.kernel.org/all/20230601213246.3271412-1-arnd@kernel.org Signed-off-by: Zhang Rui --- drivers/powercap/Kconfig | 4 +++- drivers/powercap/intel_rapl_msr.c | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/powercap/Kconfig b/drivers/powercap/Kconfig index 90d33cd1b670..b063f7511773 100644 --- a/drivers/powercap/Kconfig +++ b/drivers/powercap/Kconfig @@ -18,10 +18,12 @@ if POWERCAP # Client driver configurations go here. config INTEL_RAPL_CORE tristate + depends on PCI + select IOSF_MBI config INTEL_RAPL tristate "Intel RAPL Support via MSR Interface" - depends on X86 && IOSF_MBI + depends on X86 && PCI select INTEL_RAPL_CORE help This enables support for the Intel Running Average Power Limit (RAPL) diff --git a/drivers/powercap/intel_rapl_msr.c b/drivers/powercap/intel_rapl_msr.c index a27673706c3d..be118d46f32e 100644 --- a/drivers/powercap/intel_rapl_msr.c +++ b/drivers/powercap/intel_rapl_msr.c @@ -22,7 +22,6 @@ #include #include -#include #include #include