dt-bindings: qcom: geni-se: Fix '#address-cells' & '#size-cells' related dt-binding error
Message ID | 20230113201038.267449-1-bhupesh.sharma@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp462812wrt; Fri, 13 Jan 2023 12:16:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXtiMyGtp7PmakAcYT2nqdY/PxaVSm4MGk0UgfF7bq88kCPsqqwkDSA2XM3E+exyWw4RZBEb X-Received: by 2002:a17:907:8c0a:b0:7c4:edee:28c0 with SMTP id ta10-20020a1709078c0a00b007c4edee28c0mr87331520ejc.24.1673640978558; Fri, 13 Jan 2023 12:16:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673640978; cv=none; d=google.com; s=arc-20160816; b=sUd3MyHIAJSEigyvMNkX40zP/KaxydgSXSueQbyaF9tD18zwFHzy4pF1nRFgjgUo2L kRnzd2d0u0b7R4cYPymIW52CSFTvkapwoEC7teAkZhSUf5KTbL/icIuBjCy2FxoUdUhk iJ3qEeV/QzNDZIZ5DuRptSlCZjLBmDWCX/Ee6eFRl0IndOSNMIrZcFdXO47lAHKZMg2s IaauFm+Q76Byi37mCMwHNVCh86Jm9xLY7iYBtFfi1bUYH7dx/8a+e+zkBoqegk/0wtoD 6IfV7GHn/45bWkr19JTLPsuEF+y1es6C7Z5J8yS/dANDWDI3jM6TUTO7oYx00WSWUQFV tcwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=u9yUG8p2AvsCrfrOo0UvzT5Iu4BONOHKRQnB72b9ZJU=; b=nyDWEF3sjTlj9y14X1okMyLKKA4mxJylmhcX30pEsK/A0yoAULaJxiUgfa5xUad/0M u0+YfteL5pwdtC0f7h3TRuuVovPocDuAI6zzvbCWGgw+3AjjnCZhS5tMGBuapJponFFx pXCGHW7JyhbOVnz61SQJ8S5h345V1dh1N5U7VZOwA0cgBCG+Hvqyd3gea8Ae8zqtusj4 TBsjsVGvhu6i83TN0gXXwEEhkDlpnrVdBc8nEGXOZfkoTnIsanoNHBIW88PVnAjJ4OnC YZtEyJWfrNsdLTFcNOaeVJqpVVo19BB523g05s5J/L6nP3kfGRKnKRGX2iDq6HRjh6nz eKyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uHkwhfvg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg18-20020a170907971200b007c10f641a2dsi23438199ejc.148.2023.01.13.12.15.54; Fri, 13 Jan 2023 12:16:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uHkwhfvg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231137AbjAMUK5 (ORCPT <rfc822;andrewvogler123@gmail.com> + 99 others); Fri, 13 Jan 2023 15:10:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230110AbjAMUKx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 13 Jan 2023 15:10:53 -0500 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 734AF88DE1 for <linux-kernel@vger.kernel.org>; Fri, 13 Jan 2023 12:10:51 -0800 (PST) Received: by mail-pf1-x433.google.com with SMTP id 207so896550pfv.5 for <linux-kernel@vger.kernel.org>; Fri, 13 Jan 2023 12:10:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=u9yUG8p2AvsCrfrOo0UvzT5Iu4BONOHKRQnB72b9ZJU=; b=uHkwhfvgcFrY265BN+JmcPVnnegGsSZSRHjT558d0FZMEPTETlx205iydLJkvMIvJw kYDrf940r/W9uH94T/0Skd8Gw3sfcXr4liP8jTos00gu/6Gbsc9vO5qj6crsVBHJxGIF tC3FU6hWnhGMlzUih7vi5n4Jc8oUHDKbCfzSFoQP2maXznteBaq5vLD0x9rJqKVlnBew WTfBEdmjAtDqxav5S8LmXyeeoiaOLO8c1UzRXGFhb6Lp2trrOeu9ynBtukjjP5NPrRmP TmIa9p3syCRnxYx6wYKT6BL3usc1YRI3uD6fl4VQRxXYLNMCewUU05OsfABcI7Ku4xio Evlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=u9yUG8p2AvsCrfrOo0UvzT5Iu4BONOHKRQnB72b9ZJU=; b=7S+BV2+eZdclrDQ9QL6xh1mXlY/pfmC/d0MEk2o37Mqvv6WZ5OTHPqQsUbiXSIODTI y1ku6JIUpHhKijxjH6cU3IADZUQwysVMNMya4VaSHJqi1IuV3kWbmU61VNr4bqgkJ+JG ugnlHbXGubwCfuzCxTkafU/kXmAMPedL4uFMFnNYTLQUVyMhQ23OV5i5SUnRHBTiBxEF ITSnRSdYQ7G4ac/VjlZd+RGgYtrBhZu6I9vkLl+3aFhxj/5PoQrEBAmTNXitA9xbKZAE vrWPUp4myNQ6FQUyAthEz/oG66dPe2Hba8wNC1F2szTuc4FzztVRxd3/jK0KdY+xxsFL VqEA== X-Gm-Message-State: AFqh2kr5cJpytwAOKzzM46G2VEYE5lClYXFuPB0eigoY0NQB+A4r2rSQ zXQPJQl9Wn7roNbNk6u5kNgubysBvHpRrH26 X-Received: by 2002:a62:84d0:0:b0:58b:bc3a:6234 with SMTP id k199-20020a6284d0000000b0058bbc3a6234mr3325205pfd.11.1673640650860; Fri, 13 Jan 2023 12:10:50 -0800 (PST) Received: from localhost.localdomain ([2401:4900:1c60:63d3:2d69:9f71:187e:f085]) by smtp.gmail.com with ESMTPSA id d63-20020a623642000000b0057691fb0d37sm13983740pfa.193.2023.01.13.12.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 12:10:50 -0800 (PST) From: Bhupesh Sharma <bhupesh.sharma@linaro.org> To: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org Cc: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, linux-kernel@vger.kernel.org, bhupesh.linux@gmail.com, bhupesh.sharma@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Subject: [PATCH] dt-bindings: qcom: geni-se: Fix '#address-cells' & '#size-cells' related dt-binding error Date: Sat, 14 Jan 2023 01:40:38 +0530 Message-Id: <20230113201038.267449-1-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754939762891279414?= X-GMAIL-MSGID: =?utf-8?q?1754939762891279414?= |
Series |
dt-bindings: qcom: geni-se: Fix '#address-cells' & '#size-cells' related dt-binding error
|
|
Commit Message
Bhupesh Sharma
Jan. 13, 2023, 8:10 p.m. UTC
Fix the following '#address-cells' & '#size-cells' related
dt-binding error:
$ make dtbs_check
From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml
arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dtb: geniqup@4ac0000:
#address-cells:0:0: 2 was expected
From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On 13/01/2023 21:10, Bhupesh Sharma wrote: > Fix the following '#address-cells' & '#size-cells' related > dt-binding error: > > $ make dtbs_check > > From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml > arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dtb: geniqup@4ac0000: > #address-cells:0:0: 2 was expected > From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml Don't we want rather to unify the soc address range? Best regards, Krzysztof
On Sun, 15 Jan 2023 at 20:57, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 13/01/2023 21:10, Bhupesh Sharma wrote: > > Fix the following '#address-cells' & '#size-cells' related > > dt-binding error: > > > > $ make dtbs_check > > > > From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml > > arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dtb: geniqup@4ac0000: > > #address-cells:0:0: 2 was expected > > From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml > > Don't we want rather to unify the soc address range? Well, the assumption in the original dt-bindings was that every reg variable is 4 * u32 wide (as most new qcom SoCs set #address- and #size-cells to <2>). However, that is not the case for all of the SoCs. So, ideally we shouldn't set the "#address-cells" and "#size-cells": as const: 2 in the bindings. See as an example: https://www.kernel.org/doc/Documentation/devicetree/bindings/usb/usb-device.yaml Thanks.
On 15/01/2023 22:33, Bhupesh Sharma wrote: > On Sun, 15 Jan 2023 at 20:57, Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: >> >> On 13/01/2023 21:10, Bhupesh Sharma wrote: >>> Fix the following '#address-cells' & '#size-cells' related >>> dt-binding error: >>> >>> $ make dtbs_check >>> >>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >>> arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dtb: geniqup@4ac0000: >>> #address-cells:0:0: 2 was expected >>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >> >> Don't we want rather to unify the soc address range? > > Well, the assumption in the original dt-bindings was that every reg > variable is 4 * u32 wide (as most new qcom SoCs set #address- and > #size-cells to <2>). However, that is not the case for all of the > SoCs. Hm, which device of that SoC cannot be used with address/size cells 2? > > So, ideally we shouldn't set the "#address-cells" and "#size-cells": > as const: 2 in the bindings. > > See as an example: > https://www.kernel.org/doc/Documentation/devicetree/bindings/usb/usb-device.yaml How USB device - so entirely different device, not MMIO! - is related here? Best regards, Krzysztof
On Mon, 16 Jan 2023 at 13:23, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 15/01/2023 22:33, Bhupesh Sharma wrote: > > On Sun, 15 Jan 2023 at 20:57, Krzysztof Kozlowski > > <krzysztof.kozlowski@linaro.org> wrote: > >> > >> On 13/01/2023 21:10, Bhupesh Sharma wrote: > >>> Fix the following '#address-cells' & '#size-cells' related > >>> dt-binding error: > >>> > >>> $ make dtbs_check > >>> > >>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml > >>> arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dtb: geniqup@4ac0000: > >>> #address-cells:0:0: 2 was expected > >>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml > >> > >> Don't we want rather to unify the soc address range? > > > > Well, the assumption in the original dt-bindings was that every reg > > variable is 4 * u32 wide (as most new qcom SoCs set #address- and > > #size-cells to <2>). However, that is not the case for all of the > > SoCs. > > Hm, which device of that SoC cannot be used with address/size cells 2? As noted in the git log already the geniqup on sm6115 / sm4250 cannot be used with address/size cells 2 (See: https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/sm6115.dtsi#L795) > > So, ideally we shouldn't set the "#address-cells" and "#size-cells": > > as const: 2 in the bindings. > > > > See as an example: > > https://www.kernel.org/doc/Documentation/devicetree/bindings/usb/usb-device.yaml > > > How USB device - so entirely different device, not MMIO! - is related here? > > Best regards, > Krzysztof >
On 16.01.2023 16:43, Bhupesh Sharma wrote: > On Mon, 16 Jan 2023 at 13:23, Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: >> >> On 15/01/2023 22:33, Bhupesh Sharma wrote: >>> On Sun, 15 Jan 2023 at 20:57, Krzysztof Kozlowski >>> <krzysztof.kozlowski@linaro.org> wrote: >>>> >>>> On 13/01/2023 21:10, Bhupesh Sharma wrote: >>>>> Fix the following '#address-cells' & '#size-cells' related >>>>> dt-binding error: >>>>> >>>>> $ make dtbs_check >>>>> >>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >>>>> arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dtb: geniqup@4ac0000: >>>>> #address-cells:0:0: 2 was expected >>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >>>> >>>> Don't we want rather to unify the soc address range? >>> >>> Well, the assumption in the original dt-bindings was that every reg >>> variable is 4 * u32 wide (as most new qcom SoCs set #address- and >>> #size-cells to <2>). However, that is not the case for all of the >>> SoCs. >> >> Hm, which device of that SoC cannot be used with address/size cells 2? > > As noted in the git log already the geniqup on sm6115 / sm4250 cannot > be used with address/size cells 2 (See: > https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/sm6115.dtsi#L795) SM6115 (and pretty much every other arm64 msm platform newer than 8916) should be using addr/size-cells = 2 along with (dma-)ranges of 36 bit, as that's what their smmus use and otherwise some addresses may get cut off in translation, or so the story went with 845 N years ago.. We can either pursue this patch or I can submit the 2-cell-ification if you don't plan on adding more nodes shortly Konrad > >>> So, ideally we shouldn't set the "#address-cells" and "#size-cells": >>> as const: 2 in the bindings. >>> >>> See as an example: >>> https://www.kernel.org/doc/Documentation/devicetree/bindings/usb/usb-device.yaml >> >> >> How USB device - so entirely different device, not MMIO! - is related here? >> >> Best regards, >> Krzysztof >>
On 1/16/23 9:24 PM, Konrad Dybcio wrote: > > > On 16.01.2023 16:43, Bhupesh Sharma wrote: >> On Mon, 16 Jan 2023 at 13:23, Krzysztof Kozlowski >> <krzysztof.kozlowski@linaro.org> wrote: >>> >>> On 15/01/2023 22:33, Bhupesh Sharma wrote: >>>> On Sun, 15 Jan 2023 at 20:57, Krzysztof Kozlowski >>>> <krzysztof.kozlowski@linaro.org> wrote: >>>>> >>>>> On 13/01/2023 21:10, Bhupesh Sharma wrote: >>>>>> Fix the following '#address-cells' & '#size-cells' related >>>>>> dt-binding error: >>>>>> >>>>>> $ make dtbs_check >>>>>> >>>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >>>>>> arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dtb: geniqup@4ac0000: >>>>>> #address-cells:0:0: 2 was expected >>>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >>>>> >>>>> Don't we want rather to unify the soc address range? >>>> >>>> Well, the assumption in the original dt-bindings was that every reg >>>> variable is 4 * u32 wide (as most new qcom SoCs set #address- and >>>> #size-cells to <2>). However, that is not the case for all of the >>>> SoCs. >>> >>> Hm, which device of that SoC cannot be used with address/size cells 2? >> >> As noted in the git log already the geniqup on sm6115 / sm4250 cannot >> be used with address/size cells 2 (See: >> https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/sm6115.dtsi#L795) > SM6115 (and pretty much every other arm64 msm platform newer than 8916) > should be using addr/size-cells = 2 along with (dma-)ranges of 36 bit, as > that's what their smmus use and otherwise some addresses may get cut off > in translation, or so the story went with 845 N years ago.. We can either > pursue this patch or I can submit the 2-cell-ification if you don't plan on > adding more nodes shortly Have you tested this combination on SM6115 like SoCs with various IPs? I have tried a few experiments in the past and not all IPs work well with 36-bit DMA ranges (atleast not on the boards I have). So, I think it might lead to more breakage (unless we are sure of a well-tested fix). A simpler patch to fix the dt-bindings looks more useful IMO. Thanks, Bhupesh
On 16.01.2023 17:02, Bhupesh Sharma wrote: > > On 1/16/23 9:24 PM, Konrad Dybcio wrote: >> >> >> On 16.01.2023 16:43, Bhupesh Sharma wrote: >>> On Mon, 16 Jan 2023 at 13:23, Krzysztof Kozlowski >>> <krzysztof.kozlowski@linaro.org> wrote: >>>> >>>> On 15/01/2023 22:33, Bhupesh Sharma wrote: >>>>> On Sun, 15 Jan 2023 at 20:57, Krzysztof Kozlowski >>>>> <krzysztof.kozlowski@linaro.org> wrote: >>>>>> >>>>>> On 13/01/2023 21:10, Bhupesh Sharma wrote: >>>>>>> Fix the following '#address-cells' & '#size-cells' related >>>>>>> dt-binding error: >>>>>>> >>>>>>> $ make dtbs_check >>>>>>> >>>>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >>>>>>> arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dtb: geniqup@4ac0000: >>>>>>> #address-cells:0:0: 2 was expected >>>>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >>>>>> >>>>>> Don't we want rather to unify the soc address range? >>>>> >>>>> Well, the assumption in the original dt-bindings was that every reg >>>>> variable is 4 * u32 wide (as most new qcom SoCs set #address- and >>>>> #size-cells to <2>). However, that is not the case for all of the >>>>> SoCs. >>>> >>>> Hm, which device of that SoC cannot be used with address/size cells 2? >>> >>> As noted in the git log already the geniqup on sm6115 / sm4250 cannot >>> be used with address/size cells 2 (See: >>> https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/sm6115.dtsi#L795) >> SM6115 (and pretty much every other arm64 msm platform newer than 8916) >> should be using addr/size-cells = 2 along with (dma-)ranges of 36 bit, as >> that's what their smmus use and otherwise some addresses may get cut off >> in translation, or so the story went with 845 N years ago.. We can either >> pursue this patch or I can submit the 2-cell-ification if you don't plan on >> adding more nodes shortly > > > Have you tested this combination on SM6115 like SoCs with various IPs? I have tried a few experiments in the past and not all IPs work well with 36-bit DMA ranges (atleast not on the boards I have). Can you list any specific examples? I've been using it for quite some time now and I see nothing wrong.. > > So, I think it might lead to more breakage (unless we are sure of a well-tested fix). A simpler patch to fix the dt-bindings looks more useful IMO. I'm not saying no, you just have to convince Krzysztof :D Konrad > > Thanks, > Bhupesh
On 1/16/23 9:35 PM, Konrad Dybcio <konrad.dybcio@linaro.org> wrote: > > > On 16.01.2023 17:02, Bhupesh Sharma wrote: > > > > On 1/16/23 9:24 PM, Konrad Dybcio wrote: > >> > >> > >> On 16.01.2023 16:43, Bhupesh Sharma wrote: > >>> On Mon, 16 Jan 2023 at 13:23, Krzysztof Kozlowski > >>> <krzysztof.kozlowski@linaro.org> wrote: > >>>> > >>>> On 15/01/2023 22:33, Bhupesh Sharma wrote: > >>>>> On Sun, 15 Jan 2023 at 20:57, Krzysztof Kozlowski > >>>>> <krzysztof.kozlowski@linaro.org> wrote: > >>>>>> > >>>>>> On 13/01/2023 21:10, Bhupesh Sharma wrote: > >>>>>>> Fix the following '#address-cells' & '#size-cells' related > >>>>>>> dt-binding error: > >>>>>>> > >>>>>>> $ make dtbs_check > >>>>>>> > >>>>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml > >>>>>>> arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dtb: geniqup@4ac0000: > >>>>>>> #address-cells:0:0: 2 was expected > >>>>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml > >>>>>> > >>>>>> Don't we want rather to unify the soc address range? > >>>>> > >>>>> Well, the assumption in the original dt-bindings was that every reg > >>>>> variable is 4 * u32 wide (as most new qcom SoCs set #address- and > >>>>> #size-cells to <2>). However, that is not the case for all of the > >>>>> SoCs. > >>>> > >>>> Hm, which device of that SoC cannot be used with address/size cells 2? > >>> > >>> As noted in the git log already the geniqup on sm6115 / sm4250 cannot > >>> be used with address/size cells 2 (See: > >>> https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/sm6115.dtsi#L795) > >> SM6115 (and pretty much every other arm64 msm platform newer than 8916) > >> should be using addr/size-cells = 2 along with (dma-)ranges of 36 bit, as > >> that's what their smmus use and otherwise some addresses may get cut off > >> in translation, or so the story went with 845 N years ago.. We can either > >> pursue this patch or I can submit the 2-cell-ification if you don't plan on > >> adding more nodes shortly > > > > > > Have you tested this combination on SM6115 like SoCs with various IPs? I have tried a few experiments in the past and not all IPs work well with 36-bit DMA ranges (atleast not on the boards I have). > Can you list any specific examples? I've been using it for > quite some time now and I see nothing wrong.. I remember seeing some issues with SDHC controller booting (uSD card use case) with sm6115, but I cannot find the appropriate dmesg right now. > > > > So, I think it might lead to more breakage (unless we are sure of a well-tested fix). A simpler patch to fix the dt-bindings looks more useful IMO. > I'm not saying no, you just have to convince Krzysztof :D :) Thanks, Bhupesh
On 16.01.2023 17:18, bhupesh.sharma@linaro.org wrote: > > On 1/16/23 9:35 PM, Konrad Dybcio <konrad.dybcio@linaro.org> wrote: >> >> >> On 16.01.2023 17:02, Bhupesh Sharma wrote: >> > >> > On 1/16/23 9:24 PM, Konrad Dybcio wrote: >> >> >> >> >> >> On 16.01.2023 16:43, Bhupesh Sharma wrote: >> >>> On Mon, 16 Jan 2023 at 13:23, Krzysztof Kozlowski >> >>> <krzysztof.kozlowski@linaro.org> wrote: >> >>>> >> >>>> On 15/01/2023 22:33, Bhupesh Sharma wrote: >> >>>>> On Sun, 15 Jan 2023 at 20:57, Krzysztof Kozlowski >> >>>>> <krzysztof.kozlowski@linaro.org> wrote: >> >>>>>> >> >>>>>> On 13/01/2023 21:10, Bhupesh Sharma wrote: >> >>>>>>> Fix the following '#address-cells' & '#size-cells' related >> >>>>>>> dt-binding error: >> >>>>>>> >> >>>>>>> $ make dtbs_check >> >>>>>>> >> >>>>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >> >>>>>>> arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dtb: geniqup@4ac0000: >> >>>>>>> #address-cells:0:0: 2 was expected >> >>>>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >> >>>>>> >> >>>>>> Don't we want rather to unify the soc address range? >> >>>>> >> >>>>> Well, the assumption in the original dt-bindings was that every reg >> >>>>> variable is 4 * u32 wide (as most new qcom SoCs set #address- and >> >>>>> #size-cells to <2>). However, that is not the case for all of the >> >>>>> SoCs. >> >>>> >> >>>> Hm, which device of that SoC cannot be used with address/size cells 2? >> >>> >> >>> As noted in the git log already the geniqup on sm6115 / sm4250 cannot >> >>> be used with address/size cells 2 (See: >> >>> https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/sm6115.dtsi#L795) >> >> SM6115 (and pretty much every other arm64 msm platform newer than 8916) >> >> should be using addr/size-cells = 2 along with (dma-)ranges of 36 bit, as >> >> that's what their smmus use and otherwise some addresses may get cut off >> >> in translation, or so the story went with 845 N years ago.. We can either >> >> pursue this patch or I can submit the 2-cell-ification if you don't plan on >> >> adding more nodes shortly >> > >> > >> > Have you tested this combination on SM6115 like SoCs with various IPs? I have tried a few experiments in the past and not all IPs work well with 36-bit DMA ranges (atleast not on the boards I have). >> Can you list any specific examples? I've been using it for >> quite some time now and I see nothing wrong.. > > I remember seeing some issues with SDHC controller booting (uSD card use case) with sm6115, but I cannot find the appropriate dmesg right now. FWIW it works completely fine for me, in fact I'm booting from uSD most of the time. Konrad > >> > >> > So, I think it might lead to more breakage (unless we are sure of a well-tested fix). A simpler patch to fix the dt-bindings looks more useful IMO. >> I'm not saying no, you just have to convince Krzysztof :D > > :) > > Thanks, > Bhupesh
On 16/01/2023 16:43, Bhupesh Sharma wrote: > On Mon, 16 Jan 2023 at 13:23, Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: >> >> On 15/01/2023 22:33, Bhupesh Sharma wrote: >>> On Sun, 15 Jan 2023 at 20:57, Krzysztof Kozlowski >>> <krzysztof.kozlowski@linaro.org> wrote: >>>> >>>> On 13/01/2023 21:10, Bhupesh Sharma wrote: >>>>> Fix the following '#address-cells' & '#size-cells' related >>>>> dt-binding error: >>>>> >>>>> $ make dtbs_check >>>>> >>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >>>>> arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dtb: geniqup@4ac0000: >>>>> #address-cells:0:0: 2 was expected >>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >>>> >>>> Don't we want rather to unify the soc address range? >>> >>> Well, the assumption in the original dt-bindings was that every reg >>> variable is 4 * u32 wide (as most new qcom SoCs set #address- and >>> #size-cells to <2>). However, that is not the case for all of the >>> SoCs. >> >> Hm, which device of that SoC cannot be used with address/size cells 2? > > As noted in the git log already the geniqup on sm6115 / sm4250 cannot > be used with address/size cells 2 (See: > https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/sm6115.dtsi#L795) That's not relevant and not answering to my question. Address/size cells affect children, so not geniqup. address-cells 2 means you have everywhere 64 bit addresses, so which devices cannot work with such DTS? If you claim that geniqup and its children has some troubles - please point what troubles. The DTS and existing address/size cells have nothing to do with it. Best regards, Krzysztof
On Mon, Jan 16, 2023 at 08:10:40PM +0100, Krzysztof Kozlowski wrote: > On 16/01/2023 16:43, Bhupesh Sharma wrote: > > On Mon, 16 Jan 2023 at 13:23, Krzysztof Kozlowski > > <krzysztof.kozlowski@linaro.org> wrote: > >> > >> On 15/01/2023 22:33, Bhupesh Sharma wrote: > >>> On Sun, 15 Jan 2023 at 20:57, Krzysztof Kozlowski > >>> <krzysztof.kozlowski@linaro.org> wrote: > >>>> > >>>> On 13/01/2023 21:10, Bhupesh Sharma wrote: > >>>>> Fix the following '#address-cells' & '#size-cells' related > >>>>> dt-binding error: > >>>>> > >>>>> $ make dtbs_check > >>>>> > >>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml > >>>>> arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dtb: geniqup@4ac0000: > >>>>> #address-cells:0:0: 2 was expected > >>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml > >>>> > >>>> Don't we want rather to unify the soc address range? > >>> > >>> Well, the assumption in the original dt-bindings was that every reg > >>> variable is 4 * u32 wide (as most new qcom SoCs set #address- and > >>> #size-cells to <2>). However, that is not the case for all of the > >>> SoCs. > >> > >> Hm, which device of that SoC cannot be used with address/size cells 2? If 1 cell does the job, then it should be allowed. I'd go a step farther and say # of cells should only be as big as needed and that's the address size of the children. > > > > As noted in the git log already the geniqup on sm6115 / sm4250 cannot > > be used with address/size cells 2 (See: > > https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/sm6115.dtsi#L795) Why can't they use 2? Is it because you forgot 'dma-ranges' and you want to implicitly limit DMA to 32-bits? Unfortunately 'dma-ranges' is frequently omitted so we treat missing as 1:1 dma-ranges (i.e. empty). > > That's not relevant and not answering to my question. Address/size cells > affect children, so not geniqup. address-cells 2 means you have > everywhere 64 bit addresses, so which devices cannot work with such DTS? > If you claim that geniqup and its children has some troubles - please > point what troubles. The DTS and existing address/size cells have > nothing to do with it. > > Best regards, > Krzysztof >
On Mon, Jan 16, 2023 at 09:13:12PM +0530, Bhupesh Sharma wrote: > On Mon, 16 Jan 2023 at 13:23, Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: > > > > On 15/01/2023 22:33, Bhupesh Sharma wrote: > > > On Sun, 15 Jan 2023 at 20:57, Krzysztof Kozlowski > > > <krzysztof.kozlowski@linaro.org> wrote: > > >> > > >> On 13/01/2023 21:10, Bhupesh Sharma wrote: > > >>> Fix the following '#address-cells' & '#size-cells' related > > >>> dt-binding error: > > >>> > > >>> $ make dtbs_check > > >>> > > >>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml > > >>> arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dtb: geniqup@4ac0000: > > >>> #address-cells:0:0: 2 was expected > > >>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml > > >> > > >> Don't we want rather to unify the soc address range? > > > > > > Well, the assumption in the original dt-bindings was that every reg > > > variable is 4 * u32 wide (as most new qcom SoCs set #address- and > > > #size-cells to <2>). However, that is not the case for all of the > > > SoCs. > > > > Hm, which device of that SoC cannot be used with address/size cells 2? > > As noted in the git log already the geniqup on sm6115 / sm4250 cannot > be used with address/size cells 2 (See: > https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/sm6115.dtsi#L795) > I'm not able to find the reasoning you're referring to. We do have cells of 2 for these nodes on all other platforms. If there is a specific problem, that can be documented and you can probably use ranges to reduce keep the cells of 1 in the geni wrappers. The reason why we have cells = 2 on most platforms is because the SMMU reports that it's capable of more address bits than the buses will handle. So without cells = 2, we can't describe dma-ranges appropriately and you get page faults due to truncated addresses on the bus when the iommu iova has been picking addresses for you. Regards, Bjorn > > > So, ideally we shouldn't set the "#address-cells" and "#size-cells": > > > as const: 2 in the bindings. > > > > > > See as an example: > > > https://www.kernel.org/doc/Documentation/devicetree/bindings/usb/usb-device.yaml > > > > > > How USB device - so entirely different device, not MMIO! - is related here? > > > > Best regards, > > Krzysztof > >
Hi Bjorn, On 1/19/23 8:53 AM, Bjorn Andersson wrote: > On Mon, Jan 16, 2023 at 09:13:12PM +0530, Bhupesh Sharma wrote: >> On Mon, 16 Jan 2023 at 13:23, Krzysztof Kozlowski >> <krzysztof.kozlowski@linaro.org> wrote: >>> >>> On 15/01/2023 22:33, Bhupesh Sharma wrote: >>>> On Sun, 15 Jan 2023 at 20:57, Krzysztof Kozlowski >>>> <krzysztof.kozlowski@linaro.org> wrote: >>>>> >>>>> On 13/01/2023 21:10, Bhupesh Sharma wrote: >>>>>> Fix the following '#address-cells' & '#size-cells' related >>>>>> dt-binding error: >>>>>> >>>>>> $ make dtbs_check >>>>>> >>>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >>>>>> arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dtb: geniqup@4ac0000: >>>>>> #address-cells:0:0: 2 was expected >>>>>> From schema: Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >>>>> >>>>> Don't we want rather to unify the soc address range? >>>> >>>> Well, the assumption in the original dt-bindings was that every reg >>>> variable is 4 * u32 wide (as most new qcom SoCs set #address- and >>>> #size-cells to <2>). However, that is not the case for all of the >>>> SoCs. >>> >>> Hm, which device of that SoC cannot be used with address/size cells 2? >> >> As noted in the git log already the geniqup on sm6115 / sm4250 cannot >> be used with address/size cells 2 (See: >> https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/sm6115.dtsi#L795) >> > > I'm not able to find the reasoning you're referring to. We do have cells > of 2 for these nodes on all other platforms. If there is a specific > problem, that can be documented and you can probably use ranges to > reduce keep the cells of 1 in the geni wrappers. > > > The reason why we have cells = 2 on most platforms is because the SMMU > reports that it's capable of more address bits than the buses will > handle. So without cells = 2, we can't describe dma-ranges appropriately > and you get page faults due to truncated addresses on the bus when the > iommu iova has been picking addresses for you. Consolidating the replies to your, Krzysztof's and Rob's observations / suggestions here.. Yes, the original background to the problem was that I observed that for the sm6115 based Qualcomm board with me, if I was using 36-bit DMA configuration with a few IP blocks (like SDHC), I was seeing some issues. But, Konrad observed in [1] that it works fine for me on the sm6115 based Lenovo tab, so I agree to his suggestions and may be he can help send the '2-cell-ification' patch he has working, in which case I think we can drop this patch. @Konrad, please feel free to share the patch you were mentioning and I can help test it as well. [1]. https://lore.kernel.org/linux-arm-msm/09fe3e93-328b-13a3-540b-4ca47224b176@linaro.org/ Thanks, Bhupesh
diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml index ab4df02052853..7ffce3b676641 100644 --- a/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml @@ -36,10 +36,10 @@ properties: maxItems: 2 "#address-cells": - const: 2 + enum: [ 1, 2 ] "#size-cells": - const: 2 + enum: [ 1, 2 ] ranges: true