Received: by 10.223.185.116 with SMTP id b49csp531321wrg; Wed, 21 Feb 2018 02:36:00 -0800 (PST) X-Google-Smtp-Source: AH8x227kiEBYHiUbYy5Ult564jviwdqabj/K1L2dcl2R6DJnldU4NZ1apWOdhmY01bBZr5ACjWgX X-Received: by 10.99.116.69 with SMTP id e5mr2388054pgn.437.1519209360490; Wed, 21 Feb 2018 02:36:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519209360; cv=none; d=google.com; s=arc-20160816; b=OFiag95odMrpYAz/PhutELnYjy1mvpXX2rs/OIoBZXt37EJyjqNL1AWVYSygqNs9kU dJno4xhjeyMkJh168vhV3/+tp+TXe1dlZ1T5SyydLGDsnY/AdXR91T9CUh/5xCQ9eroA p5rkHh8ydLQVkmFNo/zLkdYmQxaq72m4DH6UFYTGIG9t4s087yDxz3DljjFyuAM0RYHC igkbpSKXeKRJF0AYQONG9ak6zss8jjZ3S4Bs+uIb738c1cbE764XBrYDNQIyXMtXOGyd Lr+whGc5Pf4XgnQdrhsywfuphmrV7tjFP8bEnlh0y3LDy8QvdmOj9ZPe5OuDMIU4Aiud qbyA== 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=Y8OYqfcAsjPRNgcj+qpseklD3eNL+wvjscxjtFtfDiU=; b=cNcGx7BKHEVod/dDNWHg8rhIqLcmdt1S9YK4llEzIo6gpKIx0RCwvvy9dYV6f/v8VU Jnl6zAmTZMcaqOpkQgKzaWmKgDyMkvas4LDVWwGUWY9I7M351fD3KJQC1Unj35TuK1LX h+CJmPbvb/PM7R4SQJQ0vl0dQJl7i19jfUur7a3dgEgm3KHBsDoA/0k9E47pmkfh5Dsr TJ7ZSXAZWYprme88jwD8Cy9+GMpaARYrRwCutUixPL9NKiSLS1denWGkA76VVNkPaHM2 F/KLCb/gK2kc3usKuMdTitRab9QE/l4CQdR8o4ZVDzjeZtbUV88cwrrD+ZfAf/WS2m0t 5DjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MRfIkWj+; 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 w27si1162331pfl.142.2018.02.21.02.35.46; Wed, 21 Feb 2018 02:36:00 -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=MRfIkWj+; 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 S933205AbeBUKeg (ORCPT + 99 others); Wed, 21 Feb 2018 05:34:36 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:33825 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932798AbeBUKee (ORCPT ); Wed, 21 Feb 2018 05:34:34 -0500 Received: by mail-wr0-f196.google.com with SMTP id m5so3034267wrg.1 for ; Wed, 21 Feb 2018 02:34:34 -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=Y8OYqfcAsjPRNgcj+qpseklD3eNL+wvjscxjtFtfDiU=; b=MRfIkWj+483WZ306MgMAL3Dgz1EjS9/v1OkC5zokDI8tCz371BL0HRcCwyWfeQ1uK1 kdviGeT5xVvve3Y8ATZWrkek9pHYZ2Rf/omLqrv5GhLlf3OdvkXjY4oRxgcz/+CIxEyg CFGFmTm66EngSrwi9kPxMrgzQKY3c8Bmv9dmo= 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=Y8OYqfcAsjPRNgcj+qpseklD3eNL+wvjscxjtFtfDiU=; b=F+BiGmYLicr1HIgBpA4dbyNGUak4iqoyjNCFcMGAVopI/7d6/cAAVEgq9c1dEfy/JS RgqEjKS5bz713WU53qn8Nqxg0krWj6U/HOlOmkFTaxI0BfnrQsyIH0CB23ula36T1JSn vMqL4JIcC7X2DPSPQciJVOJOBxClT/HmqdW8guS+kfVc43BrpQya3Pq+uT7A1goTQUCr axgSxbZDiYfqdOwJTn+Y5Xn9DAhVa6vmcTHTB3zmfHC/hX91GvgKM7JNR6jHYHC+k4g1 jckfq4+lBVmM5432MSdUwL1pndy8Y1biZi1BSC0ZdhivnEmxIitEqP7K4kiA3I9aIoWZ lwOA== X-Gm-Message-State: APf1xPCs/uLp0AL4Hne3KW4iZU5D1hBhztWvE1gELjNeAwYSJgCMsOIX Gsrkojvi8gku+52p3yLh1IJ4+g== X-Received: by 10.80.142.152 with SMTP id w24mr4201596edw.35.1519209273260; Wed, 21 Feb 2018 02:34:33 -0800 (PST) Received: from [192.168.1.75] (lft31-1-88-121-166-205.fbx.proxad.net. [88.121.166.205]) by smtp.googlemail.com with ESMTPSA id a102sm4833973edf.16.2018.02.21.02.34.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 02:34:32 -0800 (PST) Subject: Re: [PATCH] ARM64: Kconfig: Fix the missing hi655x common clk To: Riku Voipio Cc: Arnd Bergmann , Ulf Hansson , Catalin Marinas , Will Deacon , open list , Wei Xu , John Stultz , Olof Johansson , "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" References: <1496686434-13181-1-git-send-email-daniel.lezcano@linaro.org> <20170609154652.GG2244@mai> <20170612093853.GB2261@mai> From: Daniel Lezcano Message-ID: Date: Wed, 21 Feb 2018 11:34:31 +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 21/02/2018 11:30, Riku Voipio wrote: > On 16 February 2018 at 19:35, Daniel Lezcano wrote: >> 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: > > First, as distros, automatic selection down from selecting ARCH_X is > preferred over > defconfigs. However, we also prefer to build everything possible as > modules, so "default Y" > is sometimes too strong. > >> CONFIG_HI3660_MBOX >> CONFIG_HI6220_MBOX > > These are tristate and platorms can boot without them. > >> CONFIG_STUB_CLK_HI6220 >> CONFIG_STUB_CLK_HI3660 > > These are bool, so default Y is ok. > >> 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. > > Which kernel tree is this from? I don't see this driver in mainline. Yes, that's right. The HI6220 part is ok but the HI3660 is still not mainline yet. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog