From patchwork Mon Aug 8 18:02:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 73462 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp98298qga; Mon, 8 Aug 2016 11:02:30 -0700 (PDT) X-Received: by 10.98.133.10 with SMTP id u10mr146141485pfd.134.1470679350658; Mon, 08 Aug 2016 11:02:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k84si37996314pfj.225.2016.08.08.11.02.30; Mon, 08 Aug 2016 11:02:30 -0700 (PDT) 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=@verdurent-com.20150623.gappssmtp.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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752337AbcHHSC1 (ORCPT + 27 others); Mon, 8 Aug 2016 14:02:27 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36484 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752143AbcHHSCZ (ORCPT ); Mon, 8 Aug 2016 14:02:25 -0400 Received: by mail-wm0-f67.google.com with SMTP id x83so16938164wma.3 for ; Mon, 08 Aug 2016 11:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verdurent-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UVYpFBnN2RZEvg9BzijqS72kgEDzE17HdhmpQJhfMSA=; b=KBUZSs8wlC9mTb+VeHfctYmHpnXCV5khFJ9cXH+DJeP3UEQUR4okT7uHKawBOnObXS LebahgqkYn+o0MCZVEmrvKLyQaARsIYX0WpnizDQoKj5kUsjXMol2BQiodVGVpo4pIFk SwQQQ5Ffbx3lxXguIzocF23Xxr9fHESAk5TZ4fxe4BLl7irpQFc4QmAy3J2uGMxgtPy1 QxpXPW6gjGqo+Lo3NANHOWJWgQQl4z3ZbDcPdzpTdmNOmS34kIm9sZ+nmBbVit8stkJF /8cA7jU5jnPz8n0vvWbu0FK5m8HI42YFlooIARiM4rBIb5YDLK/v0+yM9vioeX8vhy70 5UrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UVYpFBnN2RZEvg9BzijqS72kgEDzE17HdhmpQJhfMSA=; b=mScM2E+wsm0RX7gSjT4IfrkZyh/AvAl9Xdh9K8pWKp7ivx3rJNeMIONOs46cDSFi86 uEAmZbiHIpdyKdB+xAQ0Itl4RrEvejd70vjrknkTvjxy2HJykjF/H8ZRdEMwbyIcgsHg icRBUwByF9ZdlksVTj4a827UfG/vWba/vvJashPDoJ5AJPoUOIRSv+11c+b9Xwm7s6hS ZURw0BXkhFQTyKqcwWa79fBuM+R9CNkkzAk4tbckCQ8Ibblrcv3rEukSziLFqDd6n4al bH9qP2BXH/c1ITlsTsvhU0YUZ8qNsQCWvC9ZtHLTQNDLe7HEISi5Jh484IKa346ji3sz yYnQ== X-Gm-Message-State: AEkoouvyGcV0sYrhakoh10GTM57iX4809gqErYPr1I9CArw/G5qav6ULdQwcya0O3J4Wes9+61zPfdZEsb2SDQ== X-Received: by 10.25.139.214 with SMTP id n205mr23432610lfd.84.1470679343526; Mon, 08 Aug 2016 11:02:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.161.170 with HTTP; Mon, 8 Aug 2016 11:02:22 -0700 (PDT) In-Reply-To: <5d98a054-c057-81eb-9ee7-789353a093e5@linaro.org> References: <1470627463-20570-1-git-send-email-leo.yan@linaro.org> <20160808064241.GA30622@leoy-linaro> <5d98a054-c057-81eb-9ee7-789353a093e5@linaro.org> From: Amit Kucheria Date: Mon, 8 Aug 2016 23:32:22 +0530 Message-ID: Subject: Re: [PATCH] clk: Hi6220: enable stub clock driver for ARCH_HISI To: Daniel Thompson Cc: Leo Yan , Michael Turquette , Stephen Boyd , Jiancheng Xue , Philipp Zabel , Rob Herring , linux-clk@vger.kernel.org, LKML , Dietmar Eggemann , Guodong Xu Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 8, 2016 at 9:23 PM, Daniel Thompson wrote: > On 08/08/16 15:42, Amit Kucheria wrote: >> >> On Mon, Aug 8, 2016 at 12:12 PM, Leo Yan wrote: >>> >>> Hi Amit, >>> >>> On Mon, Aug 08, 2016 at 11:23:31AM +0530, Amit Kucheria wrote: >>>> >>>> On Mon, Aug 8, 2016 at 9:07 AM, Leo Yan wrote: >>>>> >>>>> In current kernel config 'CONFIG_STUB_CLK_HI6220' is disabled by >>>>> default, as result stub clock driver has not been registered and >>>>> CPUFreq driver cannot work. >>>> >>>> >>>> I have a related patch that has been pending for a while: >>>> https://lkml.org/lkml/2016/6/20/375 but it was tied only to the >>>> thermal driver. >>> >>> >>> I also have concern this patch may duplicate with yours. >>> >>>> Is the stub mandatory for the architecture? Will other SoCs in the >>>> family will use the same stub? >>> >>> >>> I don't think stub driver is mandartory for archtitecture and it's >>> only used by Hi6220 on Hikey. AFAIK, currently stub driver is only used >>> by CPU frequency change. >>> >>> The logic is: >>> Thermal cooling device driver >>> `-> CPUFreq DT driver >>> `-> Stub clock driver >>> >>> ARM is working on Hikey for EAS profiling, so usually the use case is >>> to enable CPUFreq driver and stub clock driver. Sometimes it only >>> need enable this driver without thermal driver; so this is why we >>> cannot rely on thermal driver to enable stub clock driver. >>> >>> I'm open-minded if you have better idea to enable it. >>> >>>>> This patch is to enable stub clock driver in config for ARCH_HISI. >>>>> >>>>> Reported-by: Dietmar Eggemann >>>>> Signed-off-by: Leo Yan >>>>> --- >>>>> drivers/clk/hisilicon/Kconfig | 1 + >>>>> 1 file changed, 1 insertion(+) >>>>> >>>>> diff --git a/drivers/clk/hisilicon/Kconfig >>>>> b/drivers/clk/hisilicon/Kconfig >>>>> index 3f537a0..9e0a95e 100644 >>>>> --- a/drivers/clk/hisilicon/Kconfig >>>>> +++ b/drivers/clk/hisilicon/Kconfig >>>>> @@ -23,5 +23,6 @@ config RESET_HISI >>>>> config STUB_CLK_HI6220 >>>>> bool "Hi6220 Stub Clock Driver" >>>>> depends on COMMON_CLK_HI6220 && MAILBOX >>>>> + default ARCH_HISI >> >> >> Instead of forcing this up on the entire arch, why not restrict it to >> just the cpufreq driver? ARM_HISI_ACPU_CPUFREQ? > > > I'm struggling to understand the concern here. default doesn't force this > option on anything, it just sets the default. > > Personally I might prefer 'default y' because it is simpler and involves > less thinking. However the other drivers in this directory use 'default > ARCH_HISI' (i.e. they do not default on for a COMPILE_TEST) so copying their > approach is quite reasonable. No concern actually - on the contrary, this dependency needs to be fixed urgently. Just trying to figure out if there is a way to manage the dependency chain in one place and including the root config option into defconfig. (Thermal driver) ---- dep ---> (cpufreq driver) ----- dep ---> (hi2660 clock stub driver) ---- dep -----> (common hi6220 clock driver) My earlier patch focused on enabling the stub driver in the case the thermal driver was enabled (and subsequently turning on HISI_THERMAL in defconfig). The EAS profiling usecase to prevent thermal-throttling from kicking in is a bad default to have in the kernel, IMO - it can be easily achieved by just changing the thermal thresholds. Something like the following, with HISI_THERMAL added to defconfig would give a "stable" kernel on Hikey. diff --git i/drivers/thermal/Kconfig w/drivers/thermal/Kconfig index 2d702ca..77597a5 100644 --- i/drivers/thermal/Kconfig +++ w/drivers/thermal/Kconfig @@ -177,8 +177,11 @@ config THERMAL_EMULATION config HISI_THERMAL tristate "Hisilicon thermal driver" - depends on (ARCH_HISI && CPU_THERMAL && OF) || COMPILE_TEST + depends on (ARCH_HISI && OF) || COMPILE_TEST depends on HAS_IOMEM + select CPU_THERMAL + select CPUFREQ_DT + select STUB_CLK_HI6220 help Enable this to plug hisilicon's thermal sensor driver into the Linux thermal framework. cpufreq is used as the cooling device to throttle