public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* dma_alloc_coherent
@ 2006-04-04 18:07 Kartik Babu
  0 siblings, 0 replies; 3+ messages in thread
From: Kartik Babu @ 2006-04-04 18:07 UTC (permalink / raw)
  To: linux-kernel

  I'm trying to replace consistent_alloc in a driver that was written 
for the 2.4 kernel with dma_alloc_coherent. My question is that I do not 
use a struct device * pointer at all. Browsing through the source for 
the 2.6.12
on ARM XScale PXA255, I see that this argument may be NULL.

 Still, I'd like to know if passing NULL has any side effects. If so, 
what are they?

 I do however have a cdev structure taht I use for device registration, 
but I do not see how that would help.

Thanks
Kartik

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

* Re: dma_alloc_coherent
       [not found] <5XY8B-82x-1@gated-at.bofh.it>
@ 2006-04-04 23:45 ` Robert Hancock
  2006-04-05 14:12   ` dma_alloc_coherent Kartik Babu
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Hancock @ 2006-04-04 23:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: Kartik Babu

Kartik Babu wrote:
>  I'm trying to replace consistent_alloc in a driver that was written for 
> the 2.4 kernel with dma_alloc_coherent. My question is that I do not use 
> a struct device * pointer at all. Browsing through the source for the 
> 2.6.12
> on ARM XScale PXA255, I see that this argument may be NULL.
> 
> Still, I'd like to know if passing NULL has any side effects. If so, 
> what are they?
> 
> I do however have a cdev structure taht I use for device registration, 
> but I do not see how that would help.

What kind of a device is it? If it's a PCI device, the struct device can 
be accessed with the dev pointer inside the struct pci_dev.

-- 
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/


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

* Re: dma_alloc_coherent
  2006-04-04 23:45 ` dma_alloc_coherent Robert Hancock
@ 2006-04-05 14:12   ` Kartik Babu
  0 siblings, 0 replies; 3+ messages in thread
From: Kartik Babu @ 2006-04-05 14:12 UTC (permalink / raw)
  To: Robert Hancock; +Cc: linux-kernel

Its a char device driver Im using to control the SPI port on the PXA255 
processor. I transfer fixed sized packets over this bus, and hence DMA 
is a good option instead of interrupt driven IO.

it seems that the dma_pool_create function explicitly handles both cases 
dev = NULL and dev != NULL.

However, the dma_alloc_coherent function only checks if dev is not NULL, 
and apparently uses the valu in one case without checking it.

My understanding is that the dev pointer is needed only to check the 
mask for accesible DMA locations correct?

Kartik

Robert Hancock wrote:
> Kartik Babu wrote:
>>  I'm trying to replace consistent_alloc in a driver that was written 
>> for the 2.4 kernel with dma_alloc_coherent. My question is that I do 
>> not use a struct device * pointer at all. Browsing through the source 
>> for the 2.6.12
>> on ARM XScale PXA255, I see that this argument may be NULL.
>>
>> Still, I'd like to know if passing NULL has any side effects. If so, 
>> what are they?
>>
>> I do however have a cdev structure taht I use for device 
>> registration, but I do not see how that would help.
>
> What kind of a device is it? If it's a PCI device, the struct device 
> can be accessed with the dev pointer inside the struct pci_dev.
>


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

end of thread, other threads:[~2006-04-05 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <5XY8B-82x-1@gated-at.bofh.it>
2006-04-04 23:45 ` dma_alloc_coherent Robert Hancock
2006-04-05 14:12   ` dma_alloc_coherent Kartik Babu
2006-04-04 18:07 dma_alloc_coherent Kartik Babu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox