Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3829728ybf; Tue, 3 Mar 2020 13:43:07 -0800 (PST) X-Google-Smtp-Source: ADFU+vtJQJXmjNR1WB26T5KVg/g3tibV88dkIkUzlVvdy+m5vvenTKlUhFeKCB1IVznTj2tFj2KL X-Received: by 2002:a54:4f16:: with SMTP id e22mr450166oiy.170.1583271786608; Tue, 03 Mar 2020 13:43:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583271786; cv=none; d=google.com; s=arc-20160816; b=KperhaFZPQqG+oZnVC1/psHNZyTtv74mWHGhSFEnodSaPiN/w3JAOl2E39w96uRy/h aePQRJisDYeKCVrt2brlUQSUcV5Hr5+LhRkVb35yJq3X4GcYX6HVPGlcPiHQT6IFR++p Ej39BybTtJ51g0Xy0waUA51FVtfli8WK0VfJCpm1ysatXcg/QuyrlBJ4a7LetDNm0wBA tUdsV9otRV+KYlfMXuCyA8bV7JHnZQvW2NJN3CASgS9q/JPeHTsfitoikB+UcJ4qQQxL FWAzitDUdMMHmwV4qGWbhY6Ck+h1MVnt8ACwsaQ7erzDbOhugoAIwh/DOrQKlI6zNKEl GY1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5TVWvXm44PCJ/LB3tMsVKrf4VupoCykPDmm3Q0rFbrY=; b=jWWS8FJwtkXh6FuIz6TN2YvtuE/aWBSIbzAoCKaUydGuJDNZUce7w5Ci4MUF7MA/u2 a8TzWIzD5yFpSUprHHTqh86mjrFTo4gqr1AieiD0MFSEZYwN5sNfCvCJMWWkxZW4fptb Lpno49AJpR++2sIp3u7nt7fuNVps2Ua79Km9KpAKQtqgA76IDBm78zFkM1L2VrddzhbZ KXjltoAPr8JH6cvvPN7cilzfmEKkicI+UQHQtKB/pb/uvV3/RZuAQYkH/KD3t+g492fm X0neFWikDMexswcCnCZTChvyqxBIaZ5biQyhZwSgH9Jols1jWFWwoCEn9bMsQ5xDa9sg 1hpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="bT/gp7f0"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1si6421768otk.2.2020.03.03.13.42.54; Tue, 03 Mar 2020 13:43:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="bT/gp7f0"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730932AbgCCT1B (ORCPT + 99 others); Tue, 3 Mar 2020 14:27:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:53582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729803AbgCCT1A (ORCPT ); Tue, 3 Mar 2020 14:27:00 -0500 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 253F42072D; Tue, 3 Mar 2020 19:26:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583263619; bh=S23seZZ+F0rhstqMDwu37JiEu/Gt0WN7ghAUIOFxxME=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=bT/gp7f0P3cfOffymaU/w4anjKUzVAorinFP9Qjiewkk14jyntSzvsSynt5ctPFec 85fdsIUrh9KseU1S0jcUosx9UhH6Zqfopw7FWT5hPb0o5qeo89+39cFs3Q8kU3uQpD tb7Ntj+axxD+SkPVtHb0awJaPC3ATL4aZ+djYlnI= Received: by mail-qk1-f174.google.com with SMTP id f198so4558057qke.11; Tue, 03 Mar 2020 11:26:59 -0800 (PST) X-Gm-Message-State: ANhLgQ2PNBPQaGbwaCMb7qHikNM9wXINMvSonjdqUs50qnX6pSCfjXYX FFuT3QogF7JYvx9w54UjD0vYRdxKBAKGnSCJ5w== X-Received: by 2002:a05:620a:15a2:: with SMTP id f2mr5790107qkk.223.1583263618266; Tue, 03 Mar 2020 11:26:58 -0800 (PST) MIME-Version: 1.0 References: <3a91f306-f544-a63c-dfe2-7eae7b32bcca@arm.com> <56314192-f3c6-70c5-6b9a-3d580311c326@ti.com> <9bd83815-6f54-2efb-9398-42064f73ab1c@arm.com> <20200217132133.GA27134@lst.de> <15d0ac5f-4919-5852-cd95-93c24d8bdbb9@ti.com> <827fa19d-1990-16bc-33f5-fc82ac0d4a8a@arm.com> <3d8ea578-2ecb-1126-3bf0-2dc695687245@ti.com> <98db4748-63cb-79db-50c3-a6a37d624eaa@arm.com> In-Reply-To: <98db4748-63cb-79db-50c3-a6a37d624eaa@arm.com> From: Rob Herring Date: Tue, 3 Mar 2020 13:26:46 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: dma_mask limited to 32-bits with OF platform device To: Robin Murphy Cc: Roger Quadros , Christoph Hellwig , =?UTF-8?Q?P=C3=A9ter_Ujfalusi?= , Murali Karicheri , "Nori, Sekhar" , "Anna, Suman" , Stefan Wahren , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Hans Verkuil , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Nishanth Menon , "hdegoede@redhat.com" , Vignesh Raghavendra Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 3, 2020 at 8:06 AM Robin Murphy wrote: > > On 03/03/2020 8:27 am, Roger Quadros wrote: > [...] > >> With the patch (in the end). dev->bus_dma_limit is still set to 0 and > >> so is not being used. > >> > >> from of_dma_configure() > >> ret = of_dma_get_range(np, &dma_addr, &paddr, &size); > >> ... > >> /* ...but only set bus limit if we found valid dma-ranges > >> earlier */ > >> if (!ret) > >> dev->bus_dma_limit = end; > >> > >> There is no other place bus_dma_limit is set. Looks like every device > >> should inherit that > >> from it's parent right? > > > > Any ideas how to expect this to work? > > Is of_dma_get_range() actually succeeding, or is it tripping up on some > aspect of the DT (in which case there should be errors in the log)? > > Looking again at the fragment below, are you sure it's correct? It > appears to me like it might actually be defining a 1-byte-long DMA > range, which indeed I wouldn't really expect to work. Indeed, though it took me a minute to see why. > > Robin. > > >> > >> diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi > >> index 64a0f90f5b52..5418c31d4da7 100644 > >> --- a/arch/arm/boot/dts/dra7.dtsi > >> +++ b/arch/arm/boot/dts/dra7.dtsi > >> @@ -680,15 +680,22 @@ > >> }; > >> > >> /* OCP2SCP3 */ > >> - sata: sata@4a141100 { > >> - compatible = "snps,dwc-ahci"; > >> - reg = <0x4a140000 0x1100>, <0x4a141100 0x7>; Based on this, the parent address size is 1 cell... > >> - interrupts = ; > >> - phys = <&sata_phy>; > >> - phy-names = "sata-phy"; > >> - clocks = <&l3init_clkctrl DRA7_L3INIT_SATA_CLKCTRL 8>; > >> - ti,hwmods = "sata"; > >> - ports-implemented = <0x1>; > >> + sata_aux_bus { > >> + #address-cells = <2>; > >> + #size-cells = <2>; > >> + compatible = "simple-bus"; > >> + ranges = <0x0 0x0 0x4a140000 0x0 0x1200>; > >> + dma-ranges = <0x0 0x0 0x0 0x0 0x1 0x00000000>; So this is: child addr: 0x0 0x0 parent addr: 0x0 size: 0x0 0x1 The last cell is just ignored I guess if you aren't seeing any errors. We check this in dtc for ranges, but not dma-ranges. So I'm fixing that. > >> + sata: sata@4a141100 { > >> + compatible = "snps,dwc-ahci"; > >> + reg = <0x0 0x0 0x0 0x1100>, <0x0 0x1100 0x0 0x7>; > >> + interrupts = ; > >> + phys = <&sata_phy>; > >> + phy-names = "sata-phy"; > >> + clocks = <&l3init_clkctrl DRA7_L3INIT_SATA_CLKCTRL 8>; > >> + ti,hwmods = "sata"; > >> + ports-implemented = <0x1>; > >> + }; > >> }; > >> > >> /* OCP2SCP1 */ > >> > >