From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932872AbcIFGfm (ORCPT ); Tue, 6 Sep 2016 02:35:42 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:36607 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752190AbcIFGfj (ORCPT ); Tue, 6 Sep 2016 02:35:39 -0400 Date: Tue, 6 Sep 2016 14:35:29 +0800 From: Peter Chen To: Arnd Bergmann Cc: Leo Li , Felipe Balbi , Grygorii Strashko , Russell King - ARM Linux , Catalin Marinas , Yoshihiro Shimoda , "linux-usb@vger.kernel.org" , Sekhar Nori , lkml , Stuart Yoder , Scott Wood , David Fisher , "Thang Q. Nguyen" , Alan Stern , Greg Kroah-Hartman , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] usb: dwc3: host: inherit dma configuration from parent dev Message-ID: <20160906063529.GA22312@b29397-desktop> References: <6414695.LEIYfGPUEg@wuerfel> <4865343.bOXkeC8XtQ@wuerfel> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4865343.bOXkeC8XtQ@wuerfel> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 05, 2016 at 05:39:27PM +0200, Arnd Bergmann wrote: > On Friday, September 2, 2016 5:16:31 PM CEST Leo Li wrote: > > > > Can we use the firmware or bootloader information to provide the > > default dma-mapping attributes for devices that doesn't have an > > of_node pointer or ACPI data? This will at least restore what we had > > previously provided . I'm concerned that changing all the drivers > > that are creating child device will be a big effort. Like I mentioned > > in another thread, there are many instances of platform_device_add() > > under the drivers/ directory. > > Fortunately, there are not too many drivers that call platform_device_add > *and* try to set up a dma mask for the child device: > > git grep -wl dma_mask drivers | xargs grep -wl 'platform_device_\(add\|register\)' > > drivers/base/platform.c > drivers/bcma/main.c > drivers/eisa/virtual_root.c > drivers/mfd/mfd-core.c > drivers/mfd/omap-usb-host.c > drivers/misc/mic/card/mic_x100.c > drivers/platform/goldfish/pdev_bus.c > drivers/ssb/main.c > drivers/usb/chipidea/core.c > drivers/usb/dwc3/dwc3-exynos.c > drivers/usb/dwc3/host.c > drivers/usb/gadget/udc/bdc/bdc_pci.c > drivers/usb/host/bcma-hcd.c > drivers/usb/host/fsl-mph-dr-of.c > drivers/usb/host/ssb-hcd.c > drivers/usb/misc/ftdi-elan.c > drivers/usb/musb/blackfin.c > drivers/usb/musb/musb_dsps.c > drivers/usb/musb/omap2430.c > drivers/usb/musb/ux500.c > > Most of these are probably never used with any nonstandard > DMA settings (IOMMU, cache coherency, offset, ...). > > One thing we could possibly do is to go through these and > replace the hardcoded dma mask setup with of_dma_configure() > in all cases in which we actually use DT for probing, which > should cover the interesting cases. > One case I am going to work is to let USB chipidea driver support iommu, the chipidea core device is no of_node, and created by platform_add_device on the runtime. Using of_dma_configure with parent of_node is a solution from my point, like [1]. https://lkml.org/lkml/2016/2/22/7 -- Best Regards, Peter Chen From mboxrd@z Thu Jan 1 00:00:00 1970 From: hzpeterchen@gmail.com (Peter Chen) Date: Tue, 6 Sep 2016 14:35:29 +0800 Subject: [PATCH] usb: dwc3: host: inherit dma configuration from parent dev In-Reply-To: <4865343.bOXkeC8XtQ@wuerfel> References: <6414695.LEIYfGPUEg@wuerfel> <4865343.bOXkeC8XtQ@wuerfel> Message-ID: <20160906063529.GA22312@b29397-desktop> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Mon, Sep 05, 2016 at 05:39:27PM +0200, Arnd Bergmann wrote: > On Friday, September 2, 2016 5:16:31 PM CEST Leo Li wrote: > > > > Can we use the firmware or bootloader information to provide the > > default dma-mapping attributes for devices that doesn't have an > > of_node pointer or ACPI data? This will at least restore what we had > > previously provided . I'm concerned that changing all the drivers > > that are creating child device will be a big effort. Like I mentioned > > in another thread, there are many instances of platform_device_add() > > under the drivers/ directory. > > Fortunately, there are not too many drivers that call platform_device_add > *and* try to set up a dma mask for the child device: > > git grep -wl dma_mask drivers | xargs grep -wl 'platform_device_\(add\|register\)' > > drivers/base/platform.c > drivers/bcma/main.c > drivers/eisa/virtual_root.c > drivers/mfd/mfd-core.c > drivers/mfd/omap-usb-host.c > drivers/misc/mic/card/mic_x100.c > drivers/platform/goldfish/pdev_bus.c > drivers/ssb/main.c > drivers/usb/chipidea/core.c > drivers/usb/dwc3/dwc3-exynos.c > drivers/usb/dwc3/host.c > drivers/usb/gadget/udc/bdc/bdc_pci.c > drivers/usb/host/bcma-hcd.c > drivers/usb/host/fsl-mph-dr-of.c > drivers/usb/host/ssb-hcd.c > drivers/usb/misc/ftdi-elan.c > drivers/usb/musb/blackfin.c > drivers/usb/musb/musb_dsps.c > drivers/usb/musb/omap2430.c > drivers/usb/musb/ux500.c > > Most of these are probably never used with any nonstandard > DMA settings (IOMMU, cache coherency, offset, ...). > > One thing we could possibly do is to go through these and > replace the hardcoded dma mask setup with of_dma_configure() > in all cases in which we actually use DT for probing, which > should cover the interesting cases. > One case I am going to work is to let USB chipidea driver support iommu, the chipidea core device is no of_node, and created by platform_add_device on the runtime. Using of_dma_configure with parent of_node is a solution from my point, like [1]. https://lkml.org/lkml/2016/2/22/7 -- Best Regards, Peter Chen