Received: by 10.223.185.116 with SMTP id b49csp1043789wrg; Fri, 16 Feb 2018 11:22:18 -0800 (PST) X-Google-Smtp-Source: AH8x227gFbegRVrVHI3zr8JakwC+vS3C9vLbXh9Gf+B3Vh8TIfd1eXakaDDAYvCSMj9OObDkG6P/ X-Received: by 10.99.183.68 with SMTP id w4mr6007434pgt.221.1518808937992; Fri, 16 Feb 2018 11:22:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518808937; cv=none; d=google.com; s=arc-20160816; b=FOb5nrQ2wxvKEr5LUYWo1CPHRyVZU0HM8CMHVb3kVdrUFQQ2Os9c4+uetOpt8+HDZC YwzufR6KMX2YUEZ7M73dhnukzppuAa0JF9FOPPm9MyRHk2U5m25S5SS2iViCv7FbgrK6 JJsNZTDvIvWUsNJZ8p+Ch4uz1mKUvTlOXSnkyZ9omcTTKhBUNOymqNX/BoHwxKfyfGU1 dTkSmsB+ZEYPSGUnjJUQdS/Qrw8hTnsvj75BELibYFcLlSNKqxFnmafNMMCxUv+yFK1W hbDUB6z1vQxkd2iyhQPulrp3UGWO5rUeg5qVrA9njkMkWZPp+u+LSmlbQot+hVwIs8vS 5+eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=TIUORmjybSg8lgJF/L3sVZSZfXwIh5D8/tlTJvtxnJU=; b=0lzdWxFchgYTEoivDzi/P1b/5knF3+KOTxwMmilpX5CXel7OE9ii/rWV8sskF3Zi4E 5O+1f0F4u4WsWtSx4RXWt5LS1C7I++iUxOTQcKmLtsxGUgyP9afjSnhB2P+AycM+SC3f yWs6newNFAEk7IdMMEeO0cvhbrNlcSowFYud0HhSAXhWutTI5D3FjGlT+5foZLLdDnYG ftPpo4FtDEX1V3hDSxefS4kDyeDkn3KDi1gz3bXkfFGpeGsG3/1hZyFlxmSVrodCbJD8 jOPNUncB7HAzmgyLuqC9wK/6jb5FfJeX1LITL8O5RBCkkrRRFfYfO+M9rXvFYKvbTl2L iCrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tufeo2JC; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12-v6si3579245pla.226.2018.02.16.11.22.03; Fri, 16 Feb 2018 11:22:17 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Tufeo2JC; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162111AbeBPRf6 (ORCPT + 99 others); Fri, 16 Feb 2018 12:35:58 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:42637 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161197AbeBPRf5 (ORCPT ); Fri, 16 Feb 2018 12:35:57 -0500 Received: by mail-wr0-f195.google.com with SMTP id k9so3656355wre.9 for ; Fri, 16 Feb 2018 09:35:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=TIUORmjybSg8lgJF/L3sVZSZfXwIh5D8/tlTJvtxnJU=; b=Tufeo2JCkIKgp2BruLlW9Hm0JKgkieaxuYKLcBJ9V4c7sht9Zb71Or3Cj2fIiZlfgI afokq6xY3tnOetK5MGNMnBu1oQ4jjZ5BNws+ZHG8Oz0gUonlt3IMxHBjF+TJ5wAI59mT Wi+qe7pYGRLfAT4RZ0W7y/E+dkedCZ/G0OWaQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=TIUORmjybSg8lgJF/L3sVZSZfXwIh5D8/tlTJvtxnJU=; b=dHrxYVlGLTHlRu3YgQPmA8FmBTXBKPle1XFc8tHcXP98ZCMo+CqItvkLqUMsYX6YG/ juQMkshjhK1uzZI/Ey4bim3U7G3UeghPAAmfoCDn9RwIQ0ws19Q8Y3fNtXncurlmulKL C8cupXxY9xICDbsTPF7FVfm4RPo3gDr9PGr0+uouyD93czDL7vqMvaOGCh1ZXwhaO203 6yZJQoz1NvODSlsIeL7uC26FdNLJSPh+CTSeTv0QG2n8VqM+mZcd0DMdEOrIKNiPc8sh DPZvOX8gjJljxAYGUaiWkbvoqbyOAQpzPN/JrKJzZmNNmbBuJnXTlGeCRRDPcs3d7FJb Mv1g== X-Gm-Message-State: APf1xPCsH9vMI8lg1IrvlnyJ5BMMVfRcfwS8Z29S4Q4VPj5ZQnUx7BwQ rRpJEi4yV6X5xPUgJdNtL8VgO6qPuyM= X-Received: by 10.223.167.72 with SMTP id e8mr6900092wrd.138.1518802555249; Fri, 16 Feb 2018 09:35:55 -0800 (PST) Received: from ?IPv6:2a01:e35:879a:6cd0:3e97:eff:fe5b:1402? ([2a01:e35:879a:6cd0:3e97:eff:fe5b:1402]) by smtp.googlemail.com with ESMTPSA id m6sm3323930wrb.78.2018.02.16.09.35.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 09:35:54 -0800 (PST) Subject: Re: [PATCH] ARM64: Kconfig: Fix the missing hi655x common clk To: Arnd Bergmann Cc: John Stultz , Ulf Hansson , Catalin Marinas , Will Deacon , Olof Johansson , Wei Xu , "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" , open list References: <1496686434-13181-1-git-send-email-daniel.lezcano@linaro.org> <20170609154652.GG2244@mai> <20170612093853.GB2261@mai> From: Daniel Lezcano Message-ID: Date: Fri, 16 Feb 2018 18:35:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/06/2017 23:12, Arnd Bergmann wrote: > On Mon, Jun 12, 2017 at 11:38 AM, Daniel Lezcano > wrote: >> On Fri, Jun 09, 2017 at 10:48:13PM +0200, Arnd Bergmann wrote: >>> On Fri, Jun 9, 2017 at 10:15 PM, John Stultz wrote: >>>> On Fri, Jun 9, 2017 at 1:06 PM, Arnd Bergmann wrote: >>>>> On Fri, Jun 9, 2017 at 5:46 PM, Daniel Lezcano >>>>> wrote: >>>>> >>>>> Yes, but I'm not sure this is the right patch either. We tend to not >>>>> use 'select' for user-visible drivers, and most hisilicon platforms >>>>> won't need this driver. >>>>> >>>>> I think it would be more consistent to add this to the defconfig >>>>> and regard it as a user error when the driver is disabled on a >>>>> machine that needs it. >>>> >>>> Maybe the select is not exactly in the right place, but I don't really >>>> feel like a pmic on an SoC is a "user-visible driver". I deal with the >>>> board often and when the new dependency was made on the clk, I would >>>> have never have found it on my own w/o Ulf and Daniel pointing out >>>> what I needed to enable. >>> >>> What I meant is that the Kconfig option is user-visible. On a very high >>> level, this is a result of arch/arm64/Kconfig.platforms listing only >>> very broad categories of SoCs, in many cases only the manufacturers >>> of very different chip families, which then control the visibility of the >>> individual Kconfig items for things like pinctrl or clk. >>> >>> I now see that MFD_HI655X_PMIC is the top-level driver that you >>> have to select before enabling COMMON_CLK_HI655X, so the >>> patch is actually broken unless it actually selects both. >>> >>> How about simply adding a 'default MFD_HI655X_PMIC' to >>> COMMON_CLK_HI655X to enable it unless it is explicitly >>> turned off? >> >> Actually, I share John's opinion. >> >> Ideally when we choose a platform, all the relevants devices configuration >> options should be selected automatically from a single topmost node of a tree >> (platform selection) to all the nodes corresponding to the devices, leaving the >> user to select one simple option without knowledge of the SoC hardware >> internals. >> >> If the user is expert in the platform and knows exactly what he does, then he >> can select an _EXPERT_ like option and be able to disable some drivers. >> >> It is how I tend to write the Kconfig options, so the 'default MFD_HI655X_PMIC' >> is confusing for me. Wouldn't make sense to select COMMON_CLK_HI655X when >> MFD_HI655X_PMIC is enabled? > > I don't think it's that easy. When you do that, MFD_HI655X_PMIC gains > a dependency on COMMON_CLK and will again cause a warning on > machines that disable that during compile testing. > > Using 'select' for user-selectable options generally leads to problems, > and you are better off avoiding it. If you want to make the symbol impossible > to turn off for non-EXPERT configurations, you can write it like > > config COMMON_CLK_HI655X > tristate "Clock driver for Hi655x" if EXPERT > depends on (MFD_HI655X_PMIC || COMPILE_TEST) > depends on REGMAP > default MFD_HI655X_PMIC > > That way the option is completely hidden for non-EXPERT, > but still has the right default otherwise, and the dependencies > are tracked right for compile-testing. What about the options: CONFIG_HI3660_MBOX CONFIG_HI6220_MBOX CONFIG_STUB_CLK_HI6220 CONFIG_STUB_CLK_HI3660 ? Would make sense to do something like: diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index b9546ab..3a07dfe 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -517,7 +517,6 @@ CONFIG_COMMON_CLK_CS2000_CP=y CONFIG_COMMON_CLK_S2MPS11=y CONFIG_CLK_QORIQ=y CONFIG_COMMON_CLK_PWM=y -CONFIG_STUB_CLK_HI3660=y CONFIG_COMMON_CLK_QCOM=y CONFIG_QCOM_CLK_SMD_RPM=y CONFIG_IPQ_GCC_8074=y @@ -529,8 +528,6 @@ CONFIG_HWSPINLOCK_QCOM=y CONFIG_ARM_MHU=y CONFIG_PLATFORM_MHU=y CONFIG_BCM2835_MBOX=y -CONFIG_HI3660_MBOX=y -CONFIG_HI6220_MBOX=y CONFIG_ROCKCHIP_IOMMU=y CONFIG_ARM_SMMU=y CONFIG_ARM_SMMU_V3=y diff --git a/drivers/clk/hisilicon/Kconfig b/drivers/clk/hisilicon/Kconfig index 1bd4355..becdb1d 100644 --- a/drivers/clk/hisilicon/Kconfig +++ b/drivers/clk/hisilicon/Kconfig @@ -44,14 +44,17 @@ config RESET_HISI Build reset controller driver for HiSilicon device chipsets. config STUB_CLK_HI6220 - bool "Hi6220 Stub Clock Driver" - depends on COMMON_CLK_HI6220 && MAILBOX - default ARCH_HISI + bool "Hi6220 Stub Clock Driver" if EXPERT + depends on (COMMON_CLK_HI6220 || COMPILE_TEST) + depends on MAILBOX + default COMMON_CLK_HI6220 help Build the Hisilicon Hi6220 stub clock driver. config STUB_CLK_HI3660 - bool "Hi3660 Stub Clock Driver" - depends on COMMON_CLK_HI3660 && MAILBOX + bool "Hi3660 Stub Clock Driver" if EXPERT + depends on (COMMON_CLK_HI3660 || COMPILE_TEST) + depends on MAILBOX + default COMMON_CLK_HI3660 help Build the Hisilicon Hi3660 stub clock driver. diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig index de8390d4..8d1726c 100644 --- a/drivers/mailbox/Kconfig +++ b/drivers/mailbox/Kconfig @@ -109,16 +109,19 @@ config TI_MESSAGE_MANAGER platform has support for the hardware block. config HI3660_MBOX - tristate "Hi3660 Mailbox" - depends on ARCH_HISI && OF + tristate "Hi3660 Mailbox" if EXPERT + depends on (ARCH_HISI || COMPILE_TEST) + depends on OF + default ARCH_HISI help An implementation of the hi3660 mailbox. It is used to send message between application processors and other processors/MCU/DSP. Select Y here if you want to use Hi3660 mailbox controller. config HI6220_MBOX - tristate "Hi6220 Mailbox" - depends on ARCH_HISI + tristate "Hi6220 Mailbox" if EXPERT + depends on (ARCH_HISI || COMPILE_TEST) + default ARCH_HISI help An implementation of the hi6220 mailbox. It is used to send message between application processors and MCU. Say Y here if you want to -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog