All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-06-27  5:41 ` N, Mugunthan V
  0 siblings, 0 replies; 30+ messages in thread
From: N, Mugunthan V @ 2012-06-27  5:41 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-arm-kernel

> -----Original Message-----
> From: N, Mugunthan V
> Sent: Thursday, June 07, 2012 9:52 PM
> To: 'linux-omap@vger.kernel.org'
> Cc: 'linux-arm-kernel@lists.infradead.org'
> Subject: how to specify dma_mask and coherent_dma_mask in hwmod
> 
> Hi
> 
> While converting platform device registry to Hwmod for CPSW Ethernet
> driver which is present in AM335X (OMAP2+), I am not finding a way to
> specify
> dma_mask and coherent_dma_mask.
> Is there a way to specify dma_mask and coherent_dma_mask in hwmod?

Ping, any one has comment on this?

> 
> ---
> Regards,
> Mugunthan V N.


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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-06-27  5:41 ` N, Mugunthan V
  0 siblings, 0 replies; 30+ messages in thread
From: N, Mugunthan V @ 2012-06-27  5:41 UTC (permalink / raw)
  To: linux-arm-kernel

> -----Original Message-----
> From: N, Mugunthan V
> Sent: Thursday, June 07, 2012 9:52 PM
> To: 'linux-omap at vger.kernel.org'
> Cc: 'linux-arm-kernel at lists.infradead.org'
> Subject: how to specify dma_mask and coherent_dma_mask in hwmod
> 
> Hi
> 
> While converting platform device registry to Hwmod for CPSW Ethernet
> driver which is present in AM335X (OMAP2+), I am not finding a way to
> specify
> dma_mask and coherent_dma_mask.
> Is there a way to specify dma_mask and coherent_dma_mask in hwmod?

Ping, any one has comment on this?

> 
> ---
> Regards,
> Mugunthan V N.

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

* RE: how to specify dma_mask and coherent_dma_mask in hwmod
  2012-06-27  5:41 ` N, Mugunthan V
@ 2012-06-28 15:27   ` Bedia, Vaibhav
  -1 siblings, 0 replies; 30+ messages in thread
From: Bedia, Vaibhav @ 2012-06-28 15:27 UTC (permalink / raw)
  To: N, Mugunthan V, linux-omap
  Cc: linux-arm-kernel, Paul Walmsley, Cousson, Benoit, Hilman, Kevin

+Paul, Benoit and Kevin

On Wed, Jun 27, 2012 at 11:11:32, N, Mugunthan V wrote:
> > -----Original Message-----
> > From: N, Mugunthan V
> > Sent: Thursday, June 07, 2012 9:52 PM
> > To: 'linux-omap@vger.kernel.org'
> > Cc: 'linux-arm-kernel@lists.infradead.org'
> > Subject: how to specify dma_mask and coherent_dma_mask in hwmod
> > 
> > Hi
> > 
> > While converting platform device registry to Hwmod for CPSW Ethernet
> > driver which is present in AM335X (OMAP2+), I am not finding a way to
> > specify
> > dma_mask and coherent_dma_mask.
> > Is there a way to specify dma_mask and coherent_dma_mask in hwmod?
> 
> Ping, any one has comment on this?

Right now there's no way of doing this in hwmod. But is omap_hwmod
the right place for this? It would help if you could describe why
the hwmod conversion is causing trouble for you.

Regards,
Vaibhav B.

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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-06-28 15:27   ` Bedia, Vaibhav
  0 siblings, 0 replies; 30+ messages in thread
From: Bedia, Vaibhav @ 2012-06-28 15:27 UTC (permalink / raw)
  To: linux-arm-kernel

+Paul, Benoit and Kevin

On Wed, Jun 27, 2012 at 11:11:32, N, Mugunthan V wrote:
> > -----Original Message-----
> > From: N, Mugunthan V
> > Sent: Thursday, June 07, 2012 9:52 PM
> > To: 'linux-omap at vger.kernel.org'
> > Cc: 'linux-arm-kernel at lists.infradead.org'
> > Subject: how to specify dma_mask and coherent_dma_mask in hwmod
> > 
> > Hi
> > 
> > While converting platform device registry to Hwmod for CPSW Ethernet
> > driver which is present in AM335X (OMAP2+), I am not finding a way to
> > specify
> > dma_mask and coherent_dma_mask.
> > Is there a way to specify dma_mask and coherent_dma_mask in hwmod?
> 
> Ping, any one has comment on this?

Right now there's no way of doing this in hwmod. But is omap_hwmod
the right place for this? It would help if you could describe why
the hwmod conversion is causing trouble for you.

Regards,
Vaibhav B.

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

* RE: how to specify dma_mask and coherent_dma_mask in hwmod
  2012-06-28 15:27   ` Bedia, Vaibhav
