powerpc: Add proper reference to dma_mask
There is dma_mask in of_device that is being filled upon of_platform_device_create() but we don't properly set the struct device in there to point back to it. coherent_dma_mask wasn't set up either - these caused weird lock-ups and behavior of USB subsystem using of_device USB host drivers.
---
arch/powerpc/kernel/of_platform.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
arch/powerpc/kernel/of_platform.c +3 -0
@@ -76,6 +76,9 @@ struct of_device* of_platform_device_create(struct device_node *np,return NULL ; dev->dma_mask =0xffffffffUL ; + dev->dev.dma_mask = &dev->dma_mask; + dev->dev.coherent_dma_mask =DMA_32BIT_MASK ; + dev->dev.bus = &of_platform_bus_type;/* We do not fill the DMA ops for platform devices by default.
Hi Vitaly,
arch/powerpc/kernel/of_platform.c struct of_device* of_platform_device_create(struct device_node *np, · line 79
Quoted 7 lines · On Tue, 8 Jul 2008 03:12:56 +0400 Vitaly Bordug <[email protected]>…
+++
b/arch/powerpc/kernel/of_platform.carch/powerpc/kernel/of_platform.c +1
-0@@ -76,6 +76,9 @@ struct of_device* of_platform_device_create(struct device_node *np,return NULL ; dev->dma_mask =0xffffffffUL ; + dev->dev.dma_mask = &dev->dma_mask;
That is done in of_device_alloc which is called just above.
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Quoted 4 lines · Stephen Rothwell
Hi Vitaly,
Quoted 1 line · On Tue, 8 Jul 2008 03:12:56 +0400 Vitaly Bordug <[email protected]>…
Quoted 8 lines
arch/powerpc/kernel/of_platform.c struct of_device* of_platform_device_create(struct device_node *np, · line 79
Quoted 6 lines
+++
b/arch/powerpc/kernel/of_platform.carch/powerpc/kernel/of_platform.c +1
-0@@ -76,6 +76,9 @@ struct of_device* of_platform_device_create(struct device_node *np,return NULL ; dev->dma_mask =0xffffffffUL ; + dev->dev.dma_mask = &dev->dma_mask;That is done in
of_device_allocwhich is called just above.
So the problem might just be that coherent_dma_mask isn't set.
Ben.
=D0=92 Tue, 08 Jul 2008 14:28:11 +1000
Benjamin Herrenschmidt <[email protected]> =D0=BF=D0=B8=D1=88=D0=B5= =D1=82:
Quoted 14 lines · Stephen Rothwell
Quoted 5 lines
Hi Vitaly,
=20Quoted 1 line · On Tue, 8 Jul 2008 03:12:56 +0400 Vitaly Bordug <[email protected]>…
Quoted 8 lines
Review
Quoted 6 lines
+++
b/arch/powerpc/kernel/of_platform.c(quoted diff) +0
-0@@ -76,6 +76,9 @@ struct of_device* of_platform_device_create(struct device_node *np, return NULL;=20
(quoted diff) +1
-0dev->dma_mask =3D 0xffffffffUL; + dev->dev.dma_mask =3D &dev->dma_mask;=20
That is done inof_device_allocwhich is called just above.
Quoted 3 lines
=20
So the problem might just be thatcoherent_dma_maskisn't set. =20
I'll check and resubmit, thanks
-Vitaly