Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1814962imu; Thu, 17 Jan 2019 03:47:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN7AvhYsTHBjbkwqz/hiQ5IqxmAEz/7yvXAq3rX2jlua66RaIsQvPzshnJebM+PxXiP2Uh64 X-Received: by 2002:a62:4e83:: with SMTP id c125mr14717726pfb.101.1547725660779; Thu, 17 Jan 2019 03:47:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547725660; cv=none; d=google.com; s=arc-20160816; b=NH4oT3XYzWbMrU1wyZNeml4SNaVSHpcOvuDwmhqsBtErvCXCz8hXmP6Abt415oNQ1z P5Esk4y0SKqNIv5BAdsHsnyaDQgT9deBs7pf3nsgjqethMyJxfr9tHcE9437SLiq1NAE xWIWiyfnpdpU97IzP/QXd/AjlO8x0DigCmjDo5CAA6VAfKZonkdBgG10eE3kXp74g62d mexk1WqODdq92ItktotxRn/tFl54Av9XMapKJi1+jmgHagQl4r7kyy9f6gGPUm/9xmri GTKzJbuk+vhHJWEzlk38/vku+JQIyNOM4COnTzZpKjLHAheypq0FeBVQM2BhUx/PEC9p UiEA== 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=s9h0YwkfxQwlaGw8Qv9w2vEklaH/txDnyG6QeSQpnQk=; b=iw/UaKuMvdgocbJjCqLGDe2UNYqp1j9magEbfmxF3gNDjNt6iy93YDKaYm9AR6MpW/ DYzV4GPF/ZJOTuiB5SpC2gbJRaoLfziqwHYTo6Qb6BlRCVkiDL90Fr+AqQbZcs9lZLW5 SPTmb9mjsOgQBLsLRTMI2zItK7rkby4lzOmQyP1MFKw2nyjOPcwjeSrR+T6JMWb4XgMh P9Ve/WwFqn1kZT0QXPK3fY0d/sJQKN2E65AO5AbMpX31cOeTrLIwjBUhEmPJei86gVLb 0dg7QV9EviAr0evZuBp7W8VqW9RUm69LIFl+cukF1g3m0AXzNy3rb6el1KNbG0GwmhLy dj2g== 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 c6si1363872plr.414.2019.01.17.03.47.25; Thu, 17 Jan 2019 03:47:40 -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 S1727425AbfAQKO3 (ORCPT + 99 others); Thu, 17 Jan 2019 05:14:29 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:43474 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbfAQKO3 (ORCPT ); Thu, 17 Jan 2019 05:14:29 -0500 Received: by mail-ot1-f65.google.com with SMTP id a11so10589683otr.10; Thu, 17 Jan 2019 02:14:28 -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=s9h0YwkfxQwlaGw8Qv9w2vEklaH/txDnyG6QeSQpnQk=; b=PvKcAxc5FrM9RrVuovv7OjjxkaibZz/MWuu692x8dxK/ydzA1Qv4GLSk8Ol/lftZwK jiFDY13ioehoyz02hiTIe+fXGbb72sBdSm/I7bQbL9KrMAWUX5CRBAWqZESM0nKmdpVB PdOErqTEtYf+yQ1SNZHmvZvbDHY8gMJH5skaf8ZWx6rLDBgDNC3cG9LAogVEglJLFdDj cHLinIpkMgW2I4OlXLB0QI7SQ7b06uX3JKJoaqObJtpcoYIjIF3D+mvQ9Y3X12n7XTHg rjfaKWd5pAjjQUi8HMb3CAW+5nK8WpVoT/K4Pza83FH57MRt+emOZoAVdqs+VDk6jshB V2Hw== X-Gm-Message-State: AJcUukcl4/zdOP3yKjBnSVzKHx3NqzGt/JuBvaB2UWuRgSx8boKCxWJA G39lUFvNZeE7X/1dKGY4SMZ8ScC711a46EFVYY0= X-Received: by 2002:a9d:588c:: with SMTP id x12mr8554395otg.139.1547720067764; Thu, 17 Jan 2019 02:14:27 -0800 (PST) MIME-Version: 1.0 References: <20190117054916.dqduckt7larn32av@vireshk-i7> In-Reply-To: From: "Rafael J. Wysocki" Date: Thu, 17 Jan 2019 11:14:16 +0100 Message-ID: Subject: Re: [PATCH v1 00/10] cpufreq: Add flag to auto-register as cooling device To: Viresh Kumar 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" 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:08 AM Rafael J. Wysocki wrote: > > On Thu, Jan 17, 2019 at 6:49 AM Viresh Kumar wrote: > > > > On 14-01-19, 22:04, Amit Kucheria wrote: > > > Add a flag to be used by cpufreq drivers to tell cpufreq core to > > > auto-register themselves as a thermal cooling device. > > > > > > There series converts over all the drivers except arm_big_little.c. > > > Tested on SDM845 with the qcom-cpufreq-hw driver. Only compile-tested the > > > others. > > > > > > Things needing fixing: > > > - Look at how to detect that we're not in IKS mode in arm_big_little's > > > .ready callback. > > > > is_bL_switching_enabled() lets you know if IKS is enabled or not. > > Set/clear flag conditionally before the cpufreq-driver is registered, > > based on the output of is_bL_switching_enabled(). > > > > > - The other pending issue is to fix allmodconfig that leaves us with > > > CPU_FREQ=y and THERMAL=m (CPU_THERMAL=y). That leads to undefined > > > references for functions defined in cpu_cooling.c > > > > Okay, that's a terrible thing and the solution looks to be rather > > difficult. > > > > For others who may not be aware of the issue here, currently the > > cpufreq drivers use helpers of cpu_cooling.c (CONFIG_CPU_THERMAL), > > which uses helpers of the thermal core (CONFIG_THERMAL). > > CONFIG_THERMAL is defined as tristate and CONFIG_CPU_THERMAL as bool > > in Kconfigs. > > And CONFIG_CPU_THERMAL is defined under "if THERMAL". > > > The cpufreq drivers using the cpu_cooling.c file have this in their > > Kconfig entry: > > > > # if CPU_THERMAL is on and THERMAL=m, ARM_BIT_LITTLE_CPUFREQ cannot be =y > > # depends on !CPU_THERMAL || THERMAL > > > > > > This series now places the cpufreq core in place of the cpufreq driver > > and it messes up everything. It is not just about allmodconfig, but > > any configuration which makes the compilation fail. > > > > What are the solutions we have now ? > > > > 1. Have following for CONFIG_CPU_FREQ > > depends on !CPU_THERMAL || THERMAL > > Sorry, but this makes my teeth hurt. > > > 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'? Alternatively, "depends on THERMAL=y" under CPU_THERMAL should work too, shouldn't it? "!CPU_THERMAL || THERMAL" would be always true then, AFAICS.