Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6484893imu; Wed, 30 Jan 2019 15:55:19 -0800 (PST) X-Google-Smtp-Source: ALg8bN7jdwE41nZ0dM2+qyyzPxULqigKP5G1zn+hOJ8KSn7ZUiSENkWByWyiyY3mAai0rev/5gK0 X-Received: by 2002:a63:5518:: with SMTP id j24mr28908026pgb.208.1548892519905; Wed, 30 Jan 2019 15:55:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548892519; cv=none; d=google.com; s=arc-20160816; b=IwfmQrW28HvUXveoNNRUF7rAJI9xTBX5sp5kt6f3fOjI26RVAC4iQyQB0lu/i9f6lp GDf5DtegfopZkQsv+PoCI43eQINFf1sgFwKMsRHmF8toUuq97Aw9pjLa2jH54cpkBNyJ cF/dpxAeVoWwcENIPxtA9CpBwAWyekR49Non/YenIaD1xW84APYNLuGdtEEgn/DV6sW2 qr0lvn++m1nPFIOIM3pADIfcb56iSiLpy53qCoqcLZ58M+cVMoxSUDd63XKzQb6/mytR Cre9Qc73e9U9oV4FtwXcpj+Rbwgj9afAs4XIA8ceqQpaAWLRXthCN4Razmq/BEh5867s 2rWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8/2rsYPj0KQlanB3q1n0ex+/xhWFv7gIdSaEzhgu5o0=; b=IGOkXxtEUG0s7Zhpw/LHcJEtT0U1DVm/mjT2+ueHHLZPoawnX+/URs7gwF2czSsDLP 707cXHLorVNEvPwmt5eJVdFWMehigu7NEp1rnpoojqD9Pm63hk5HByAPTay8mdM+o5VF inLnep3QFMTTQ5jFkYEk6/O4JbkmB0f0iAZ263Tq8ET1HGM5YtYD9QYMWHlR3YdoWpzi ZAVFwbzvrGfDsdPE4kA/SVHTsEI7gUZBMRu4HW8tGrYUZweXBQRLNXpEnjcBV0P5uUB+ cup4I8gkpoSQmOm9nbVS91a3jWDN586MyY3CdTzZWCMMFp3l3esCxpFJlUonMk3BYR8A lKXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2si2313275pgh.565.2019.01.30.15.55.04; Wed, 30 Jan 2019 15:55:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727269AbfA3Xy3 (ORCPT + 99 others); Wed, 30 Jan 2019 18:54:29 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:53572 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbfA3Xy2 (ORCPT ); Wed, 30 Jan 2019 18:54:28 -0500 Received: from 79.184.255.169.ipv4.supernova.orange.pl (79.184.255.169) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.183) id 46bfe9b463a924f0; Thu, 31 Jan 2019 00:54:25 +0100 From: "Rafael J. Wysocki" To: Amit Kucheria Cc: linux-kernel@vger.kernel.org, Viresh Kumar , Zhang Rui , Eduardo Valentin , Daniel Lezcano , Sudeep Holla , Taniya Das , Anson Huang , linux-pm@vger.kernel.org Subject: Re: [PATCH v5 1/9] thermal: cpu_cooling: Require thermal core to be compiled in Date: Thu, 31 Jan 2019 00:53:19 +0100 Message-ID: <4397205.6VUyJNULaB@aspire.rjw.lan> In-Reply-To: <0d63ca44cff5f47ef0102b2c86b4fe9eca9b658b.1548737236.git.amit.kucheria@linaro.org> References: <0d63ca44cff5f47ef0102b2c86b4fe9eca9b658b.1548737236.git.amit.kucheria@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, January 29, 2019 5:55:07 AM CET Amit Kucheria wrote: > The CPU cooling driver (cpu_cooling.c) allows the platform's cpufreq > driver to register as a cooling device and cool down the platform by > throttling the CPU frequency. In order to be able to auto-register a > cpufreq driver as a cooling device from the cpufreq core, we need access > to code inside cpu_cooling.c which, in turn, accesses code inside > thermal core. > > CPU_FREQ is a bool while THERMAL is tristate. In some configurations > (e.g. allmodconfig), CONFIG_THERMAL ends up as a module while > CONFIG_CPU_FREQ is compiled in. This leads to following error: > > drivers/cpufreq/cpufreq.o: In function `cpufreq_offline': > cpufreq.c:(.text+0x407c): undefined reference to `cpufreq_cooling_unregister' > drivers/cpufreq/cpufreq.o: In function `cpufreq_online': > cpufreq.c:(.text+0x70c0): undefined reference to `of_cpufreq_cooling_register' > > Given that platforms using CPU_THERMAL usually want it compiled-in so it > is available early in boot, make CPU_THERMAL depend on THERMAL being > compiled-in instead of allowing it to be a module. > > As a result of this change, get rid of the ugly (!CPU_THERMAL || > THERMAL) dependency in all cpufreq drivers using CPU_THERMAL. > > Suggested-by: Rafael J. Wysocki > Signed-off-by: Amit Kucheria > Acked-by: Viresh Kumar > --- > drivers/cpufreq/Kconfig | 3 --- > drivers/cpufreq/Kconfig.arm | 5 ----- > drivers/thermal/Kconfig | 1 + > 3 files changed, 1 insertion(+), 8 deletions(-) > > diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig > index 608af20a3494..b22e6bba71f1 100644 > --- a/drivers/cpufreq/Kconfig > +++ b/drivers/cpufreq/Kconfig > @@ -207,8 +207,6 @@ comment "CPU frequency scaling drivers" > config CPUFREQ_DT > tristate "Generic DT based cpufreq driver" > depends on HAVE_CLK && OF > - # if CPU_THERMAL is on and THERMAL=m, CPUFREQ_DT cannot be =y: > - depends on !CPU_THERMAL || THERMAL > select CPUFREQ_DT_PLATDEV > select PM_OPP > help > @@ -327,7 +325,6 @@ endif > config QORIQ_CPUFREQ > tristate "CPU frequency scaling driver for Freescale QorIQ SoCs" > depends on OF && COMMON_CLK && (PPC_E500MC || ARM || ARM64) > - depends on !CPU_THERMAL || THERMAL > select CLK_QORIQ > help > This adds the CPUFreq driver support for Freescale QorIQ SoCs > diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm > index 688f10227793..ca8567c3152c 100644 > --- a/drivers/cpufreq/Kconfig.arm > +++ b/drivers/cpufreq/Kconfig.arm > @@ -29,8 +29,6 @@ config ARM_ARMADA_37XX_CPUFREQ > config ARM_BIG_LITTLE_CPUFREQ > tristate "Generic ARM big LITTLE CPUfreq driver" > depends on ARM_CPU_TOPOLOGY && HAVE_CLK > - # if CPU_THERMAL is on and THERMAL=m, ARM_BIT_LITTLE_CPUFREQ cannot be =y > - depends on !CPU_THERMAL || THERMAL > select PM_OPP > help > This enables the Generic CPUfreq driver for ARM big.LITTLE platforms. > @@ -38,7 +36,6 @@ config ARM_BIG_LITTLE_CPUFREQ > config ARM_SCPI_CPUFREQ > tristate "SCPI based CPUfreq driver" > depends on ARM_SCPI_PROTOCOL && COMMON_CLK_SCPI > - depends on !CPU_THERMAL || THERMAL > help > This adds the CPUfreq driver support for ARM platforms using SCPI > protocol for CPU power management. > @@ -93,7 +90,6 @@ config ARM_KIRKWOOD_CPUFREQ > config ARM_MEDIATEK_CPUFREQ > tristate "CPU Frequency scaling support for MediaTek SoCs" > depends on ARCH_MEDIATEK && REGULATOR > - depends on !CPU_THERMAL || THERMAL > select PM_OPP > help > This adds the CPUFreq driver support for MediaTek SoCs. > @@ -233,7 +229,6 @@ config ARM_SA1110_CPUFREQ > config ARM_SCMI_CPUFREQ > tristate "SCMI based CPUfreq driver" > depends on ARM_SCMI_PROTOCOL || COMPILE_TEST > - depends on !CPU_THERMAL || THERMAL > select PM_OPP > help > This adds the CPUfreq driver support for ARM platforms using SCMI > diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig > index 30323426902e..58bb7d72dc2b 100644 > --- a/drivers/thermal/Kconfig > +++ b/drivers/thermal/Kconfig > @@ -152,6 +152,7 @@ config CPU_THERMAL > bool "generic cpu cooling support" > depends on CPU_FREQ > depends on THERMAL_OF > + depends on THERMAL=y > help > This implements the generic cpu cooling mechanism through frequency > reduction. An ACPI version of this already exists > Applied, thanks!