Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4274798ybf; Wed, 4 Mar 2020 00:29:05 -0800 (PST) X-Google-Smtp-Source: ADFU+vtqqMyyKnnneEDbTEn0mknL8y5GQUir3JxkM1FX15KsN/k2gG6KMGQrJowV/XmrGf4miggY X-Received: by 2002:aca:530c:: with SMTP id h12mr1044096oib.86.1583310544940; Wed, 04 Mar 2020 00:29:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583310544; cv=none; d=google.com; s=arc-20160816; b=BP8dUdy+WAN9Tg1KBiRUcm2WSSaOVzDfC1SFMVy+kp1YOy1IhYcbYKbrlFGTPoFa0Q V3m1LVasDYDz4mZ74glXoKWY4zv2qeFmGZ49V7A/EVCt/PqBlUgrDVU0sm06vt5w4vi1 WE8ZUJ6ygCWFr4LESinxtg7m1EGgdJLKEhc2i8g5kAKKXrfwndvyUA1cOnVZH0Tx1ItI 5fBQ4Ltc50lc2xutcOBYhZShoe4mw7n2eP8bwLM7x79Dba27IbRE7PqHrdCtZarjj721 VMty23c3sGCxdAFoqx2KXTH4WfrdJ+KfAGSPTOl0Z5mNyCpdm5hqWyhkxWgJu0ZnPQny 6OxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=oH7grBEwPdlI3HY7/tKeeO0ogpT5E6PPUFVW6ggJMBU=; b=Y+SlfV1jaRhqxVNPdLrkceUjFf1FrZweuV0AHCrU8ipgTi4Se7lrTfxNm0//51pkqU /vTFsjUGLm1crSW9z+agqg8d0cIveH5TjPaHSAvka/uN2v6+TCqUR+qsWv5r6ALCtMYR ADDoWa3HtKYQsXCXADs9dNs7abL1MmBc6fDUIbRj/ojtpxUxL0r17LibWLEkGLtmiXfD YhH5sQ/NN+zYcXR7guwEKWA6zWisAIXdyhD7swYOYezUM3oHqFBa/nXsdEh29QzdhBcj 1rPE1gbacw8pbxd6uaMRvvxr/PlKv9KAFyB+uDOhtdfPCdMJy5IqXR/LTXnuK9OsxmKN Dp+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="yz9OKL/+"; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 88si871912otv.12.2020.03.04.00.28.52; Wed, 04 Mar 2020 00:29:04 -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=@ti.com header.s=ti-com-17Q1 header.b="yz9OKL/+"; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728387AbgCDI2s (ORCPT + 99 others); Wed, 4 Mar 2020 03:28:48 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:50464 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725271AbgCDI2s (ORCPT ); Wed, 4 Mar 2020 03:28:48 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0248SW0c007548; Wed, 4 Mar 2020 02:28:32 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1583310512; bh=oH7grBEwPdlI3HY7/tKeeO0ogpT5E6PPUFVW6ggJMBU=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=yz9OKL/+iTlwBnpWqcF2OL9DVUlzbIDrGIkJ82X52343j9Q/7M2FrSTMvlaqkQ/aV YnQST8WdlRWVK19gC/qVaINENxyxX5SG9UeU1I3Ao7YSL3Qw5pCzyUHrfLMfBW0UGD kO10y7SLV21NuHRmUCMMy2iLGfGA2NLzU+9NXhU4= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0248SWWi063029 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 4 Mar 2020 02:28:32 -0600 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Wed, 4 Mar 2020 02:28:31 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Wed, 4 Mar 2020 02:28:31 -0600 Received: from [192.168.2.14] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0248SSpV099893; Wed, 4 Mar 2020 02:28:29 -0600 Subject: Re: dma_mask limited to 32-bits with OF platform device To: Rob Herring , Robin Murphy CC: 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 , , "linux-kernel@vger.kernel.org" , Nishanth Menon , "hdegoede@redhat.com" , Vignesh Raghavendra 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> From: Roger Quadros Message-ID: Date: Wed, 4 Mar 2020 10:28:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 03/03/2020 21:26, Rob Herring wrote: > 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)? >> of_dma_get_range() was failing but no 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 Good catch. So I fixed it to dma-ranges = <0x0 0x0 0x0 0x1 0x00000000>; And now it works :). Thanks! > > 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. Great! > >>>> + 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 */ >>>> >>> -- cheers, -roger Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki