From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD136C43334 for ; Mon, 25 Jul 2022 16:56:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236614AbiGYQ4m (ORCPT ); Mon, 25 Jul 2022 12:56:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236610AbiGYQ4m (ORCPT ); Mon, 25 Jul 2022 12:56:42 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67D35DE97 for ; Mon, 25 Jul 2022 09:56:40 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id p10so11462283lfd.9 for ; Mon, 25 Jul 2022 09:56:40 -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 :from:to:cc:references:in-reply-to:content-transfer-encoding; bh=FsuTzaaPK5e0cYsKq7XYkHCLfJ+m3/TH+G1ZydhMB/s=; b=v5bTyl8xzF0uEr1oIJkWF72ebY7+9goAiiLXHg7XQC4qZrhuveEbPjPy77HOTMShOP XIs6GLlTInKobHIDOMKHOgRLzX54CLV/Xh3kjnEUqpjAUzHLJEdBq8fQ/m4Sx0LfpNEU zz1MVgDdVrtuhl0VwetiSUt10LrFpsAIEFFJIX42OEsHjsUqp5lbUhlLioayrMHlCGqL JCwpOkRJcEsNxbrwymfTZ8Dzxbushxcx1G6a04oaf1JmXQ7anXqh+wFw8ghKCc30uWVj 1BYIRoWcT9msffpfGhtoKli7lidI80TZXKVx+O7/yjqN6QxruOevEajJ05buajAB+3n5 4H5w== 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:from:to:cc:references:in-reply-to :content-transfer-encoding; bh=FsuTzaaPK5e0cYsKq7XYkHCLfJ+m3/TH+G1ZydhMB/s=; b=1/c5wiO3D0YpXt1/s2UwSvVYRT+ZyVHh7rO0ppFOb2ULVhQ9iaC+d7aZVMtcFgDDaD Va9X7Qn9cqdviLyczQJsnB5aB/2M1MpRdNLBQfWm+L+gq9EbC2Vl9ifz/0+bqTabDb7E 0JAyG6Xu5Fla7j+xH2OlCFvXiG4Nz2eW3GeDdBKtGOEPx/qUGDS02GQXYdYsPmtenLtc NJ9tWmVmAAiDKSzRILNN9MjkWBk2Yz+Hf617zdndMQHwG3T8jOESL5zZ9tpp+L9qDTzA urnDJzRKrO457R4w8QPwAVdRClfUW15shZwmKq//kN3ABdmpAtiGUX2z/3fN3xXJgefU VNOw== X-Gm-Message-State: AJIora/73MG3e4J4GAHSJbnsDqim1VyXVjBKhTj1ZuARrTJUUDBC1/Lq y0Z8xEHCk7HLtT9VoNb8hCY2LA== X-Google-Smtp-Source: AGRyM1uzUzqdl7KeilDJN/k0QNKBXacT9Z3RiGpNvmGNY/h1+JIGCx6qZPwl8GG0hhtJ6k7pGMhwpA== X-Received: by 2002:a05:6512:22d2:b0:489:dac8:3422 with SMTP id g18-20020a05651222d200b00489dac83422mr4998003lfu.317.1658768198622; Mon, 25 Jul 2022 09:56:38 -0700 (PDT) Received: from [192.168.3.197] (78-26-46-173.network.trollfjord.no. [78.26.46.173]) by smtp.gmail.com with ESMTPSA id u11-20020ac258cb000000b0048a884bdb84sm873549lfo.52.2022.07.25.09.56.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Jul 2022 09:56:38 -0700 (PDT) Message-ID: <4298c7a7-b730-635f-ae32-4662935c767f@linaro.org> Date: Mon, 25 Jul 2022 18:56:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 0/3] dt-bindings: arm: qcom: define schema, not devices Content-Language: en-US From: Krzysztof Kozlowski To: Doug Anderson , Dmitry Baryshkov Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , linux-arm-msm , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Stephen Boyd References: <20220723090942.1637676-1-dmitry.baryshkov@linaro.org> <76defcb3-8566-286a-d953-54c4a2b04782@linaro.org> In-Reply-To: <76defcb3-8566-286a-d953-54c4a2b04782@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 25/07/2022 18:41, Krzysztof Kozlowski wrote: > On 25/07/2022 18:25, Doug Anderson wrote: >> Let's look specifically at the device tree file for the LTE board. One >> way to look at it is that the dts for the LTE board should have >> compatibles: >> compatible = "lte", "wifi-only" >> >> The above matches the normal device tree mentality. It says: "hey, if >> you've got a lte driver for this board then use it; otherwise use the >> wifi-only driver". >> >> However, the above is actually broken for the bootloader use case. The >> bootloader is trying to pick a device tree and, to the bootloader, the >> above says "you can use this dts for either an lte board or a >> wifi-only board". That's bad. If the bootloader picks this device tree >> for a wifi-only board then the OS will try to initialize lte and >> things will crash. To go further, if you think about it things >> actually work fine if the wifi-only device tree says it's compatible >> with the LTE board. This is why I say it's opposite... ;-) > > This is not specific to "bootloaders" but your specific implementation > of entire chain. How you described it, you have dependent pieces - > user-space must use the same DTB as bootloader chosen, but bootloader > makes different choices than user-space. It's perfectly fine to make > these choices different, but then user-space should not depend on > something which was/was not initialized in bootloader. > > IOW, if bootloader picked up generic WiFi compatible and user-space will > crash if picking up specific comaptible, you have a dependency and > user-space should probably bind to modified DTB, where LTE comaptible is > removed. > > Other systems - I would say most of them - are independent, IOW, we try > to make kernel and user-space independent of what bootloader did, > because we are never sure what bootloader actually did and what DTS it > received. You can BTW compare it nicely to Linux device driver binding. If a driver binds to more generic (WiFi) compatible, it is not allowed to use any features/code related to more specific compatible (LTE). Your case breaks this rule. Bootloader bound to generic (WiFi) compatible, but it passed entire DTB/FDT to kernel/user-space which can then run code for more specific compatible. Although I understand the point the board compatibles by themself provide little help for such use case. Best regards, Krzysztof