Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-09 Thread Russell King - ARM Linux
On Wed, May 08, 2013 at 01:42:11AM +0200, Arnd Bergmann wrote: On Wednesday 08 May 2013, Greg Kroah-Hartman wrote: On Tue, May 07, 2013 at 04:53:52PM -0600, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com Suggested-by: Arnd Bergmann a...@arndb.de Signed-off-by: Stephen

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-09 Thread Russell King - ARM Linux
On Wed, May 08, 2013 at 10:54:48AM +0800, Peter Chen wrote: This probably could be initialized from some DT property. However, there's no such property defined right now, and considering that DT is supposed to be an ABI, we'd always need the code in this patch as a fallback for DTs that

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-09 Thread Russell King - ARM Linux
On Wed, May 08, 2013 at 09:24:44AM +0200, Arnd Bergmann wrote: It probably should. The main thing is that the dma_mask setting in of_platform (and elsewhere) is a mess and that nobody so far had the guts to try to get it right for good. Setting a 32 bit DMA mask is /probably/ the right

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-08 Thread Arnd Bergmann
On Wednesday 08 May 2013, Peter Chen wrote: This probably could be initialized from some DT property. However, there's no such property defined right now, and considering that DT is supposed to be an ABI, we'd always need the code in this patch as a fallback for DTs that were created

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-08 Thread Matthijs Kooijman
Hi, For the ramips target, the MIPS folks suggested another approach: The soc code finds the platform_device generated by DT and adds the dma_mask: http://www.linux-mips.org/archives/linux-mips/2013-04/msg00162.html For completeness: It seems this approach is not going to be used after

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-08 Thread Matthijs Kooijman
Hi folks, I also bumped into the question of how to set the dma_mask when enabling the dwc2 driver on the ramips target and found there didn't seem to be any clear way to get a dma_mask. It seems to me that in the pre-DT era, a platform_device would get a dma_mask when it was defined in the

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-08 Thread Rob Herring
On 05/08/2013 02:11 AM, Matthijs Kooijman wrote: Hi folks, I also bumped into the question of how to set the dma_mask when enabling the dwc2 driver on the ramips target and found there didn't seem to be any clear way to get a dma_mask. It seems to me that in the pre-DT era, a

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-08 Thread Arnd Bergmann
On Wednesday 08 May 2013, Rob Herring wrote: On 05/08/2013 02:11 AM, Matthijs Kooijman wrote: https://lkml.org/lkml/2012/12/4/54 And here's the previous attempt, to which Rob Herring refers in a reply. https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-March/013180.html I

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-08 Thread Alan Stern
On Wed, 8 May 2013, Arnd Bergmann wrote: On Wednesday 08 May 2013, Greg Kroah-Hartman wrote: On Tue, May 07, 2013 at 04:53:52PM -0600, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com Suggested-by: Arnd Bergmann a...@arndb.de Signed-off-by: Stephen Warren

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-08 Thread Arnd Bergmann
On Wednesday 08 May 2013, Alan Stern wrote: The first occurence was apparently in 3.3, but only in ehci-tegra.c, while the other drivers subsequently copied the bug. An alternative solution -- perhaps not better but also not relying on coherent_dma_mask -- is to clear pdev-dev.dma_mask in

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-08 Thread Stephen Warren
On 05/07/2013 08:54 PM, Peter Chen wrote: This probably could be initialized from some DT property. However, there's no such property defined right now, and considering that DT is supposed to be an ABI, we'd always need the code in this patch as a fallback for DTs that were created before any

[PATCH] USB: set device dma_mask without reference to global data

2013-05-07 Thread Stephen Warren
From: Stephen Warren swar...@nvidia.com Many USB host drivers contain code such as: if (!pdev-dev.dma_mask) pdev-dev.dma_mask = tegra_ehci_dma_mask; ... where tegra_ehci_dma_mask is a global. I suspect this code originated in commit 4a53f4e USB: ehci-tegra: add probing through device

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-07 Thread Greg Kroah-Hartman
On Tue, May 07, 2013 at 04:53:52PM -0600, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com Many USB host drivers contain code such as: if (!pdev-dev.dma_mask) pdev-dev.dma_mask = tegra_ehci_dma_mask; ... where tegra_ehci_dma_mask is a global. I suspect this code

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-07 Thread Arnd Bergmann
On Wednesday 08 May 2013, Greg Kroah-Hartman wrote: On Tue, May 07, 2013 at 04:53:52PM -0600, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com Suggested-by: Arnd Bergmann a...@arndb.de Signed-off-by: Stephen Warren swar...@nvidia.com So this needs to go in for 3.10, right?

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-07 Thread Peter Chen
On Wed, May 8, 2013 at 6:53 AM, Stephen Warren swar...@wwwdotorg.org wrote: From: Stephen Warren swar...@nvidia.com Many USB host drivers contain code such as: if (!pdev-dev.dma_mask) pdev-dev.dma_mask = tegra_ehci_dma_mask; ... where tegra_ehci_dma_mask is a global. I suspect this

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-07 Thread Stephen Warren
On 05/07/2013 07:13 PM, Peter Chen wrote: On Wed, May 8, 2013 at 6:53 AM, Stephen Warren swar...@wwwdotorg.org wrote: From: Stephen Warren swar...@nvidia.com Many USB host drivers contain code such as: if (!pdev-dev.dma_mask) pdev-dev.dma_mask = tegra_ehci_dma_mask; ... where

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-07 Thread Peter Chen
This probably could be initialized from some DT property. However, there's no such property defined right now, and considering that DT is supposed to be an ABI, we'd always need the code in this patch as a fallback for DTs that were created before any such property was defined. Equally,

Re: [PATCH] USB: set device dma_mask without reference to global data

2013-05-07 Thread Tony Prisk
On 08/05/13 10:53, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com Many USB host drivers contain code such as: if (!pdev-dev.dma_mask) pdev-dev.dma_mask = tegra_ehci_dma_mask; ... where tegra_ehci_dma_mask is a global. I suspect this code originated in commit 4a53f4e