Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp900047pxb; Tue, 1 Feb 2022 12:45:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCh3L6DZc9Rhgnd2Id9R/W2pmew/56Yd+A/to/wBIGe1AgExpf72Z28r0sCHposX8FdLTv X-Received: by 2002:a63:6a85:: with SMTP id f127mr22077665pgc.250.1643748349541; Tue, 01 Feb 2022 12:45:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643748349; cv=none; d=google.com; s=arc-20160816; b=YF0OqM9NqkHIr8lxX5LDuG5e00PFQgqOlBuiQYzsQVlyv4rj5DfAYMoVszankdu0SX iwV4Mo+DImo2YMeiFcz5sCD6UUAfl+LzB8QTfUI3bu3Zy9maii9c+zBLAlKIR/MGIQ6L uFO+dDO5lzrGnUjFsriTbmJo4ihDbNs4KpCNrdr0X7qkJLtTyV45PwQpB7tTsAFzqqTS 4+c51+rMjBE3LjmFH9xIxc8S+NOnZ7JfbwrvdLVjILHa/DIW7vMavX8MaHdVnbY7zcb9 LTGF5uyHh2KvUKUFHwT1E1JTwTrvNcVYRXtzK5ns1w4Ow1B5VZBgc9f6mSa4/Z58SkI6 Cvog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Lccbg+paMSrfNOlYw3jpPC9OWvbn/WwrDOZkcaZPvcE=; b=U5hQXwJU510k/KonsdFXfuhXzST9sfumVz0UFw8n2Kx79j8Ta26s1fBcz4n8Q03FvU g028XazWs/m+YN4ESbfbxIMKUi8dwSDiy2Xdeyd0W2jEqqYhjbPlXByhrh8LWshdMahs 9L4omE0Hgq6j6Il80y75phtVb+ctvlACK1ajzsDLDlTH05u6etWZt63pGIbI5muIssyL KB4+d0PYdBKwURwoGoD/ce7o//OXP1cq4VfrXWQHvbmQs7NTFME6OCEeEbodaSiBWLof 9FPTNHue/iD5DwPLRIfPVDoy6tbCSJOzCUiAVwOdqHfvaIGfMnUHn1ee1KTePjPSuN6D kd2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vijErlFO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id u9si16880922pfi.368.2022.02.01.12.45.37; Tue, 01 Feb 2022 12:45:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vijErlFO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1380567AbiAaQlw (ORCPT + 99 others); Mon, 31 Jan 2022 11:41:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380562AbiAaQlu (ORCPT ); Mon, 31 Jan 2022 11:41:50 -0500 Received: from mail-oo1-xc34.google.com (mail-oo1-xc34.google.com [IPv6:2607:f8b0:4864:20::c34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81527C06173B for ; Mon, 31 Jan 2022 08:41:50 -0800 (PST) Received: by mail-oo1-xc34.google.com with SMTP id f11-20020a4abb0b000000b002e9abf6bcbcso3350313oop.0 for ; Mon, 31 Jan 2022 08:41:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Lccbg+paMSrfNOlYw3jpPC9OWvbn/WwrDOZkcaZPvcE=; b=vijErlFOE7h9CFvOpGy5DofZSxon73a/2uogpCN2gsvHTCGhtwRERz8/825La3DaiX 5ipwWnhjPWnbhZzKKegWu7eX3EbQinJ6B/KX1zZASrd+0GO6Ew3P1BEDxz+RPnYEWFuk J2O7AvzQ+xnSrIyZZfLfwDfzNhixKOVivSZldDFMSK4UqLIGLlO9QcQb5vXlXHPgVVpn ehjYw9jUhbkfBs24LjgEgEh4mHfVE4n4M4cZGQVt+If2HdEn6tjGcw8Q1kAKLCMdryY0 pfrmCRnKIoZk+NjASoWjPPW7T8dasrC+7+OvpoObpj460j6TpxdwEJr7uLjzJ7hNQS90 DdPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Lccbg+paMSrfNOlYw3jpPC9OWvbn/WwrDOZkcaZPvcE=; b=AAN9UiPxTmL/K8d67BRBB9SB1yhYInHkQECA3vIJc0dWzLXmbFGBYJZuC2wwr+fggp 29UoM5lJp8kSCokowG4uQpbgdW2B6ofZx5yo9UHyVIJeREEwlaTGf3fkypuqdvgOsr1S RoszKnaB4q13fKkyA/MgNAJe3QVG1OQ2fn12CKZGo++edMRlZLebBjIIwEcu+7m+O+ij 48DkQX7fwzCq7nb1OgXVo/RqWf5nVBY7KFfIXAuY6Q0GpzrOzpmj+qROVKnVdf31AWcn dyWi5mUFDZ+776TYYuhkjQ/tXSomoa/6Ooc12e5eaczbAvpOPV5PU9W6qaELuDTBHq9P 9PLA== X-Gm-Message-State: AOAM532BeK2hwoi91twEdYaooeShTbZ22M8u8h4eIWZTt1lpkKjfCLFv dAkEq+KMJ9iDg3oQXK+angC1Lw== X-Received: by 2002:a4a:a5c5:: with SMTP id k5mr10562610oom.66.1643647309810; Mon, 31 Jan 2022 08:41:49 -0800 (PST) Received: from builder.lan ([2600:1700:a0:3dc8:3697:f6ff:fe85:aac9]) by smtp.gmail.com with ESMTPSA id 71sm9562848otn.43.2022.01.31.08.41.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 08:41:49 -0800 (PST) Date: Mon, 31 Jan 2022 10:41:47 -0600 From: Bjorn Andersson To: Stephen Boyd Cc: Doug Anderson , Viresh Kumar , Konrad Dybcio , kgodara@codeaurora.org, Matthias Kaehlcke , Sibi Sankar , Prasad Malisetty , quic_rjendra@quicinc.com, Andy Gross , Rob Herring , devicetree@vger.kernel.org, linux-arm-msm , LKML Subject: Re: [PATCH v2 5/5] arm64: dts: qcom: sc7280: Add herobrine-r1 Message-ID: References: <20220125224422.544381-1-dianders@chromium.org> <20220125144316.v2.5.I5604b7af908e8bbe709ac037a6a8a6ba8a2bfa94@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 27 Jan 15:16 CST 2022, Stephen Boyd wrote: > Quoting Bjorn Andersson (2022-01-25 19:01:31) > > On Tue 25 Jan 15:46 PST 2022, Doug Anderson wrote: > > > > > Hi, > > > > > > On Tue, Jan 25, 2022 at 2:58 PM Stephen Boyd wrote: > > > > > > > > Quoting Douglas Anderson (2022-01-25 14:44:22) > > > > > diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-herobrine-r1.dts b/arch/arm64/boot/dts/qcom/sc7280-herobrine-herobrine-r1.dts > > > > > new file mode 100644 > > > > > index 000000000000..f95273052da0 > > > > > --- /dev/null > > > > > +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine-herobrine-r1.dts > > > > > @@ -0,0 +1,313 @@ > > > > > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) > > > > > +/* > > > > > + * Google Herobrine board device tree source > > > > > + * > > > > > + * Copyright 2022 Google LLC. > > > > > + */ > > > > > + > > > > > +/dts-v1/; > > > > > + > > > > > +#include "sc7280-herobrine.dtsi" > > > > > + > > > > > +/ { > > > > > + model = "Google Herobrine (rev1+)"; > > > > > + compatible = "google,herobrine", "qcom,sc7280"; > > > > > > > > Can we stop adding "qcom,sc7280" to the board compatible string? It > > > > looks out of place. It's the compatible for the SoC and should really be > > > > the compatible for the /soc node. > > > > > > I don't have any objections, but I feel like this is the type of thing > > > I'd like Bjorn to have the final say on. What say you, Bjorn? > > > > > > > One practical case I can think of right away, where this matters is in > > cpufreq-dt-plat.c where we blocklist qcom,sc7280. > > > > I don't know if we rely on this in any other places, but I'm not keen on > > seeing a bunch of board-specific compatibles sprinkled throughout the > > implementation - it's annoying enough having to add each platform to > > these drivers. > > Looking at sc7180, grep only shows cpufreq-dt-plat.c > Good, then we handle all other platform specifics in drivers using platform-specific compatibles. > $ git grep qcom,sc7180\" -- drivers > drivers/cpufreq/cpufreq-dt-platdev.c: { .compatible = "qcom,sc7180", }, > > Simplest solution would be to look at / and /soc for a compatible > string. > You mean that / would contain the device's compatible and /soc the soc's compatible? I'm afraid I don't see how this would help you - you still need the compatible in the dts, just now in two places. Either we leave it as is - which follows my interpretation of what the DT spec says - or we (and the DT maitainers) agree that it shouldn't be there (because this dtb won't run on any random qcom,sc7180 anyways) at all. Regards, Bjorn > $ git grep -W 'soc[^:]*{' -- arch/arm*/boot/dts/ | grep compatible | > grep -v "simple-bus" > > doesn't show many hits. The first hit is "ti,omap-infra" which is > actually inside an soc node, but even then I don't see anything that > matches the cpufreq-dt-plat.c lists. > > ----8<----- > diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c > b/drivers/cpufreq/cpufreq-dt-platdev.c > index ca1d103ec449..32bfe453f8b4 100644 > --- a/drivers/cpufreq/cpufreq-dt-platdev.c > +++ b/drivers/cpufreq/cpufreq-dt-platdev.c > @@ -179,25 +179,29 @@ static bool __init cpu0_node_has_opp_v2_prop(void) > static int __init cpufreq_dt_platdev_init(void) > { > struct device_node *np = of_find_node_by_path("/"); > + struct device_node *soc_np = of_find_node_by_path("/soc"); > const struct of_device_id *match; > const void *data = NULL; > > - if (!np) > + if (!np && !soc_np) > return -ENODEV; > > match = of_match_node(allowlist, np); > - if (match) { > + if (match || (match = of_match_node(allowlist, soc_np))) { > data = match->data; > goto create_pdev; > } > > - if (cpu0_node_has_opp_v2_prop() && !of_match_node(blocklist, np)) > + if (cpu0_node_has_opp_v2_prop() && !of_match_node(blocklist, np) && > + !of_match_node(blocklist, soc_np)) > goto create_pdev; > > + of_node_put(soc_np); > of_node_put(np); > return -ENODEV; > > create_pdev: > + of_node_put(soc_np); > of_node_put(np); > return PTR_ERR_OR_ZERO(platform_device_register_data(NULL, "cpufreq-dt", > -1, data,