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: 9269097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B195E60839 for ; Mon, 8 Aug 2016 18:02:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A88F227FE4 for ; Mon, 8 Aug 2016 18:02:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BB8E2819A; Mon, 8 Aug 2016 18:02:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9D8D27FE4 for ; Mon, 8 Aug 2016 18:02:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752174AbcHHSC0 (ORCPT ); Mon, 8 Aug 2016 14:02:26 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34545 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752167AbcHHSCZ (ORCPT ); Mon, 8 Aug 2016 14:02:25 -0400 Received: by mail-wm0-f66.google.com with SMTP id q128so16977728wma.1 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=YVyVhPVLi+CNZKfqUdJVgkiJ3BQP7iMQcddnF03/0KcLKnqNHzeEw53sQYbOWabLlM RrkrQsnToAru0nTWniUvyvZUqEexDqYQZwRd8/nlxrpH5nKlJB3siRxNlTpTnhbYwUlm Hxi9y3OsQKlH0/BLq611m1Vz0EtBh5fT+alZA+yu3DyndIcYlwnDpwcPh3SL7E8OwhH/ lca+I2kAsN33oHoTk3vy4GyakaJX8ekksOft5vqi5tEgPOj15ulOvPsgZ1JNESpEBJvw No/+jiaqzvlK3Mm/JmH0KEdh1eK5cQ+zHl9xfP4unY8LOPpDSiMm3sspBeobW7rxyFxZ ixxw== X-Gm-Message-State: AEkoouvUgQmCyxJ/tFouAVbduTT01OR/N9oZ65OMYrfxoKfkqReTF4qQIG3TTcb+7dspBtw4vgXQbJ8n0hL7PQ== 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-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. --- To unsubscribe from this list: send the line "unsubscribe linux-clk" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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