Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1737538imu; Thu, 17 Jan 2019 02:23:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN6s1sQjWGH12X0xToeTsHWn3uB3IIN3Ej7AlYhrZxuHxU+/sMjhHIYiDlKT/RNh/Vc2/2gT X-Received: by 2002:a63:3204:: with SMTP id y4mr12910762pgy.41.1547720621986; Thu, 17 Jan 2019 02:23:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547720621; cv=none; d=google.com; s=arc-20160816; b=FyN2az8ifEInGlSg5Fm/4N0PYAX/nlUTT9zdGGsz6Ot1YbHYeHB6UhEUuSrOo/rbbv gpyhrfWR8rj9kohjts/OhN4qfLXAEHvtdjSkMNPSaPCKWOXf/DjgJbU4RUZjCVKdPiKf 9obcZe8lohr26XTDTROCJlnm6Z+2IWRxq4mE2Z+z/bLB8MM6NCODQgr7AcoRrldvm8fz cZK7BwiGz5rVoXAKJ0ByMerEXzZbPIfKVsNsrdx9vkdwIzf1iS1kpO8/KZvNZ7UJuPEy 1rwgvLXLUBM6Mbjgv/8Njqm6jxnI8RBaNItdoMK15O7P6v+fINg+gSj4Wg6xQGuIHI6c FThQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=oqgQwgs6rpK2rfGYhVxoq0wejotpg6+UVg0B/eSnCeE=; b=X3z1dsjvdL6+EHJc08tQ4cuhpMem4CYhq80jkzbLOfO1zHwRJNrbHA1Uf8fufzlogk 7j2xPkuqw2ZPX7gynDWTIHrW/DQwxer4kDowoFvv0HpO3rG2EzP6h2UqUu4kkxJK29y7 97LXnnBJcwIzx8FLjtoZPxGhVjFK9PumEk8R8GYqcbuBZZHoN03BdTDd96AZmjUTmL0/ w9gkYD6Ob87o3tj3USEThD8VHLA8a/TNGtdHO9NfTJ0r2XPvp/69tDxgyVVF8UtDWold JVtIai3cBrpQ7zDytg5EWuBAXz5XbufG8JRH3/5i/GmzQjdosSuPD+9seEUcKQsh2lMu 1bzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="jeEY0/95"; 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 82si1365731pfa.115.2019.01.17.02.23.25; Thu, 17 Jan 2019 02:23:41 -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="jeEY0/95"; 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 S1727908AbfAQKVM (ORCPT + 99 others); Thu, 17 Jan 2019 05:21:12 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:42239 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726917AbfAQKVL (ORCPT ); Thu, 17 Jan 2019 05:21:11 -0500 Received: by mail-pf1-f195.google.com with SMTP id 64so4614361pfr.9 for ; Thu, 17 Jan 2019 02:21:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oqgQwgs6rpK2rfGYhVxoq0wejotpg6+UVg0B/eSnCeE=; b=jeEY0/959wN0YxccsGI/CTJT2VzDCV/l6S1FQ8sSHUBi48H+rBqDrdX7nCbGHbVfMB wb0w9wJ27i4ZPLv8Q9Pn9Z5jcuwVrrBg+UmYLSahDRnCpr4jH05BIs4fEFXW3ZJ8KNYc Mdyq3wYjtMaNpOWyhvEw2tLuBKZsUd3Bc0vDY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=oqgQwgs6rpK2rfGYhVxoq0wejotpg6+UVg0B/eSnCeE=; b=b+3vaXC+/Gwkk+wGPxcOlgJdWdZIdv6Ajv0u+jZB6w0Iej/jFBfOP/FQAr0V86MP26 Roe0sCdw+asMWEyl1vznjTJBoLOsib5KOC/8wXlrefSLYBqEtq2ISTWN8+geYNweFxkt pT6v+Z1UKzDGkAwZOI1UEJomJyCEFPkXx6MrUQfFluY//T4nsdWwS23ivDDNz0sLMWqu lnj0uwk8tJnVLAgkNJ+iFTFxwpizwib0qaexnA+ycBkzp30dlBvK86K1ugJBfoB8MORG 4Dr843IEnKF6KIs/mcgGBjFOigw1X/tCfuku3GgMSq01Q7LJNyLfAhTQJ4jZhN6J3ycl d0dA== X-Gm-Message-State: AJcUukd5iQ6Flz+Y95+5gASOhCV7W+RrRmlwIv2M6DQV5+vY+jQxTCg3 sD1KTNIfu2Ayn1/+xEoV7RRWoQ== X-Received: by 2002:a62:d885:: with SMTP id e127mr14258586pfg.197.1547720470387; Thu, 17 Jan 2019 02:21:10 -0800 (PST) Received: from localhost ([122.172.102.63]) by smtp.gmail.com with ESMTPSA id r66sm2754116pfk.157.2019.01.17.02.21.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 02:21:09 -0800 (PST) Date: Thu, 17 Jan 2019 15:51:07 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Amit Kucheria , Linux Kernel Mailing List , linux-arm-msm , Eduardo Valentin , Stephen Boyd , Doug Anderson , Matthias Kaehlcke , "Rafael J. Wysocki" , Matthias Brugger , Sudeep Holla , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , "open list:CPU FREQUENCY DRIVERS" Subject: Re: [PATCH v1 00/10] cpufreq: Add flag to auto-register as cooling device Message-ID: <20190117102107.2n5liu325alisxhd@vireshk-i7> References: <20190117054916.dqduckt7larn32av@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17-01-19, 11:08, Rafael J. Wysocki wrote: > On Thu, Jan 17, 2019 at 6:49 AM Viresh Kumar wrote: > > 1. Have following for CONFIG_CPU_FREQ > > depends on !CPU_THERMAL || THERMAL > > Sorry, but this makes my teeth hurt. I knew it :) > > The platforms which don't need CPU_THERMAL (like x86) should not > > enable CPU_THERMAL anymore if they want CONFIG_THERMAL=m. > > > > @amit: If this gets accepted, please update the Kconfig entries for > > all those drivers to not have above lines anymore. > > > > - Change CONFIG_THERMAL to bool instead of tristate ? > > > > - Anything else ? > > The design in the thermal subsystem seems to be upside-down. > Non-modular code should never be made depend on anything only defined > in a module. > > Would an explicit "select THERMAL" under CPU_THERMAL cause THERMAL to be 'y'? That causes recursive-dependency issues: drivers/thermal/Kconfig:5:error: recursive dependency detected! drivers/thermal/Kconfig:5: symbol THERMAL is selected by CPU_THERMAL drivers/thermal/Kconfig:16: symbol CPU_THERMAL depends on THERMAL_OF drivers/thermal/Kconfig:70: symbol THERMAL_OF depends on THERMAL For a resolution refer to Documentation/kbuild/kconfig-language.txt subsection "Kconfig recursive dependency limitations" something like this works though: diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index 30323426902e..ee9f9f2a795b 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -13,6 +13,20 @@ menuconfig THERMAL All platforms with ACPI thermal support can use this driver. If you want this support, you should say Y or M here. +config CPU_THERMAL + bool "generic cpu cooling support" + depends on CPU_FREQ + select THERMAL_OF + select THERMAL + help + This implements the generic cpu cooling mechanism through frequency + reduction. An ACPI version of this already exists + (drivers/acpi/processor_thermal.c). + This will be useful for platforms using the generic thermal interface + and not the ACPI interface. + + If you want this support, you should say Y here. + if THERMAL config THERMAL_STATISTICS @@ -148,19 +162,6 @@ config THERMAL_GOV_POWER_ALLOCATOR Enable this to manage platform thermals by dynamically allocating and limiting power to devices. -config CPU_THERMAL - bool "generic cpu cooling support" - depends on CPU_FREQ - depends on THERMAL_OF - help - This implements the generic cpu cooling mechanism through frequency - reduction. An ACPI version of this already exists - (drivers/acpi/processor_thermal.c). - This will be useful for platforms using the generic thermal interface - and not the ACPI interface. - - If you want this support, you should say Y here. - config CLOCK_THERMAL bool "Generic clock cooling support" depends on COMMON_CLK What about make CONFIG_THERMAL bool instead ? Who wants it to be a module ? $ git grep "CONFIG_THERMAL=m" arch/arm/configs/mini2440_defconfig:CONFIG_THERMAL=m arch/arm/configs/omap2plus_defconfig:CONFIG_THERMAL=m arch/arm/configs/pxa_defconfig:CONFIG_THERMAL=m arch/mips/configs/ip22_defconfig:CONFIG_THERMAL=m arch/mips/configs/ip27_defconfig:CONFIG_THERMAL=m arch/unicore32/configs/unicore32_defconfig:#CONFIG_THERMAL=m Not sure if they really want this code out :( -- viresh