Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1727042imu; Thu, 17 Jan 2019 02:11:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN5qRP4QJ87tomLkSPo88HFPu6rF956HwRJ2pCoWsjdQKPT6KLfehHoB3P1gmjliyatwmBbU X-Received: by 2002:a17:902:6f09:: with SMTP id w9mr14677089plk.309.1547719892419; Thu, 17 Jan 2019 02:11:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547719892; cv=none; d=google.com; s=arc-20160816; b=A9aTqO6Z3LiB6U1Fr5PLKNStNBfy2KO+2loGtUj+v67w4uz75jz9udBB1qxgw4Bu04 raRp0Znda4TtMSeyUMzG/7IE2Chg1zffqhzgcTDLZzSPbZi/wr4yCW873aBBiDJPm8Yb Eivsrvbgez7X1Og5N5LmrNgK3JIfXvOe69q1QXJoBdyZp2+pwfqWdMqGXhdJ/MHWSrC8 9A0gLC5BPTbsQ2MyRJsyImxrmwJJnrqxY6dzMDu+KJgHxJI1XLUbiXPjjHFcssy9ZwX7 gAuneEMXXXKY53h75QBy3cOU3wWP0cpcStvWweIxAQFwvQkCdYuBHeKK/SF0Y6cyqoMF CuFg== 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=438LmxlRqmX1Z8nfxUBP4cpRWlXxVI4hUs/MnRI3eXE=; b=Moj31X7s5e13C9ZlVzLj8Z0dWDLCZacGomH090iwinl+BjzsNeXyQ5meVfhcA25vEO SdGffCmf9mSo7J5xSS3QLYAQnbwFU4V9ZgPnLD1gYEFBftAWrIuCxOiYgYZgvdAgl/66 cpCuaPkaoGjRNCS4qr61I33JoedLmvRRc3Jcs9oHUve5ScKEcUADtLMHu7xme+f9PzTB j0DFRRUI2lb5eD6vPtniQJbFJtSOL1a8XSPMAqQW/nxOjBYpgY53A/9A8N//JyLBknex UDvbFzAX9p0W5IuiphevhzSe+VP+4mm4ZjHsWAxondjOyfPR+Ac6jywrbmuxz+SFcxub 7OVA== 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 19si1225382pgp.186.2019.01.17.02.11.16; Thu, 17 Jan 2019 02:11:32 -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 S1728062AbfAQKIv (ORCPT + 99 others); Thu, 17 Jan 2019 05:08:51 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:36705 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726948AbfAQKIv (ORCPT ); Thu, 17 Jan 2019 05:08:51 -0500 Received: by mail-ot1-f66.google.com with SMTP id k98so10618311otk.3; Thu, 17 Jan 2019 02:08:50 -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=438LmxlRqmX1Z8nfxUBP4cpRWlXxVI4hUs/MnRI3eXE=; b=hILYTuDS5rEVtKsN9IL2RCaii5MlXE5kZiGLDPERsR4F8PsZXNOE59aynk4/YaeVNr gRdmoUmiTeM+wLHY7cfvV7LRRMXAsHPiCdjcJ6aV6oBkfrxwcZcSEe+fTFOpFwnm2P4W 4LGxNlatf78rMSNTS7DuS2P2/Z+xVx+Hl+ftpkPJNwKwBT8K8IBwAVfGcCP3LwE2PDFC 1/CZGc3HnNML6MjcfGH/TYM8znVLO033Jd/JowIk5HjqEyClOyydzEdKwz6EqL0N4TfE vsnDcOOZrtTF4P6QKIdS35Uv1ypcB4B8cNR/iiJ12OdlW+RjsP8e2oKUO9xVrzd60rni 5uwg== X-Gm-Message-State: AJcUukfnKUmpcTsoqUTwtqpDHBQr8T2wMtfjhViKRZWDxP/n+AS732Oj q8uOcfBuaDB5SzVyQA4499e/q7Qdo5u0Uf9jvuw= X-Received: by 2002:a9d:7f0d:: with SMTP id j13mr7890302otq.119.1547719729999; Thu, 17 Jan 2019 02:08:49 -0800 (PST) MIME-Version: 1.0 References: <20190117054916.dqduckt7larn32av@vireshk-i7> In-Reply-To: <20190117054916.dqduckt7larn32av@vireshk-i7> From: "Rafael J. Wysocki" Date: Thu, 17 Jan 2019 11:08:38 +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 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'?