linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* powerpc: Add proper reference to dma_mask
@ 2008-07-07 23:12 Vitaly Bordug
  2008-07-08  3:54 ` Stephen Rothwell
  0 siblings, 1 reply; 4+ messages in thread
From: Vitaly Bordug @ 2008-07-07 23:12 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev@ozlabs.org

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.

Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
---

 arch/powerpc/kernel/of_platform.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index e79ad8a..2bf4c04 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -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.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: powerpc: Add proper reference to dma_mask
  2008-07-07 23:12 powerpc: Add proper reference to dma_mask Vitaly Bordug
@ 2008-07-08  3:54 ` Stephen Rothwell
  2008-07-08  4:28   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2008-07-08  3:54 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: linuxppc-dev@ozlabs.org

[-- Attachment #1: Type: text/plain, Size: 504 bytes --]

Hi Vitaly,

On Tue, 8 Jul 2008 03:12:56 +0400 Vitaly Bordug <vitb@kernel.crashing.org> wrote:
>
> +++ b/arch/powerpc/kernel/of_platform.c
> @@ -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.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: powerpc: Add proper reference to dma_mask
  2008-07-08  3:54 ` Stephen Rothwell
@ 2008-07-08  4:28   ` Benjamin Herrenschmidt
  2008-07-08 12:48     ` Vitaly Bordug
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2008-07-08  4:28 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev@ozlabs.org

On Tue, 2008-07-08 at 13:54 +1000, Stephen Rothwell wrote:
> Hi Vitaly,
> 
> On Tue, 8 Jul 2008 03:12:56 +0400 Vitaly Bordug <vitb@kernel.crashing.org> wrote:
> >
> > +++ b/arch/powerpc/kernel/of_platform.c
> > @@ -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.

So the problem might just be that coherent_dma_mask isn't set.

Ben.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: powerpc: Add proper reference to dma_mask
  2008-07-08  4:28   ` Benjamin Herrenschmidt
@ 2008-07-08 12:48     ` Vitaly Bordug
  0 siblings, 0 replies; 4+ messages in thread
From: Vitaly Bordug @ 2008-07-08 12:48 UTC (permalink / raw)
  To: benh; +Cc: Stephen Rothwell, linuxppc-dev@ozlabs.org

=D0=92 Tue, 08 Jul 2008 14:28:11 +1000
Benjamin Herrenschmidt <benh@kernel.crashing.org> =D0=BF=D0=B8=D1=88=D0=B5=
=D1=82:

> On Tue, 2008-07-08 at 13:54 +1000, Stephen Rothwell wrote:
> > Hi Vitaly,
> >=20
> > On Tue, 8 Jul 2008 03:12:56 +0400 Vitaly Bordug
> > <vitb@kernel.crashing.org> wrote:
> > >
> > > +++ b/arch/powerpc/kernel/of_platform.c
> > > @@ -76,6 +76,9 @@ struct of_device*
> > > of_platform_device_create(struct device_node *np, return NULL;
> > > =20
> > >  	dev->dma_mask =3D 0xffffffffUL;
> > > +	dev->dev.dma_mask =3D &dev->dma_mask;
> >=20
> > That is done in of_device_alloc which is called just above.
>=20
> So the problem might just be that coherent_dma_mask isn't set.
>=20

I'll check and resubmit, thanks

-Vitaly

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-07-08 12:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-07 23:12 powerpc: Add proper reference to dma_mask Vitaly Bordug
2008-07-08  3:54 ` Stephen Rothwell
2008-07-08  4:28   ` Benjamin Herrenschmidt
2008-07-08 12:48     ` Vitaly Bordug

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).