Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1744571imu; Thu, 17 Jan 2019 02:31:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN7z/0KcsRrIzcWb06BySyjiAmnL5FTD0nQEt2AmGvb7DeQZbcv19uU3toKtjl6WONFFOigT X-Received: by 2002:a62:d885:: with SMTP id e127mr14287629pfg.197.1547721105426; Thu, 17 Jan 2019 02:31:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547721105; cv=none; d=google.com; s=arc-20160816; b=gQ/AHQ3iQXD9hfmdBTk7TRBx23YjAgo0ghxhlTjVmSK7bun3c841239cVo3GSfgWut RvGgSG2WOx5E4ovM8rof/+RUy93GvqGjns1a4ZBJ/ZUcLd1X7u+R6/lqYFyqEPy7W00z K1vK6jzSxk6x25Hs0imub6YdJYCV4GQte5+H80qOsyWKNwrmV5oqun2o6jUH1re/flEQ w1DFAInKPZg0xUl/sxeTAUtQtJ8RkDJrxNFSwDHgQitzV1sVVDNmhYkrrLrljPcl3PZw hk1NHsxFKOgX6oR08mm7hA2WfFtQgOnsbmVkz07tBtc4WkCcMAidsfH5Bc0CCAd2ZRHi DO0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=YqqRphGnJzsRzdaLJuldaRmPzGoWSZOWhc9427yChCc=; b=RTFT15tGplSE6XQUrhHWmtdbb4d/KvMDB9qyp28saC6he/0xQEh2oMDPx2E54IHNBD yQkFsGjs8y7xL/4VvIh82KCSCnmkVRAVU3nBrbBcFlliTQQAh0XPbo83+eny20mVkFV+ w4o+xzyXAe0PTL3OJVOICtsOtUQ9HnJVWGT5uJgaeY3m3eO4EAN/C1SzIrCjBKjIH2IF 2wUwThh+2NDH2iu9t1o9pB+q+AwCrNJBc7zZeD4WMA54KPjfxzbaKs2zi9JECTcFSmj7 cQgvChjor+TkBTYwntUBgESUN7rdUo5B6VZY+wXGrwKZMz+5uzapi9Tf2au51O85feKd RqDg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i18si1123667pgl.414.2019.01.17.02.31.29; Thu, 17 Jan 2019 02:31:45 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728060AbfAQKaE (ORCPT + 99 others); Thu, 17 Jan 2019 05:30:04 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:46887 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726917AbfAQKaE (ORCPT ); Thu, 17 Jan 2019 05:30:04 -0500 Received: by mail-oi1-f196.google.com with SMTP id x202so5706440oif.13; Thu, 17 Jan 2019 02:30:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YqqRphGnJzsRzdaLJuldaRmPzGoWSZOWhc9427yChCc=; b=WUtYeS39xTmqqdfvHj+XL97g6D/9UKUiZfNjxWaSb6Zo9QLih3dq6Je5kUBuofhR5c XymxiHrC3mQY/ur6fc50Cuoc9bO8GCNTa63XsQOTfwizChNATDHlKfaHVEl4Wi+UmxFu fBmg45ylhkcSnqAQrTiciiAF+TG114Yi6jPmFy7YlHLUZyKuCbX9EwqN2zJe2swJ0/VY B/R5XJddVU89oF95XfkkXz/SYhvomO7USpfzVsT1e6NkpKuu6K3ExuVoJ6Ly50diiSBJ 7muZY5nb596rSF55sk7xZA64Vp4er/od8VlaOdevA1ApcG6W07ZRkdD3qtP3OVPuJ28k Q99w== X-Gm-Message-State: AJcUukcGJW8X1b01gFiERHCJhbuh24ITw+PMtxnj9pdT/xi/gRfBUeId +nVbZQSl1VQIdY/Grq/eQQMHMZKwGSLSkUUT+pE= X-Received: by 2002:aca:368a:: with SMTP id d132mr1150780oia.193.1547721003197; Thu, 17 Jan 2019 02:30:03 -0800 (PST) MIME-Version: 1.0 References: <20190117054916.dqduckt7larn32av@vireshk-i7> <20190117102107.2n5liu325alisxhd@vireshk-i7> In-Reply-To: <20190117102107.2n5liu325alisxhd@vireshk-i7> From: "Rafael J. Wysocki" Date: Thu, 17 Jan 2019 11:29:52 +0100 Message-ID: Subject: Re: [PATCH v1 00/10] cpufreq: Add flag to auto-register as cooling device To: Viresh Kumar Cc: "Rafael J. Wysocki" , 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" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 17, 2019 at 11:21 AM Viresh Kumar wrote: > > 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. > + My sort of educated guess is that it is under the "if THERMAL" so that it doesn't show up at all when THERMAL is unset. > 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 But what about adding depends on THERMAL=y here as I said in the other message? > - 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 :( Me neither.