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 X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52740C433E7 for ; Wed, 14 Oct 2020 13:43:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F413E22201 for ; Wed, 14 Oct 2020 13:43:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731287AbgJNNnO (ORCPT ); Wed, 14 Oct 2020 09:43:14 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:15288 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731190AbgJNNnN (ORCPT ); Wed, 14 Oct 2020 09:43:13 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B2632521067FF2E8F636; Wed, 14 Oct 2020 21:43:11 +0800 (CST) Received: from [127.0.0.1] (10.174.177.134) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Wed, 14 Oct 2020 21:43:08 +0800 Subject: Re: [PATCH 1/2] arm64: dts: broadcom: remove an unused property dma-ranges From: "Leizhen (ThunderTown)" To: Arnd Bergmann , Florian Fainelli CC: Rob Herring , Ray Jui , "Scott Branden" , bcm-kernel-feedback-list , Andy Gross , Bjorn Andersson , linux-arm-msm , devicetree , linux-arm-kernel , linux-kernel References: <20201013060623.1711-1-thunder.leizhen@huawei.com> <20201013060623.1711-2-thunder.leizhen@huawei.com> Message-ID: Date: Wed, 14 Oct 2020 21:43:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.134] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On 2020/10/14 21:36, Leizhen (ThunderTown) wrote: > > > On 2020/10/14 15:38, Arnd Bergmann wrote: >> On Wed, Oct 14, 2020 at 5:15 AM Florian Fainelli wrote: >>> On 10/12/2020 11:06 PM, Zhen Lei wrote: >>>> stingray-usb.dtsi is finally included by three dts files: >>>> bcm958802a802x.dts, bcm958742k.dts and bcm958742t.dts. I searched all >>>> these three entire expanded dts files, and each of them contains only one >>>> dma-ranges. No conversion range is specified, so it cannot work properly. >>>> I think this property "dma-ranges" is added by mistake, just remove it. >>>> Otherwise, the following error will be reported when any YAML detection >>>> is performed on arm64. >>>> >>>> arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi:7.3-14: Warning \ >>>> (dma_ranges_format): /usb:dma-ranges: empty "dma-ranges" property but \ >>>> its #address-cells (1) differs from / (2) >>>> arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi:7.3-14: Warning \ >>>> (dma_ranges_format): /usb:dma-ranges: empty "dma-ranges" property but \ >>>> its #size-cells (1) differs from / (2) >>>> >>>> Signed-off-by: Zhen Lei >>> >>> This looks fine to me, Scott, Ray do you want to Ack this patch before I >>> take it? >> >> Does it mean that there are no devices on this bus that can do DMA? >> >> Usually there should be a dma-ranges property to identify that DMA >> is possible and what the limits are, though we have failed to enforce >> that. > > Documentation/devicetree/bindings/iommu/iommu.txt +79 > When an "iommus" property is specified in a device tree node, the IOMMU will > be used for address translation. If a "dma-ranges" property exists in the > device's parent node it will be ignored. An exception to this rule is if the > referenced IOMMU is disabled, in which case the "dma-ranges" property of the > parent shall take effect. > > The dma-ranges is only required by IOMMU disabled case. And should exist in > the parent node of IOMMU device. But this deleted dma-ranges is under the usb > bus node. > >> >> Also note that the #address-cells=<1> means that any device under >> this bus is assumed to only support 32-bit addressing, and DMA will >> have to go through a slow swiotlb in the absence of an IOMMU. > > The dma_alloc_coherent() will allocate memory with GFP_DMA32 flag and > try the 0-4G first. The reserved swiotlb buffer memory is used only > when the allocation failed. ----- Sorry, my mistake, please ignore the following. > > memory@80000000: > device_type: ["memory"] > reg: [[0x0, 0x80000000, 0x0, 0x80000000], [0x8, 0x80000000, 0x1, 0x80000000]] > > If this is the actual physical memory size, the #address-cells should be set to <1>. > >> >> Arnd >> >> . >> 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 X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC2EEC433DF for ; Wed, 14 Oct 2020 13:44:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5AB722076D for ; Wed, 14 Oct 2020 13:44:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Vi4ojhGu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5AB722076D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:References: To:From:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uWqcpnxkPLWf7aSypBrmRkzttRlnqwjsqPCailqF1/4=; b=Vi4ojhGuQp8y5JWyIlyLNboUR 9dZdruzk5M+pR86NVvXmPE2NbIHwSfwI+zZkWeMqMfBZkkcUG1MRbueluGCv92+ItP9U4L2ONjCnR kKg7rSV14c4/io7Prtn1FqPD+cAQWP21IA4w/8k5Od64f3udw2XyaSvdKMzy9Asc5UUfJqrYCw70p M8QxELyMxzHefFKHNDkPGxEK+rIlJjeLMNKz4P4P+kBfjwqA3aHlOD3vStpTZIxZs4KfS6sLXD1Zc u9p/W5AuI+sQf1Kc5X15/G2Zy4b/MrW9V9GYKIXWpS1KD61nvcM0jJ+uOatxKbXe8lvBqGfhHxOKY 5XoMTOjuQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSh3p-0007PP-QV; Wed, 14 Oct 2020 13:43:21 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190] helo=huawei.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSh3m-0007NJ-SB for linux-arm-kernel@lists.infradead.org; Wed, 14 Oct 2020 13:43:20 +0000 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B2632521067FF2E8F636; Wed, 14 Oct 2020 21:43:11 +0800 (CST) Received: from [127.0.0.1] (10.174.177.134) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Wed, 14 Oct 2020 21:43:08 +0800 Subject: Re: [PATCH 1/2] arm64: dts: broadcom: remove an unused property dma-ranges From: "Leizhen (ThunderTown)" To: Arnd Bergmann , Florian Fainelli References: <20201013060623.1711-1-thunder.leizhen@huawei.com> <20201013060623.1711-2-thunder.leizhen@huawei.com> Message-ID: Date: Wed, 14 Oct 2020 21:43:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [10.174.177.134] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201014_094319_634024_176C24FF X-CRM114-Status: GOOD ( 24.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree , linux-kernel , Scott Branden , Ray Jui , Andy Gross , Bjorn Andersson , Rob Herring , bcm-kernel-feedback-list , linux-arm-msm , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020/10/14 21:36, Leizhen (ThunderTown) wrote: > > > On 2020/10/14 15:38, Arnd Bergmann wrote: >> On Wed, Oct 14, 2020 at 5:15 AM Florian Fainelli wrote: >>> On 10/12/2020 11:06 PM, Zhen Lei wrote: >>>> stingray-usb.dtsi is finally included by three dts files: >>>> bcm958802a802x.dts, bcm958742k.dts and bcm958742t.dts. I searched all >>>> these three entire expanded dts files, and each of them contains only one >>>> dma-ranges. No conversion range is specified, so it cannot work properly. >>>> I think this property "dma-ranges" is added by mistake, just remove it. >>>> Otherwise, the following error will be reported when any YAML detection >>>> is performed on arm64. >>>> >>>> arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi:7.3-14: Warning \ >>>> (dma_ranges_format): /usb:dma-ranges: empty "dma-ranges" property but \ >>>> its #address-cells (1) differs from / (2) >>>> arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi:7.3-14: Warning \ >>>> (dma_ranges_format): /usb:dma-ranges: empty "dma-ranges" property but \ >>>> its #size-cells (1) differs from / (2) >>>> >>>> Signed-off-by: Zhen Lei >>> >>> This looks fine to me, Scott, Ray do you want to Ack this patch before I >>> take it? >> >> Does it mean that there are no devices on this bus that can do DMA? >> >> Usually there should be a dma-ranges property to identify that DMA >> is possible and what the limits are, though we have failed to enforce >> that. > > Documentation/devicetree/bindings/iommu/iommu.txt +79 > When an "iommus" property is specified in a device tree node, the IOMMU will > be used for address translation. If a "dma-ranges" property exists in the > device's parent node it will be ignored. An exception to this rule is if the > referenced IOMMU is disabled, in which case the "dma-ranges" property of the > parent shall take effect. > > The dma-ranges is only required by IOMMU disabled case. And should exist in > the parent node of IOMMU device. But this deleted dma-ranges is under the usb > bus node. > >> >> Also note that the #address-cells=<1> means that any device under >> this bus is assumed to only support 32-bit addressing, and DMA will >> have to go through a slow swiotlb in the absence of an IOMMU. > > The dma_alloc_coherent() will allocate memory with GFP_DMA32 flag and > try the 0-4G first. The reserved swiotlb buffer memory is used only > when the allocation failed. ----- Sorry, my mistake, please ignore the following. > > memory@80000000: > device_type: ["memory"] > reg: [[0x0, 0x80000000, 0x0, 0x80000000], [0x8, 0x80000000, 0x1, 0x80000000]] > > If this is the actual physical memory size, the #address-cells should be set to <1>. > >> >> Arnd >> >> . >> _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel