From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752983AbdC0Op3 (ORCPT ); Mon, 27 Mar 2017 10:45:29 -0400 Received: from foss.arm.com ([217.140.101.70]:36110 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752432AbdC0OpY (ORCPT ); Mon, 27 Mar 2017 10:45:24 -0400 Subject: Re: [RFC PATCH 3/3] of: fix node traversing in of_dma_get_range To: Rob Herring , Oza Pawandeep References: <1490419893-5073-1-git-send-email-oza.oza@broadcom.com> <1490419893-5073-3-git-send-email-oza.oza@broadcom.com> Cc: Joerg Roedel , Linux IOMMU , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "bcm-kernel-feedback-list@broadcom.com" From: Robin Murphy Message-ID: <3aec823d-d3c7-03d3-68f7-963d3649c184@arm.com> Date: Mon, 27 Mar 2017 15:45:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, On 27/03/17 15:34, Rob Herring wrote: > On Sat, Mar 25, 2017 at 12:31 AM, Oza Pawandeep wrote: >> it jumps to the parent node without examining the child node. >> also with that, it throws "no dma-ranges found for node" >> for pci dma-ranges. >> >> this patch fixes device node traversing for dma-ranges. > > What's the DT look like that doesn't work? The problem is the bodge in pci_dma_configure() where we don't have an OF node for the actual device itself, so pass in the host bridge's OF node instead. This happens to work well enough for dma-coherent, but I don't think dma-ranges was even considered at the time. As it happens I'm currently halfway through writing an experiment wherein pci_dma_configure() creates a temporary child node for the of_dma_configure() call if no other suitable alternative (e.g. some intermediate bridge node) exists. How hard are you likely to NAK that approach? ;) > dma-ranges is supposed to be a bus property, not a device's property. > So looking at the parent is correct behavior generally. Indeed, this patch as-is will break currently correct DTs (because we won't find dma-ranges on the device, so will bail before even looking at the parent as we should). Robin. > > Rob >