Received: by 10.192.165.148 with SMTP id m20csp24686imm; Fri, 20 Apr 2018 02:18:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/pt/Wkf95wsEBVVZv8LiqT2v09RFM0bD1lCDMY2cXLe3qpn9NGrjL5u3y9fuHfQuIha5Gd X-Received: by 2002:a17:902:407:: with SMTP id 7-v6mr9462454ple.47.1524215880053; Fri, 20 Apr 2018 02:18:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524215880; cv=none; d=google.com; s=arc-20160816; b=tKzTdFkppaBu4X3PZOqIeUxUl2mCVfd/8yJd7LOVWr4Bf/bMg1S4frT1FqdvliJ8Td 5JCW7uZovMPLoLNgQxwPLiTmSyH2kxhu2UYAvUk/x6JUJrB3cIHUZZ4EtEmBglxc83Nd KT3vb6QJJYyWkEUVVfcyCx8nTymjGCMjdtQDz8e4BJjA09fBq2bA4oL7V3LXRgR3L6Qo lt8kpmW1OGHnntNiyE73r2LXiYH1JmjafBfmotrnSPA+kiird+OyvaDXeidvhpzspIzZ 1D4yIKyhxOQXAEeokEM1kkY+SV2udt5A7rXwJcoi0BPfFgJ/BUKECenFbI16CTHmEnex 0t/g== 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:organization:from:references:to:subject:cc :arc-authentication-results; bh=x7uc5OUAu1h/fiFB6Wr1k1skyRqScYKvEEaI6G57Ydw=; b=0Psh+YSngpnLhenrWavrdBF/ra6D3P+VnV+N39MOguTP/EyVIJtsfC73f2z3mm9shz X8Y6G6waopvnbn4FjguWxDRojdytraE/GJ/hbv3QU08J7G+e3F07Dp3YoIwo0B6yulD/ BNRLmgkdbch0Lcn1nKGzsFmQzR3UMk53y0lESC8m2DR/trjT41+8y5Q75yGIp1K7Qau2 3HY3G+D75r9tiZ3RluM4THkatfBvwCeAJwXSk5qzIh6OaRbpSONSxonxkXSLkMby0Z/d fgWc1r6uSiPOuFbGk9GSSigBhGAzdMr1GbBcjmb6VMENvbNdl+jFyudwm938cyT9fm1A nGzg== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1-v6si5540428pld.539.2018.04.20.02.17.46; Fri, 20 Apr 2018 02:18:00 -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; 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 S1754507AbeDTJQO (ORCPT + 99 others); Fri, 20 Apr 2018 05:16:14 -0400 Received: from foss.arm.com ([217.140.101.70]:46628 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754342AbeDTJPS (ORCPT ); Fri, 20 Apr 2018 05:15:18 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3297280D; Fri, 20 Apr 2018 02:15:18 -0700 (PDT) Received: from [10.1.210.28] (e107155-lin.cambridge.arm.com [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 48FD33F59D; Fri, 20 Apr 2018 02:15:15 -0700 (PDT) Cc: Sudeep Holla , Markus Mayer , "Rafael J. Wysocki" , Brian Norris , Gregory Fong , Florian Fainelli , Jim Quinlan , Broadcom Kernel List , Power Management List , ARM Kernel List , Linux Kernel Mailing List , Markus Mayer Subject: Re: [PATCH 2/2] cpufreq: brcmstb-avs-cpufreq: prefer SCMI cpufreq if supported To: Viresh Kumar References: <20180418155643.36464-1-code@mmayer.net> <20180418155643.36464-3-code@mmayer.net> <20180419041632.GF24576@vireshk-i7> <74b70865-dfa9-25c8-20f8-3d2f722b9b2d@arm.com> <20180420044259.GA2873@vireshk-i7> From: Sudeep Holla Organization: ARM Message-ID: Date: Fri, 20 Apr 2018 10:15:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180420044259.GA2873@vireshk-i7> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/04/18 05:42, Viresh Kumar wrote: > On 19-04-18, 11:37, Sudeep Holla wrote: >> >> >> On 19/04/18 05:16, Viresh Kumar wrote: >>> On 18-04-18, 08:56, Markus Mayer wrote: >>>> From: Jim Quinlan >>>> >>>> If the SCMI cpufreq driver is supported, we bail, so that the new >>>> approach can be used. >>>> >>>> Signed-off-by: Jim Quinlan >>>> Signed-off-by: Markus Mayer >>>> --- >>>> drivers/cpufreq/brcmstb-avs-cpufreq.c | 16 ++++++++++++++++ >>>> 1 file changed, 16 insertions(+) >>>> >>>> diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c >>>> index b07559b9ed99..b4861a730162 100644 >>>> --- a/drivers/cpufreq/brcmstb-avs-cpufreq.c >>>> +++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c >>>> @@ -164,6 +164,8 @@ >>>> #define BRCM_AVS_CPU_INTR "brcm,avs-cpu-l2-intr" >>>> #define BRCM_AVS_HOST_INTR "sw_intr" >>>> >>>> +#define ARM_SCMI_COMPAT "arm,scmi" >>>> + >>>> struct pmap { >>>> unsigned int mode; >>>> unsigned int p1; >>>> @@ -511,6 +513,20 @@ static int brcm_avs_prepare_init(struct platform_device *pdev) >>>> struct device *dev; >>>> int host_irq, ret; >>>> >>>> + /* >>>> + * If the SCMI cpufreq driver is supported, we bail, so that the more >>>> + * modern approach can be used. >>>> + */ >>>> + if (IS_ENABLED(CONFIG_ARM_SCMI_PROTOCOL)) { >>>> + struct device_node *np; >>>> + >>>> + np = of_find_compatible_node(NULL, NULL, ARM_SCMI_COMPAT); >>>> + if (np) { >>>> + of_node_put(np); >>>> + return -ENXIO; >>>> + } >>>> + } >>>> + >>> >>> What about adding !CONFIG_ARM_SCMI_PROTOCOL in Kconfig dependency and don't >>> compile the driver at all ? >>> >> >> Unfortunately, that may not be good idea with single image needing both >> configs to be enabled. > > Sure, but looking at the above code, it looked like they don't need the other > config if SCMI is enabled. > Yes, I understand that. But if they just want to run a distro kernel or a defconfig with all the options enabled, then it's not possible. But if they always build kernel with some custom config options, then fine. It still doesn't give the flexibility to switch between the two implementations boot time based on some firmware config(e.g. DT status property). -- Regards, Sudeep