Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4651772iob; Sun, 8 May 2022 20:39:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJOqZHAeN5rtl2ghMWFo++wMXPejGL/9X3CtOcvGRcxfVZl8g9LfSfD/HknOJF5ZNpbipS X-Received: by 2002:a17:903:20d3:b0:15b:151c:cadb with SMTP id i19-20020a17090320d300b0015b151ccadbmr14580766plb.154.1652067582177; Sun, 08 May 2022 20:39:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652067582; cv=none; d=google.com; s=arc-20160816; b=IooLEsjz+ZtGtU0q9a05m6BfrG5hwFW4oSkzb4FFHN/MiP8IhI7vjcJcGa2CMTEoKy 58OvgDxGEIWwNmRyIcZGPRw2tl23/UML6KN31sQZnTUX2DIGJiSf7NkHI1QDE5nFa8bQ HZ6MSB2SqANU2+qzB5lCLiY8ZvxVPj+aidM0pJBMmW8lntl/WkjGjuIhHME8fP301c4D T5ZkuLj9wahaPlZKRn/58wOYrjS4DnGn0ZD2hf0pZWzeFHuIRPqop3HHRO//3glw8fxA D2ZQt9ib7zmk2Vl53qZtBxhtcKsjWazG8DEFO3zXGAde5jGt05IcL2wNqfF+kiZFKBjm a8AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=kPC8xpzAw3seVpPCqG0lfumLyo2lZCHJj18NiX9s2GQ=; b=qeZSPm4/wjfgh/zufMjwZTYAn7TcOF4DeBHcHov2gK59z5AnDocG0jikVOTsMLHENf zEGYnCm1Oat5k4JLS/EHoQ8FEPg1pb/mzaje3ZXiMpFk1TIwAegO1mSxU8v3tawqA8my JU4GL/Qn0z6EMEizq8o+6feWtLyiCePAdrCXHiFMuvPyDmLLRzFwCoH8iGEsjIgk0BOt rUCUUoSSx1DbWlR0UgMFhjMDHFugti4DAcB9hGaHqcJB6S6ihg+ksJBxeeEyuxaDOPkR WxJ+sMux3ozKigthBIelRA3eRjN3y0yX/3tEe5b0l07dnmN+qR3MHHBvkZbDiCIeeXDQ xZYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="S/43Xout"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c2-20020a056a00248200b00510625a3267si14499008pfv.118.2022.05.08.20.39.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 20:39:42 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="S/43Xout"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5FCEFAFADF; Sun, 8 May 2022 20:39:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353291AbiEGRP1 (ORCPT + 99 others); Sat, 7 May 2022 13:15:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236727AbiEGRPY (ORCPT ); Sat, 7 May 2022 13:15:24 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31B1F21241 for ; Sat, 7 May 2022 10:11:37 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id bv19so19673197ejb.6 for ; Sat, 07 May 2022 10:11:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=kPC8xpzAw3seVpPCqG0lfumLyo2lZCHJj18NiX9s2GQ=; b=S/43XoutSBi6deU8mLJslFLwl8lpTrvEDiYFDnw6iLR2GKAGQBKLGoVdVaRu8dcmiR b3rhibp9neHf6zEr5PRyqtW/EpCrzzvxvS6G+E6YKwtCfzZh+8Aa5lBZ20IZ9sZiGXkT 2vh0BvP1XFEpQi3so1V/vNkJ50lKSU8xhff9yqfsFIuVb23lv2BCSvprK4tHzzRSBgiB V15+symef3iIL1I4xHZQrc0UJp00WTa4MxHXShqtJJ8izibylrmL9QTAa9bnnGHXqct0 c0Tq2giBHSf5F+hm/BNEbz5t1EaTOJihEQc2XzeP8tstuhZOPz1wLhXZDHShNGknM+3t OfKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=kPC8xpzAw3seVpPCqG0lfumLyo2lZCHJj18NiX9s2GQ=; b=XFAc2xdIEQY4fRLk9eXeGiUIgPygSIBzsnsdfuNPD6+nFxYMzxo1itasksb3U5IvCc WqCC73GXQnTu2ptgfkj693WjfYXiwh3x8faR8nDQAYYu3GWcYadBlLc55B3ZReJSSPWW lGNSzBZ5bkszMkBRqJornj3VqdBJRnPlZT4iFv1m75XL6BRzFIR2mJ20eBlBoXu4T9vi Zxsc8xUAOzQ+nyWbZlJ+7r2/2l/oH8PmSpBw8UeYEgHFq0UazMW82/b4jzGTVF4OTrWa w4FFjKinV9rqT3JesneSihNuSFcni2jVW0nQZiUbqlozKo88juLgI8vaf9lq6p18RTFo 35sg== X-Gm-Message-State: AOAM5322gtiSKRiWhwDDWvlOKyeMsYHg8aTjk6PJdtOcnUTxhUBjXhui 6RTgzDGUx1Yqp9tq/EwbgYmAoA== X-Received: by 2002:a17:906:9b8a:b0:6f3:fcc9:f863 with SMTP id dd10-20020a1709069b8a00b006f3fcc9f863mr8163934ejc.672.1651943495721; Sat, 07 May 2022 10:11:35 -0700 (PDT) Received: from [192.168.0.233] (xdsl-188-155-176-92.adslplus.ch. [188.155.176.92]) by smtp.gmail.com with ESMTPSA id ej5-20020a056402368500b0042617ba63d1sm3801018edb.91.2022.05.07.10.11.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 May 2022 10:11:35 -0700 (PDT) Message-ID: <63b76cc7-4a86-fb78-282e-acb16d09bb36@linaro.org> Date: Sat, 7 May 2022 19:11:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH] CHROMIUM: arm64: dts: qcom: Add sc7180-gelarshie Content-Language: en-US To: Doug Anderson Cc: =?UTF-8?Q?Krzysztof_Koz=c5=82owski?= , Mars Chen , Andy Gross , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , linux-arm-msm , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , Julius Werner References: <20220330090947.9100-1-chenxiangrui@huaqin.corp-partner.google.com> <606cc762-a0c2-49a4-3e5d-d2dbd4595bc7@linaro.org> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/05/2022 19:04, Krzysztof Kozlowski wrote: > On 06/05/2022 23:33, Doug Anderson wrote: >> Hi, >> >> On Wed, May 4, 2022 at 12:04 AM Krzysztof Kozlowski >> wrote: >>> >>>>>>> The most specific compatible identifies or, like recently Rob confirmed >>>>>>> in case of Renesas, the list of compatibles: >>>>>>> https://lore.kernel.org/linux-devicetree/Yk2%2F0Jf151gLuCGz@robh.at.kernel.org/ >>>>>> >>>>>> I'm confused. If the device tree contains the compatibles: >>>>>> >>>>>> "google,lazor-rev4", "google,lazor-rev3", "google,lazor", "qualcomm,sc7180" >>>>>> >>>>>> You want to know what board you're on and you look at the compatible, >>>>>> right? You'll decide that you're on a "google,lazor-rev4" which is the >>>>>> most specific compatible. ...but you could have booted a >>>>>> "google,lazor-rev3". How do you know? >>>>> >>>>> Applying the wrong DTB on the wrong device will always give you the >>>>> wrong answer. You can try too boot google,lazor-rev3 on x86 PC and it >>>>> does not make it a google,lazor-rev3... >>>> >>>> I don't understand what you're saying here. If a device tree has the compatible: >>>> >>>> "google,lazor-rev4", "google,lazor-rev3", "google,lazor", "qualcomm,sc7180" >>>> >>>> You wouldn't expect to boot it on an x86 PC, but you would expect to >>>> boot it on either a "google,lazor-rev4" _or_ a "google,lazor-rev3". >>> >>> Yes, but booting it does not mean that the hardware is rev3 or rev4. >>> Booting it means only that we are running DTB on a compatible hardware. >>> The DTB determines what is accessible to user-space, not what *really* >>> the hardware is. The user-space (since we are going now to original >>> question) reads it and can understand that it is running on hardware >>> compatible with rev3 - either rev3 or rev4 - and act accordingly. >>> >>>> Correct? Now, after we've booted software wants to look at the >>>> compatible of the device tree that was booted. The most specific entry >>>> in that device tree is "google,lazor-rev4". ...but we could have >>>> booted it on a "google,lazor-rev3". How can you know? >>> >>> No, providing and loading a rev4 DTB on a rev3 board is not correct and >>> does not make any sense. rev3 boards are not compatible with rev4, it's >>> the other way. Not every fruit is an apple, but every apple is a fruit. >>> This is why I used that example - if you load rev4 DTB on rev3 hardware >>> then you have totally wrong booting process. >> >> I think this is the crux of the difference in opinion and there's no >> reasonable way I'm aware of to do what you're asking. If -rev3 and >> -rev4 are identical from a software point of view it would be silly >> not to share a device tree for the two of them. The number of device >> trees we'd have to land in the kernel tree would be multiplied by >> several times and we'd have many that are identical except for this >> compatible string. I see no benefit here and lots of downside. > > Wait, we agreed that you don't consider them identical, didn't we? If > they are identical, you do not need rev4 at all. So they are not > identical... > > If they are identical, just use rev3 and problem is gone. > If they are not identical or you need to assume there will be difference > (for future), then just go with rev3 without fallback to rev3 and also > problem is gone. This should be: If they are not identical or you need to assume there will be difference (for future), then just go with rev4 without fallback to rev3 and also problem is gone. > > Right now it's not possible to validate QCOM DTSes against DT bindings > because they throw big fat warnings about undocumented top compatibles. > This is a downside for us. > > Remember, you do not have to use Devicetree or Linux at all if it causes > you some downsides... No one is forced. :) If you choose to use it, > sorry, it comes with some requirements like being following Devicetree > specification or the binding guidelines. > > Best regards, > Krzysztof Best regards, Krzysztof