@ 2012-06-28 15:52     ` Paul Walmsley
  -1 siblings, 0 replies; 30+ messages in thread
From: Paul Walmsley @ 2012-06-28 15:52 UTC (permalink / raw)
  To: N, Mugunthan V
  Cc: Bedia, Vaibhav, linux-omap, linux-arm-kernel, Cousson, Benoit,
	Hilman, Kevin

Hi

On Thu, 28 Jun 2012, Bedia, Vaibhav wrote:

> On Wed, Jun 27, 2012 at 11:11:32, N, Mugunthan V wrote:
> > > -----Original Message-----
> > > From: N, Mugunthan V
> > > Sent: Thursday, June 07, 2012 9:52 PM
> > > To: 'linux-omap@vger.kernel.org'
> > > Cc: 'linux-arm-kernel@lists.infradead.org'
> > > Subject: how to specify dma_mask and coherent_dma_mask in hwmod
> > > 
> > > While converting platform device registry to Hwmod for CPSW Ethernet
> > > driver which is present in AM335X (OMAP2+), I am not finding a way to
> > > specify
> > > dma_mask and coherent_dma_mask.
> > > Is there a way to specify dma_mask and coherent_dma_mask in hwmod?
> > 
> > Ping, any one has comment on this?
> 
> Right now there's no way of doing this in hwmod. But is omap_hwmod
> the right place for this? It would help if you could describe why
> the hwmod conversion is causing trouble for you.

dma_mask and coherent_dma_mask can be specified during 
device creation.  See usb_musb_init() in arch/arm/mach-omap2/usb-musb.c 
for an example.

I take it that you're just planning to set both of those to 0xffffffff?


- Paul

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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-06-28 15:52     ` Paul Walmsley
  0 siblings, 0 replies; 30+ messages in thread
From: Paul Walmsley @ 2012-06-28 15:52 UTC (permalink / raw)
  To: linux-arm-kernel

Hi

On Thu, 28 Jun 2012, Bedia, Vaibhav wrote:

> On Wed, Jun 27, 2012 at 11:11:32, N, Mugunthan V wrote:
> > > -----Original Message-----
> > > From: N, Mugunthan V
> > > Sent: Thursday, June 07, 2012 9:52 PM
> > > To: 'linux-omap at vger.kernel.org'
> > > Cc: 'linux-arm-kernel at lists.infradead.org'
> > > Subject: how to specify dma_mask and coherent_dma_mask in hwmod
> > > 
> > > While converting platform device registry to Hwmod for CPSW Ethernet
> > > driver which is present in AM335X (OMAP2+), I am not finding a way to
> > > specify
> > > dma_mask and coherent_dma_mask.
> > > Is there a way to specify dma_mask and coherent_dma_mask in hwmod?
> > 
> > Ping, any one has comment on this?
> 
> Right now there's no way of doing this in hwmod. But is omap_hwmod
> the right place for this? It would help if you could describe why
> the hwmod conversion is causing trouble for you.

dma_mask and coherent_dma_mask can be specified during 
device creation.  See usb_musb_init() in arch/arm/mach-omap2/usb-musb.c 
for an example.

I take it that you're just planning to set both of those to 0xffffffff?


- Paul

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

* Re: how to specify dma_mask and coherent_dma_mask in hwmod
  2012-06-27  5:41 ` N, Mugunthan V
@ 2012-06-28 15:56   ` ABRAHAM, KISHON VIJAY
  -1 siblings, 0 replies; 30+ messages in thread
From: ABRAHAM, KISHON VIJAY @ 2012-06-28 15:56 UTC (permalink / raw)
  To: N, Mugunthan V; +Cc: linux-omap, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 853 bytes --]

Hi,

On Wed, Jun 27, 2012 at 11:11 AM, N, Mugunthan V <mugunthanvnm@ti.com>wrote:

> > -----Original Message-----
> > From: N, Mugunthan V
> > Sent: Thursday, June 07, 2012 9:52 PM
> > To: 'linux-omap@vger.kernel.org'
> > Cc: 'linux-arm-kernel@lists.infradead.org'
> > Subject: how to specify dma_mask and coherent_dma_mask in hwmod
> >
> > Hi
> >
> > While converting platform device registry to Hwmod for CPSW Ethernet
> > driver which is present in AM335X (OMAP2+), I am not finding a way to
> > specify
> > dma_mask and coherent_dma_mask.
> > Is there a way to specify dma_mask and coherent_dma_mask in hwmod?
>

Nope. You can specify dma_mask after creating the device as done in
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=arch/arm/mach-omap2/usb-musb.c;h=c4a576856661014ea3bec9acc70f80e32d62c33b;hb=HEAD

Regards
Kishon

