Received: by 10.223.185.116 with SMTP id b49csp528167wrg; Wed, 21 Feb 2018 02:32:09 -0800 (PST) X-Google-Smtp-Source: AH8x226uxFtli8NMFsIxt3VmIrgbfhG3iiUeZrIhKglYttp3LmYAyZAQ8/8889r6rmzCKLtCgNnA X-Received: by 2002:a17:902:12f:: with SMTP id 44-v6mr2704238plb.403.1519209129602; Wed, 21 Feb 2018 02:32:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519209129; cv=none; d=google.com; s=arc-20160816; b=SEMlSBBRHJt7thpRh4yXGIfAcPaMCTRNRtYNpr/HXZp//L9D22WOg4nD4padsUfVpk 6F2A/14Oh0j4g0hQgHc5Yz0qDOTwbLpKP7xJqBuLuhrkEaqcW6WE0pxNdI8W50eITbl9 nkdH4pKivLYXEgDdNHSQ2vXf1we4i0XaR8cMiD5nrMWuPG5BRCeVhu/QnB9EDr2RVROw +7xg5dZuIFkkVPQi4MmXvAWSTxhbOKp6sZuavzM9CpOAJFIEh4aNTkcGbFvBbU9LIGwm S4pmGIf7l4iSd8MXu9YhFaU2v2NXcSUih4oAEHOVdUYFhKYNBVAU8DI59LmlXC5l4u28 lMiA== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=wOZYtY2Y85v1QvmTTjzUdgGFi93cE541xEdL/3grag0=; b=TLBVOl2VAz3RO5BqW/HgV1RLUONOVL7882ozVf2uRRZHWvHUe03oYyAIxxlGSq108M TxgdslftXC17iGqisoGq/FplLRlr27kecNsHe549LZgcz4ruAVHz/TmDzkfyeYqyF0tM xRzydLO9q22JRmzyH0UxVcP5dgsnA+SbAoCfgFxGcKzO3UD7/PCc4i1Xkg3qV/z62b/+ flLJ6hbn0FlYqdK4tjhJi0C7X/lpZ9WLXHhm3cxD1vhPEoQ3J1r2Z8CJf3PmUp3yCAbQ F3czsFacuQCzkwOAnHgS2K2Q+rAqvHPg06bWljHqgjyzycX2Sn2F0UW52mKtMgZJLAA6 hs3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J+FjEyIs; 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 d16-v6si12424295plj.74.2018.02.21.02.31.55; Wed, 21 Feb 2018 02:32:09 -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=J+FjEyIs; 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 S933185AbeBUKbB (ORCPT + 99 others); Wed, 21 Feb 2018 05:31:01 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:45801 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932751AbeBUKa6 (ORCPT ); Wed, 21 Feb 2018 05:30:58 -0500 Received: by mail-lf0-f66.google.com with SMTP id x196so1609823lfd.12 for ; Wed, 21 Feb 2018 02:30:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=wOZYtY2Y85v1QvmTTjzUdgGFi93cE541xEdL/3grag0=; b=J+FjEyIserCmmX6r2dGuxW7vFvuY8JXGGyfIzaGAnVy7HYIbwO9YwiVwoa3/Ve61Pn sJh9nAxHD+wgGXBD+o8LUnnnhpgrpBPem0zGS0WAwmV0zSsxjMkfi37Ie67YjHBbVWAY 3W1XTTu8UuvWO1srfX2ISfwnPFtXCSiXXC1rw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=wOZYtY2Y85v1QvmTTjzUdgGFi93cE541xEdL/3grag0=; b=AFUn+dUBPJB2uMD6b9w0rQTg6m4QBvRQ4SjBzHbMjNWGdgL2yUZNMyZU36sVAezjFG +w2iyV5RfL3Fh1G7CyCUtaxevUo4hobOSRAjcaFKVj0w1ZlqPWZTKivniSyJFtmzGdS6 UwI+y8DcNtWBPsZ3G59uTBJD3474bDSseUEVSdBKmOcOMaBlX/WriRn/3d858/mnELpT XRUWm+kciX3jun5L8UeAzejtnnMEHbxR420J2zAFW/unQazESgMAMVTqz7lmnj6drcoL Do0FkEXMJ0gEe3vZqtPlStUThtHmH979eCVTKG3/KLmcT+sbkoNlB+77sIODPzOOUAFZ 0a3g== X-Gm-Message-State: APf1xPCk3hcyJcoRIr6fyXuXkBwQ9PnabTZDpKS1hFw2fidm2yLR57oN CfytsGcP3PkcYBrwxzGhBilj4QdT63adj4iwlWfMwQ== X-Received: by 10.25.42.143 with SMTP id q15mr1996358lfq.84.1519209057116; Wed, 21 Feb 2018 02:30:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.154.205 with HTTP; Wed, 21 Feb 2018 02:30:56 -0800 (PST) In-Reply-To: References: <1496686434-13181-1-git-send-email-daniel.lezcano@linaro.org> <20170609154652.GG2244@mai> <20170612093853.GB2261@mai> From: Riku Voipio Date: Wed, 21 Feb 2018 12:30:56 +0200 Message-ID: Subject: Re: [PATCH] ARM64: Kconfig: Fix the missing hi655x common clk To: Daniel Lezcano Cc: Arnd Bergmann , Ulf Hansson , Catalin Marinas , Will Deacon , open list , Wei Xu , John Stultz , Olof Johansson , "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16 February 2018 at 19:35, Daniel Lezcano wr= ote: > 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 reall= y >>>>> feel like a pmic on an SoC is a "user-visible driver". I deal with th= e >>>>> 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 hig= h >>>> 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 configurat= ion >>> options should be selected automatically from a single topmost node of = a tree >>> (platform selection) to all the nodes corresponding to the devices, lea= ving 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, t= hen 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_HI65= 5X_PMIC' >>> is confusing for me. Wouldn't make sense to select COMMON_CLK_HI655X wh= en >>> 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 impos= sible >> 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=3Dy > CONFIG_COMMON_CLK_S2MPS11=3Dy > CONFIG_CLK_QORIQ=3Dy > CONFIG_COMMON_CLK_PWM=3Dy > -CONFIG_STUB_CLK_HI3660=3Dy > CONFIG_COMMON_CLK_QCOM=3Dy > CONFIG_QCOM_CLK_SMD_RPM=3Dy > CONFIG_IPQ_GCC_8074=3Dy > @@ -529,8 +528,6 @@ CONFIG_HWSPINLOCK_QCOM=3Dy > CONFIG_ARM_MHU=3Dy > CONFIG_PLATFORM_MHU=3Dy > CONFIG_BCM2835_MBOX=3Dy > -CONFIG_HI3660_MBOX=3Dy > -CONFIG_HI6220_MBOX=3Dy > CONFIG_ROCKCHIP_IOMMU=3Dy > CONFIG_ARM_SMMU=3Dy > CONFIG_ARM_SMMU_V3=3Dy > diff --git a/drivers/clk/hisilicon/Kconfig b/drivers/clk/hisilicon/Kconfi= g > 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 mes= sage > between application processors and other processors/MCU/DSP. Se= lect > Y here if you want to use Hi3660 mailbox controller. Which kernel tree is this from? I don't see this driver in mainline. > > 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 mes= sage > between application processors and MCU. Say Y here if you want = to > > > > > -- > Linaro.org =E2=94=82 Open source software for A= RM SoCs > > Follow Linaro: Facebook | > Twitter | > Blog > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel