Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp141101imu; Thu, 24 Jan 2019 23:04:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN6B+rNbGcHO5wUudEdQAdACcdj0TnOPbSoikj9PtqzvZtsIw/r9q7mID5H+ND9I/gC24gH8 X-Received: by 2002:a17:902:8bc6:: with SMTP id r6mr9741642plo.67.1548399896194; Thu, 24 Jan 2019 23:04:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548399896; cv=none; d=google.com; s=arc-20160816; b=vpefRYp++KQjRyXsfLcdfdZFQslj6Uusb9F3Eknk6PWnfc6okhwGmk7n2Ry5K+gSoB Cf346oqaGBA6NSICHy8Pi2qp3XZWNM4z8wsUCRgwAmiL0+Fr68gXRwIzDBGqEqmP0m3C IX2YW6r0b/9oOFsm27pzSjavIOr+wx9AWell9qnomSOElEqj9P+9Q/o1Gxcz3mTfK1Jj T+WLbYVXrYG/5gkjRfQSAat61ED/MTVgBvP7H1nqWsnjB0NPoQ9PfvRP1RhqvLyIR9KU ySylKkvshkgdQOAm2SAHFnGi9taR5PJUTAP9dkZtvwWoyCFjsCWmCkKpR3GKuYLxsxcZ T+iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=M5tXVSorWIxjyx2W+vXR4nkHOdqq0FYsZWQiwd4C6lQ=; b=Xy0OviHQqwbTv0kF1KBz+W/C9BZ+o+f2Bt34BYx+Q+3/f6r7o2Knh3qRk8r4Rl2PNM kWukDQACtD1c2nzRpDB38C8SVRa6cIakJtIhAsMPV38FAyqh6CjiCRFCFh/O5NduqAF+ eJgIFStzXyKs3rGmSqyuWjwu4Bft+x16GW15+LPVlMNwICZQElgMK5ui92cphwfDmcE6 l0bbKLT67+yzvNygEZCsx8enO/qzDdnCswS+cDU6WIIYBA1oWN6R46hTjsIIb6AbX5Qg oqO62NiVDDBOpCsmX8lvmzgMrpiOxhGpJDfaaxkuiEI6U5G6y4+KGCaiYTUy6sD4fjV4 WafQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VumhuCF2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay4si25506456plb.235.2019.01.24.23.04.38; Thu, 24 Jan 2019 23:04:56 -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; dkim=pass header.i=@linaro.org header.s=google header.b=VumhuCF2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727969AbfAYHDA (ORCPT + 99 others); Fri, 25 Jan 2019 02:03:00 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:35928 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727864AbfAYHC7 (ORCPT ); Fri, 25 Jan 2019 02:02:59 -0500 Received: by mail-ed1-f66.google.com with SMTP id f23so6564050edb.3 for ; Thu, 24 Jan 2019 23:02:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=M5tXVSorWIxjyx2W+vXR4nkHOdqq0FYsZWQiwd4C6lQ=; b=VumhuCF2lE2V20MUI6pPWSxmHxM9lbw8uK2pFz39OqJPiVJr6A9+UcPL0jM5gEJ4dL +/cApfsQOFSMK2gSkFhu8j9LM/XfEnmi2RLwg9WSSqqAUrCIVHC20WOyad9arys8HMrm eqSjGWKel/ezVlaXpKu6lL+SBBbctZCKoCY34= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=M5tXVSorWIxjyx2W+vXR4nkHOdqq0FYsZWQiwd4C6lQ=; b=JMigKtuYQ1RMS6W5Ib+T5so9J3q5IIlfLPZn2QV4+HWuZgc9itV333n2NvJOy/0n1u FGeSmRYF4pdsD0/TVYWWsWrPtkqTOlN/bTKDU5qx/XoWn6IRoqAF3Ge/mRinYhkcPqGh 8M2Z/80PDfhCu7k2kMVoM+Ow/B+4woTlv3IyzEKDUNzGygFUDfbthHCRyDKPTMAAR26c k3QG7hSdelwQFFqVBkv0Vyzt3M8YbM+wiebWY1/gYjR+MlViD2O5rO1ya2Shewpx2cfp AYdCjg98ALavT5H9foqIltWeMUWavjFIeMEGjR8/JbiAhGMTHP72ekqrQ2GXV+OMgjty IM2A== X-Gm-Message-State: AJcUukcr0G2GaghfAk0y7ULIySSg3GckCpIMHJru9u/zYuOc2WYrMCCl Uj56Xyw0sAZIunB8GF3GlYIchvHGnZE= X-Received: by 2002:a05:6402:796:: with SMTP id d22mr9827585edy.81.1548399776747; Thu, 24 Jan 2019 23:02:56 -0800 (PST) Received: from localhost ([49.248.181.51]) by smtp.gmail.com with ESMTPSA id s19sm402863eja.52.2019.01.24.23.02.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Jan 2019 23:02:56 -0800 (PST) From: Amit Kucheria To: linux-kernel@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, viresh.kumar@linaro.org, edubezval@gmail.com, swboyd@chromium.org, dianders@chromium.org, mka@chromium.org, "Rafael J. Wysocki" , Zhang Rui , Daniel Lezcano , linux-pm@vger.kernel.org (open list:CPU FREQUENCY SCALING FRAMEWORK) Subject: [PATCHv3 1/9] thermal: cpu_cooling: Require thermal core to be compiled in Date: Fri, 25 Jan 2019 12:32:21 +0530 Message-Id: <0d63ca44cff5f47ef0102b2c86b4fe9eca9b658b.1548398851.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 -- 2.17.1