[-- Attachment #1.2: Type: text/html, Size: 1536 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-06-28 15:56   ` ABRAHAM, KISHON VIJAY
  0 siblings, 0 replies; 30+ messages in thread
From: ABRAHAM, KISHON VIJAY @ 2012-06-28 15:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Wed, Jun 27, 2012 at 11:11 AM, N, Mugunthan V <mugunthanvnm@ti.com>wrote:

> > -----Original Message-----
> > From: N, Mugunthan V
> > Sent: Thursday, June 07, 2012 9:52 PM
> > To: 'linux-omap at vger.kernel.org'
> > Cc: 'linux-arm-kernel at lists.infradead.org'
> > Subject: how to specify dma_mask and coherent_dma_mask in hwmod
> >
> > Hi
> >
> > While converting platform device registry to Hwmod for CPSW Ethernet
> > driver which is present in AM335X (OMAP2+), I am not finding a way to
> > specify
> > dma_mask and coherent_dma_mask.
> > Is there a way to specify dma_mask and coherent_dma_mask in hwmod?
>

Nope. You can specify dma_mask after creating the device as done in
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=arch/arm/mach-omap2/usb-musb.c;h=c4a576856661014ea3bec9acc70f80e32d62c33b;hb=HEAD

Regards
Kishon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120628/269c4d6a/attachment.html>

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

* Re: how to specify dma_mask and coherent_dma_mask in hwmod
  2012-06-27  5:41 ` N, Mugunthan V
@ 2012-06-28 15:58   ` ABRAHAM, KISHON VIJAY
  -1 siblings, 0 replies; 30+ messages in thread
From: ABRAHAM, KISHON VIJAY @ 2012-06-28 15:58 UTC (permalink / raw)
  To: N, Mugunthan V; +Cc: linux-omap, linux-arm-kernel

Hi,

On Wed, Jun 27, 2012 at 11:11 AM, N, Mugunthan V <mugunthanvnm@ti.com> wrote:
>> -----Original Message-----
>> From: N, Mugunthan V
>> Sent: Thursday, June 07, 2012 9:52 PM
>> To: 'linux-omap@vger.kernel.org'
>> Cc: 'linux-arm-kernel@lists.infradead.org'
>> Subject: how to specify dma_mask and coherent_dma_mask in hwmod
>>
>> Hi
>>
>> While converting platform device registry to Hwmod for CPSW Ethernet
>> driver which is present in AM335X (OMAP2+), I am not finding a way to
>> specify
>> dma_mask and coherent_dma_mask.
>> Is there a way to specify dma_mask and coherent_dma_mask in hwmod?
>
> Ping, any one has comment on this?
>
Nope. You can specify dma_mask after creating the device as done in
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=arch/arm/mach-omap2/usb-musb.c;h=c4a576856661014ea3bec9acc70f80e32d62c33b;hb=HEAD

Regards
Kishon

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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-06-28 15:58   ` ABRAHAM, KISHON VIJAY
  0 siblings, 0 replies; 30+ messages in thread
From: ABRAHAM, KISHON VIJAY @ 2012-06-28 15:58 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Wed, Jun 27, 2012 at 11:11 AM, N, Mugunthan V <mugunthanvnm@ti.com> wrote:
>> -----Original Message-----
>> From: N, Mugunthan V
>> Sent: Thursday, June 07, 2012 9:52 PM
>> To: 'linux-omap at vger.kernel.org'
>> Cc: 'linux-arm-kernel at lists.infradead.org'
>> Subject: how to specify dma_mask and coherent_dma_mask in hwmod
>>
>> Hi
>>
>> While converting platform device registry to Hwmod for CPSW Ethernet
>> driver which is present in AM335X (OMAP2+), I am not finding a way to
>> specify
>> dma_mask and coherent_dma_mask.
>> Is there a way to specify dma_mask and coherent_dma_mask in hwmod?
>
> Ping, any one has comment on this?
>
Nope. You can specify dma_mask after creating the device as done in
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=arch/arm/mach-omap2/usb-musb.c;h=c4a576856661014ea3bec9acc70f80e32d62c33b;hb=HEAD

Regards
Kishon

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

* RE: how to specify dma_mask and coherent_dma_mask in hwmod
  2012-06-28 15:52     ` Paul Walmsley
@ 2012-06-28 16:31       ` Bedia, Vaibhav
  -1 siblings, 0 replies; 30+ messages in thread
From: Bedia, Vaibhav @ 2012-06-28 16:31 UTC (permalink / raw)
  To: Paul Walmsley, N, Mugunthan V
  Cc: linux-omap, linux-arm-kernel, Cousson, Benoit, Hilman, Kevin

Hi Paul,

On Thu, Jun 28, 2012 at 21:22:54, Paul Walmsley wrote:
[...]
> 
> dma_mask and coherent_dma_mask can be specified during 
> device creation.  See usb_musb_init() in arch/arm/mach-omap2/usb-musb.c 
> for an example.
> 

Thanks for pointing this out. Should omap_device_build() start handling this
or would that be an overkill?

Regards,
Vaibhav B.


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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-06-28 16:31       ` Bedia, Vaibhav
  0 siblings, 0 replies; 30+ messages in thread
From: Bedia, Vaibhav @ 2012-06-28 16:31 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Paul,

On Thu, Jun 28, 2012 at 21:22:54, Paul Walmsley wrote:
[...]
> 
> dma_mask and coherent_dma_mask can be specified during 
> device creation.  See usb_musb_init() in arch/arm/mach-omap2/usb-musb.c 
> for an example.
> 

Thanks for pointing this out. Should omap_device_build() start handling this
or would that be an overkill?

Regards,
Vaibhav B.

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

* RE: how to specify dma_mask and coherent_dma_mask in hwmod
  2012-06-28 16:31       ` Bedia, Vaibhav
@ 2012-06-28 16:32         ` Paul Walmsley
  -1 siblings, 0 replies; 30+ messages in thread
From: Paul Walmsley @ 2012-06-28 16:32 UTC (permalink / raw)
  To: Bedia, Vaibhav
  Cc: N, Mugunthan V, linux-omap, linux-arm-kernel, Cousson, Benoit,
	Hilman, Kevin

On Thu, 28 Jun 2012, Bedia, Vaibhav wrote:

> On Thu, Jun 28, 2012 at 21:22:54, Paul Walmsley wrote:
> [...]
> > 
> > dma_mask and coherent_dma_mask can be specified during 
> > device creation.  See usb_musb_init() in arch/arm/mach-omap2/usb-musb.c 
> > for an example.
> > 
> 
> Thanks for pointing this out. Should omap_device_build() start handling this
> or would that be an overkill?

If both dma_mask and coherent_dma_mask are always 0xffffffff on all OMAPs 
and we can set that safely even for devices that don't use it, then yeah 
it sounds like we should set it.

Care to send a patch?


- Paul

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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-06-28 16:32         ` Paul Walmsley
  0 siblings, 0 replies; 30+ messages in thread
From: Paul Walmsley @ 2012-06-28 16:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 28 Jun 2012, Bedia, Vaibhav wrote:

> On Thu, Jun 28, 2012 at 21:22:54, Paul Walmsley wrote:
> [...]
> > 
> > dma_mask and coherent_dma_mask can be specified during 
> > device creation.  See usb_musb_init() in arch/arm/mach-omap2/usb-musb.c 
> > for an example.
> > 
> 
> Thanks for pointing this out. Should omap_device_build() start handling this
> or would that be an overkill?

If both dma_mask and coherent_dma_mask are always 0xffffffff on all OMAPs 
and we can set that safely even for devices that don't use it, then yeah 
it sounds like we should set it.

Care to send a patch?


- Paul

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

* RE: how to specify dma_mask and coherent_dma_mask in hwmod
  2012-06-28 16:32         ` Paul Walmsley
@ 2012-06-28 16:42           ` Bedia, Vaibhav
  -1 siblings, 0 replies; 30+ messages in thread
From: Bedia, Vaibhav @ 2012-06-28 16:42 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: N, Mugunthan V, linux-omap, linux-arm-kernel, Cousson, Benoit,
	Hilman, Kevin

On Thu, Jun 28, 2012 at 22:02:46, Paul Walmsley wrote:
> On Thu, 28 Jun 2012, Bedia, Vaibhav wrote:
> 
> > On Thu, Jun 28, 2012 at 21:22:54, Paul Walmsley wrote:
> > [...]
> > > 
> > > dma_mask and coherent_dma_mask can be specified during 
> > > device creation.  See usb_musb_init() in arch/arm/mach-omap2/usb-musb.c 
> > > for an example.
> > > 
> > 
> > Thanks for pointing this out. Should omap_device_build() start handling this
> > or would that be an overkill?
> 
> If both dma_mask and coherent_dma_mask are always 0xffffffff on all OMAPs 
> and we can set that safely even for devices that don't use it, then yeah 
> it sounds like we should set it.
> 

I guess that's the case here also.
 
> Care to send a patch?
> 

Sure. Let me check with Mugunthan once.

Regards,
Vaibhav B.

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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-06-28 16:42           ` Bedia, Vaibhav
  0 siblings, 0 replies; 30+ messages in thread
From: Bedia, Vaibhav @ 2012-06-28 16:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 28, 2012 at 22:02:46, Paul Walmsley wrote:
> On Thu, 28 Jun 2012, Bedia, Vaibhav wrote:
> 
> > On Thu, Jun 28, 2012 at 21:22:54, Paul Walmsley wrote:
> > [...]
> > > 
> > > dma_mask and coherent_dma_mask can be specified during 
> > > device creation.  See usb_musb_init() in arch/arm/mach-omap2/usb-musb.c 
> > > for an example.
> > > 
> > 
> > Thanks for pointing this out. Should omap_device_build() start handling this
> > or would that be an overkill?
> 
> If both dma_mask and coherent_dma_mask are always 0xffffffff on all OMAPs 
> and we can set that safely even for devices that don't use it, then yeah 
> it sounds like we should set it.
> 

I guess that's the case here also.
 
> Care to send a patch?
> 

Sure. Let me check with Mugunthan once.

Regards,
Vaibhav B.

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

* RE: how to specify dma_mask and coherent_dma_mask in hwmod
  2012-06-28 16:32         ` Paul Walmsley
@ 2012-06-29 11:23           ` Bedia, Vaibhav
  -1 siblings, 0 replies; 30+ messages in thread
From: Bedia, Vaibhav @ 2012-06-29 11:23 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: N, Mugunthan V, linux-omap, linux-arm-kernel, Cousson, Benoit,
	Hilman, Kevin

Hi Paul,

On Thu, Jun 28, 2012 at 22:02:46, Paul Walmsley wrote:
> On Thu, 28 Jun 2012, Bedia, Vaibhav wrote:
> 
> > On Thu, Jun 28, 2012 at 21:22:54, Paul Walmsley wrote:
> > [...]
> > > 
> > > dma_mask and coherent_dma_mask can be specified during 
> > > device creation.  See usb_musb_init() in arch/arm/mach-omap2/usb-musb.c 
> > > for an example.
> > > 
> > 
> > Thanks for pointing this out. Should omap_device_build() start handling this
> > or would that be an overkill?
> 
> If both dma_mask and coherent_dma_mask are always 0xffffffff on all OMAPs 
> and we can set that safely even for devices that don't use it, then yeah 
> it sounds like we should set it.
> 
> Care to send a patch?
> 

I just grepped for the any other user of this under mach-omap2 and plat-omap
and there are a few other places where it's getting used. All of them are
setting it to 0xffffffff and same is the case with the CPSW driver. 

I don't know much about the dma stuff so I am bit reluctant in setting this
unconditionally. I looked at setting the mask based on a flag during
omap_device_build() but an additional flag in the API will cause all the users
to be changed. We could perhaps extend the omap_hwmod structure for passing on
this information. Or for CPSW we could stick with approach that's been adopted
in usb_musb_init(). Which approach sounds better to you?

Regards,
Vaibhav B.

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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-06-29 11:23           ` Bedia, Vaibhav
  0 siblings, 0 replies; 30+ messages in thread
From: Bedia, Vaibhav @ 2012-06-29 11:23 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Paul,

On Thu, Jun 28, 2012 at 22:02:46, Paul Walmsley wrote:
> On Thu, 28 Jun 2012, Bedia, Vaibhav wrote:
> 
> > On Thu, Jun 28, 2012 at 21:22:54, Paul Walmsley wrote:
> > [...]
> > > 
> > > dma_mask and coherent_dma_mask can be specified during 
> > > device creation.  See usb_musb_init() in arch/arm/mach-omap2/usb-musb.c 
> > > for an example.
> > > 
> > 
> > Thanks for pointing this out. Should omap_device_build() start handling this
> > or would that be an overkill?
> 
> If both dma_mask and coherent_dma_mask are always 0xffffffff on all OMAPs 
> and we can set that safely even for devices that don't use it, then yeah 
> it sounds like we should set it.
> 
> Care to send a patch?
> 

I just grepped for the any other user of this under mach-omap2 and plat-omap
and there are a few other places where it's getting used. All of them are
setting it to 0xffffffff and same is the case with the CPSW driver. 

I don't know much about the dma stuff so I am bit reluctant in setting this
unconditionally. I looked at setting the mask based on a flag during
omap_device_build() but an additional flag in the API will cause all the users
to be changed. We could perhaps extend the omap_hwmod structure for passing on
this information. Or for CPSW we could stick with approach that's been adopted
in usb_musb_init(). Which approach sounds better to you?

Regards,
Vaibhav B.

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

* RE: how to specify dma_mask and coherent_dma_mask in hwmod
  2012-06-29 11:23           ` Bedia, Vaibhav
@ 2012-07-02  7:16             ` N, Mugunthan V
  -1 siblings, 0 replies; 30+ messages in thread
From: N, Mugunthan V @ 2012-07-02  7:16 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: linux-omap, linux-arm-kernel, Cousson, Benoit, Hilman, Kevin,
	Bedia, Vaibhav

Hi Paul,

> -----Original Message-----
> From: Bedia, Vaibhav
> Sent: Friday, June 29, 2012 4:54 PM
> To: Paul Walmsley
> Cc: N, Mugunthan V; linux-omap@vger.kernel.org; linux-arm-
> kernel@lists.infradead.org; Cousson, Benoit; Hilman, Kevin
> Subject: RE: how to specify dma_mask and coherent_dma_mask in hwmod
> 
> Hi Paul,
> 
> On Thu, Jun 28, 2012 at 22:02:46, Paul Walmsley wrote:
> > On Thu, 28 Jun 2012, Bedia, Vaibhav wrote:
> >
> > > On Thu, Jun 28, 2012 at 21:22:54, Paul Walmsley wrote:
> > > [...]
> > > >
> > > > dma_mask and coherent_dma_mask can be specified during
> > > > device creation.  See usb_musb_init() in arch/arm/mach-omap2/usb-
> musb.c
> > > > for an example.
> > > >
> > >
> > > Thanks for pointing this out. Should omap_device_build() start
> handling this
> > > or would that be an overkill?
> >
> > If both dma_mask and coherent_dma_mask are always 0xffffffff on all
> OMAPs
> > and we can set that safely even for devices that don't use it, then yeah
> > it sounds like we should set it.
> >
> > Care to send a patch?
> >
> 
> I just grepped for the any other user of this under mach-omap2 and plat-
> omap
> and there are a few other places where it's getting used. All of them are
> setting it to 0xffffffff and same is the case with the CPSW driver.
> 
> I don't know much about the dma stuff so I am bit reluctant in setting
> this
> unconditionally. I looked at setting the mask based on a flag during
> omap_device_build() but an additional flag in the API will cause all the
> users
> to be changed. We could perhaps extend the omap_hwmod structure for
> passing on
> this information. Or for CPSW we could stick with approach that's been
> adopted
> in usb_musb_init(). Which approach sounds better to you?
> 
> Regards,
> Vaibhav B.

Extending omap_device_build() to accommodate dma masks will endup with lot 
of code changes in other modules, so will follow the same from 
usb_musd_init().

Regards,
Mugunthan V N.


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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-07-02  7:16             ` N, Mugunthan V
  0 siblings, 0 replies; 30+ messages in thread
From: N, Mugunthan V @ 2012-07-02  7:16 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Paul,

> -----Original Message-----
> From: Bedia, Vaibhav
> Sent: Friday, June 29, 2012 4:54 PM
> To: Paul Walmsley
> Cc: N, Mugunthan V; linux-omap at vger.kernel.org; linux-arm-
> kernel at lists.infradead.org; Cousson, Benoit; Hilman, Kevin
> Subject: RE: how to specify dma_mask and coherent_dma_mask in hwmod
> 
> Hi Paul,
> 
> On Thu, Jun 28, 2012 at 22:02:46, Paul Walmsley wrote:
> > On Thu, 28 Jun 2012, Bedia, Vaibhav wrote:
> >
> > > On Thu, Jun 28, 2012 at 21:22:54, Paul Walmsley wrote:
> > > [...]
> > > >
> > > > dma_mask and coherent_dma_mask can be specified during
> > > > device creation.  See usb_musb_init() in arch/arm/mach-omap2/usb-
> musb.c
> > > > for an example.
> > > >
> > >
> > > Thanks for pointing this out. Should omap_device_build() start
> handling this
> > > or would that be an overkill?
> >
> > If both dma_mask and coherent_dma_mask are always 0xffffffff on all
> OMAPs
> > and we can set that safely even for devices that don't use it, then yeah
> > it sounds like we should set it.
> >
> > Care to send a patch?
> >
> 
> I just grepped for the any other user of this under mach-omap2 and plat-
> omap
> and there are a few other places where it's getting used. All of them are
> setting it to 0xffffffff and same is the case with the CPSW driver.
> 
> I don't know much about the dma stuff so I am bit reluctant in setting
> this
> unconditionally. I looked at setting the mask based on a flag during
> omap_device_build() but an additional flag in the API will cause all the
> users
> to be changed. We could perhaps extend the omap_hwmod structure for
> passing on
> this information. Or for CPSW we could stick with approach that's been
> adopted
> in usb_musb_init(). Which approach sounds better to you?
> 
> Regards,
> Vaibhav B.

Extending omap_device_build() to accommodate dma masks will endup with lot 
of code changes in other modules, so will follow the same from 
usb_musd_init().

Regards,
Mugunthan V N.

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

* RE: how to specify dma_mask and coherent_dma_mask in hwmod
  2012-07-02  7:16             ` N, Mugunthan V
@ 2012-07-04  9:28               ` Paul Walmsley
  -1 siblings, 0 replies; 30+ messages in thread
From: Paul Walmsley @ 2012-07-04  9:28 UTC (permalink / raw)
  To: N, Mugunthan V
  Cc: linux-omap, linux-arm-kernel, Cousson, Benoit, Hilman, Kevin,
	Bedia, Vaibhav

On Mon, 2 Jul 2012, N, Mugunthan V wrote:

> Extending omap_device_build() to accommodate dma masks will endup with lot 
> of code changes in other modules

Why?


- Paul

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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-07-04  9:28               ` Paul Walmsley
  0 siblings, 0 replies; 30+ messages in thread
From: Paul Walmsley @ 2012-07-04  9:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 2 Jul 2012, N, Mugunthan V wrote:

> Extending omap_device_build() to accommodate dma masks will endup with lot 
> of code changes in other modules

Why?


- Paul

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

* Re: how to specify dma_mask and coherent_dma_mask in hwmod
  2012-07-04 11:47     ` N, Mugunthan V
@ 2012-07-04 13:25       ` Russell King - ARM Linux
  -1 siblings, 0 replies; 30+ messages in thread
From: Russell King - ARM Linux @ 2012-07-04 13:25 UTC (permalink / raw)
  To: N, Mugunthan V; +Cc: Paul Walmsley, linux-omap, linux-arm-kernel

On Wed, Jul 04, 2012 at 11:47:35AM +0000, N, Mugunthan V wrote:
> > -----Original Message-----
> > From: Russell King - ARM Linux [mailto:linux@arm.linux.org.uk]
> > Sent: Wednesday, July 04, 2012 3:12 PM
> > To: N, Mugunthan V
> > Cc: linux-omap@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> > Subject: Re: how to specify dma_mask and coherent_dma_mask in hwmod
> > 
> > On Thu, Jun 07, 2012 at 04:22:17PM +0000, N, Mugunthan V wrote:
> > > While converting platform device registry to Hwmod for CPSW Ethernet
> > > driver which is present in AM335X (OMAP2+), I am not finding a way
> > > to specify dma_mask and coherent_dma_mask.
> > > Is there a way to specify dma_mask and coherent_dma_mask in hwmod?
> > 
> > Just remember that we're moving stuff to DMA engine, and that means
> > the sDMA device has DMA masks, but none of the peripherals which make
> > use of sDMA should have DMA masks set.
> > 
> > The reason for this is because the device responsible for accessing
> > memory is sDMA, not the peripheral device, and therefore any memory
> > properties for DMA should come from the sDMA device, not the peripheral
> > device.
> 
> I agree that properties of DMA should come from sDMA device. In my case 
> (CPSW Ethernet) has a peripheral DMA (davinci_cpdma) which takes care of 
> transferring packet from memory to Ethernet IP and vice versa.

Right, so you have two devices here.

You have the Ethernet device, and you have the cpdma device.  The cpdma
device is the device actually performing the memory accesses on behalf
of the Ethernet device.

> For allocating DMA memory space for davinci_cpdma, dma_alloc_coherent is 
> used which requires dma_masks to be specified for the device.

So, memory which you allocate for DMA purposes should use the struct
device associated with the cpdma device, not the struct device associated
with the Ethernet device.

That becomes possible when DMA implementations are converted to use the
DMA engine API, and with proper channel virtualization, device drivers
can retain their virtual channel handle (and therefore access to the
DMA engine struct device) indefinitely.

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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-07-04 13:25       ` Russell King - ARM Linux
  0 siblings, 0 replies; 30+ messages in thread
From: Russell King - ARM Linux @ 2012-07-04 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 04, 2012 at 11:47:35AM +0000, N, Mugunthan V wrote:
> > -----Original Message-----
> > From: Russell King - ARM Linux [mailto:linux at arm.linux.org.uk]
> > Sent: Wednesday, July 04, 2012 3:12 PM
> > To: N, Mugunthan V
> > Cc: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
> > Subject: Re: how to specify dma_mask and coherent_dma_mask in hwmod
> > 
> > On Thu, Jun 07, 2012 at 04:22:17PM +0000, N, Mugunthan V wrote:
> > > While converting platform device registry to Hwmod for CPSW Ethernet
> > > driver which is present in AM335X (OMAP2+), I am not finding a way
> > > to specify dma_mask and coherent_dma_mask.
> > > Is there a way to specify dma_mask and coherent_dma_mask in hwmod?
> > 
> > Just remember that we're moving stuff to DMA engine, and that means
> > the sDMA device has DMA masks, but none of the peripherals which make
> > use of sDMA should have DMA masks set.
> > 
> > The reason for this is because the device responsible for accessing
> > memory is sDMA, not the peripheral device, and therefore any memory
> > properties for DMA should come from the sDMA device, not the peripheral
> > device.
> 
> I agree that properties of DMA should come from sDMA device. In my case 
> (CPSW Ethernet) has a peripheral DMA (davinci_cpdma) which takes care of 
> transferring packet from memory to Ethernet IP and vice versa.

Right, so you have two devices here.

You have the Ethernet device, and you have the cpdma device.  The cpdma
device is the device actually performing the memory accesses on behalf
of the Ethernet device.

> For allocating DMA memory space for davinci_cpdma, dma_alloc_coherent is 
> used which requires dma_masks to be specified for the device.

So, memory which you allocate for DMA purposes should use the struct
device associated with the cpdma device, not the struct device associated
with the Ethernet device.

That becomes possible when DMA implementations are converted to use the
DMA engine API, and with proper channel virtualization, device drivers
can retain their virtual channel handle (and therefore access to the
DMA engine struct device) indefinitely.

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

* RE: how to specify dma_mask and coherent_dma_mask in hwmod
  2012-07-04  9:41   ` Russell King - ARM Linux
@ 2012-07-04 11:47     ` N, Mugunthan V
  -1 siblings, 0 replies; 30+ messages in thread
From: N, Mugunthan V @ 2012-07-04 11:47 UTC (permalink / raw)
  To: Russell King - ARM Linux, Paul Walmsley; +Cc: linux-omap, linux-arm-kernel

> -----Original Message-----
> From: Russell King - ARM Linux [mailto:linux@arm.linux.org.uk]
> Sent: Wednesday, July 04, 2012 3:12 PM
> To: N, Mugunthan V
> Cc: linux-omap@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> Subject: Re: how to specify dma_mask and coherent_dma_mask in hwmod
> 
> On Thu, Jun 07, 2012 at 04:22:17PM +0000, N, Mugunthan V wrote:
> > While converting platform device registry to Hwmod for CPSW Ethernet
> > driver which is present in AM335X (OMAP2+), I am not finding a way
> > to specify dma_mask and coherent_dma_mask.
> > Is there a way to specify dma_mask and coherent_dma_mask in hwmod?
> 
> Just remember that we're moving stuff to DMA engine, and that means
> the sDMA device has DMA masks, but none of the peripherals which make
> use of sDMA should have DMA masks set.
> 
> The reason for this is because the device responsible for accessing
> memory is sDMA, not the peripheral device, and therefore any memory
> properties for DMA should come from the sDMA device, not the peripheral
> device.

I agree that properties of DMA should come from sDMA device. In my case 
(CPSW Ethernet) has a peripheral DMA (davinci_cpdma) which takes care of 
transferring packet from memory to Ethernet IP and vice versa.

For allocating DMA memory space for davinci_cpdma, dma_alloc_coherent is 
used which requires dma_masks to be specified for the device.

To pass the dma_masks to the device following ways can be followed.
1. Extend omap_device_build arguments to hold dma_mask and coherent_dma_mask
   which will affect all other devices which uses omap_device_build api.
2. Hardcode the dma_mask and coherent_dma_mask in omap_device_build with 
   0xffffffff which can harm other devices
3. Specify the dma_mask and coherent_dma_mask after creating the device as
   done in musb device.
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=arch/a
rm/mach-omap2/usb-musb.c;h=c4a576856661014ea3bec9acc70f80e32d62c33b;hb=HEAD

Regards,
Mugunthan V N

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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-07-04 11:47     ` N, Mugunthan V
  0 siblings, 0 replies; 30+ messages in thread
From: N, Mugunthan V @ 2012-07-04 11:47 UTC (permalink / raw)
  To: linux-arm-kernel

> -----Original Message-----
> From: Russell King - ARM Linux [mailto:linux at arm.linux.org.uk]
> Sent: Wednesday, July 04, 2012 3:12 PM
> To: N, Mugunthan V
> Cc: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
> Subject: Re: how to specify dma_mask and coherent_dma_mask in hwmod
> 
> On Thu, Jun 07, 2012 at 04:22:17PM +0000, N, Mugunthan V wrote:
> > While converting platform device registry to Hwmod for CPSW Ethernet
> > driver which is present in AM335X (OMAP2+), I am not finding a way
> > to specify dma_mask and coherent_dma_mask.
> > Is there a way to specify dma_mask and coherent_dma_mask in hwmod?
> 
> Just remember that we're moving stuff to DMA engine, and that means
> the sDMA device has DMA masks, but none of the peripherals which make
> use of sDMA should have DMA masks set.
> 
> The reason for this is because the device responsible for accessing
> memory is sDMA, not the peripheral device, and therefore any memory
> properties for DMA should come from the sDMA device, not the peripheral
> device.

I agree that properties of DMA should come from sDMA device. In my case 
(CPSW Ethernet) has a peripheral DMA (davinci_cpdma) which takes care of 
transferring packet from memory to Ethernet IP and vice versa.

For allocating DMA memory space for davinci_cpdma, dma_alloc_coherent is 
used which requires dma_masks to be specified for the device.

To pass the dma_masks to the device following ways can be followed.
1. Extend omap_device_build arguments to hold dma_mask and coherent_dma_mask
   which will affect all other devices which uses omap_device_build api.
2. Hardcode the dma_mask and coherent_dma_mask in omap_device_build with 
   0xffffffff which can harm other devices
3. Specify the dma_mask and coherent_dma_mask after creating the device as
   done in musb device.
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=arch/a
rm/mach-omap2/usb-musb.c;h=c4a576856661014ea3bec9acc70f80e32d62c33b;hb=HEAD

Regards,
Mugunthan V N

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

* Re: how to specify dma_mask and coherent_dma_mask in hwmod
  2012-06-07 16:22 ` N, Mugunthan V
@ 2012-07-04  9:41   ` Russell King - ARM Linux
  -1 siblings, 0 replies; 30+ messages in thread
From: Russell King - ARM Linux @ 2012-07-04  9:41 UTC (permalink / raw)
  To: N, Mugunthan V; +Cc: linux-omap, linux-arm-kernel

On Thu, Jun 07, 2012 at 04:22:17PM +0000, N, Mugunthan V wrote:
> While converting platform device registry to Hwmod for CPSW Ethernet
> driver which is present in AM335X (OMAP2+), I am not finding a way
> to specify dma_mask and coherent_dma_mask.
> Is there a way to specify dma_mask and coherent_dma_mask in hwmod?

Just remember that we're moving stuff to DMA engine, and that means
the sDMA device has DMA masks, but none of the peripherals which make
use of sDMA should have DMA masks set.

The reason for this is because the device responsible for accessing
memory is sDMA, not the peripheral device, and therefore any memory
properties for DMA should come from the sDMA device, not the peripheral
device.

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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-07-04  9:41   ` Russell King - ARM Linux
  0 siblings, 0 replies; 30+ messages in thread
From: Russell King - ARM Linux @ 2012-07-04  9:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 07, 2012 at 04:22:17PM +0000, N, Mugunthan V wrote:
> While converting platform device registry to Hwmod for CPSW Ethernet
> driver which is present in AM335X (OMAP2+), I am not finding a way
> to specify dma_mask and coherent_dma_mask.
> Is there a way to specify dma_mask and coherent_dma_mask in hwmod?

Just remember that we're moving stuff to DMA engine, and that means
the sDMA device has DMA masks, but none of the peripherals which make
use of sDMA should have DMA masks set.

The reason for this is because the device responsible for accessing
memory is sDMA, not the peripheral device, and therefore any memory
properties for DMA should come from the sDMA device, not the peripheral
device.

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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-06-07 16:22 ` N, Mugunthan V
  0 siblings, 0 replies; 30+ messages in thread
From: N, Mugunthan V @ 2012-06-07 16:22 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-arm-kernel

Hi 

While converting platform device registry to Hwmod for CPSW Ethernet driver which is present in AM335X (OMAP2+), I am not finding a way to specify
dma_mask and coherent_dma_mask.
Is there a way to specify dma_mask and coherent_dma_mask in hwmod?

---
Regards,
Mugunthan V N. 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* how to specify dma_mask and coherent_dma_mask in hwmod
@ 2012-06-07 16:22 ` N, Mugunthan V
  0 siblings, 0 replies; 30+ messages in thread
From: N, Mugunthan V @ 2012-06-07 16:22 UTC (permalink / raw)
  To: linux-arm-kernel

Hi 

While converting platform device registry to Hwmod for CPSW Ethernet driver which is present in AM335X (OMAP2+), I am not finding a way to specify
dma_mask and coherent_dma_mask.
Is there a way to specify dma_mask and coherent_dma_mask in hwmod?

---
Regards,
Mugunthan V N.?

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

end of thread, other threads:[~2012-07-04 13:25 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-27  5:41 how to specify dma_mask and coherent_dma_mask in hwmod N, Mugunthan V
2012-06-27  5:41 ` N, Mugunthan V
2012-06-28 15:27 ` Bedia, Vaibhav
2012-06-28 15:27   ` Bedia, Vaibhav
2012-06-28 15:52   ` Paul Walmsley
2012-06-28 15:52     ` Paul Walmsley
2012-06-28 16:31     ` Bedia, Vaibhav
2012-06-28 16:31       ` Bedia, Vaibhav
2012-06-28 16:32       ` Paul Walmsley
2012-06-28 16:32         ` Paul Walmsley
2012-06-28 16:42         ` Bedia, Vaibhav
2012-06-28 16:42           ` Bedia, Vaibhav
2012-06-29 11:23         ` Bedia, Vaibhav
2012-06-29 11:23           ` Bedia, Vaibhav
2012-07-02  7:16           ` N, Mugunthan V
2012-07-02  7:16             ` N, Mugunthan V
2012-07-04  9:28             ` Paul Walmsley
2012-07-04  9:28               ` Paul Walmsley
2012-06-28 15:56 ` ABRAHAM, KISHON VIJAY
2012-06-28 15:56   ` ABRAHAM, KISHON VIJAY
2012-06-28 15:58 ` ABRAHAM, KISHON VIJAY
2012-06-28 15:58   ` ABRAHAM, KISHON VIJAY
  -- strict thread matches above, loose matches on Subject: below --
2012-06-07 16:22 N, Mugunthan V
2012-06-07 16:22 ` N, Mugunthan V
2012-07-04  9:41 ` Russell King - ARM Linux
2012-07-04  9:41   ` Russell King - ARM Linux
2012-07-04 11:47   ` N, Mugunthan V
2012-07-04 11:47     ` N, Mugunthan V
2012-07-04 13:25     ` Russell King - ARM Linux
2012-07-04 13:25       ` Russell King - ARM Linux

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.