LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* DMA mapping API for non-system memory pools
@ 2007-02-09 23:33 Kumar Gala
  2007-02-09 23:53 ` James Bottomley
  2007-02-09 23:54 ` Matthew Jacob
  0 siblings, 2 replies; 3+ messages in thread
From: Kumar Gala @ 2007-02-09 23:33 UTC (permalink / raw)
  To: Russell King, James Bottomley; +Cc: Linux Kernel list

We've been having a discussion on the linuxppc-dev list about how to  
handle IO memory that exists on some PPC SoC devices.  These IO  
memories behave like system memory but are faster to the processor or  
device needed accessing for things like buffer descriptors.

Here's an example in which allocation is done either via system  
memory or a specialized allocator for MURAM from drivers/net/ucc_geth.c:

(Yes, the system memory should be moved to use the dma mapping api)

                 if (uf_info->bd_mem_part == MEM_PART_SYSTEM) {
                         u32 align = 4;
                         if (UCC_GETH_TX_BD_RING_ALIGNMENT > 4)
                                 align = UCC_GETH_TX_BD_RING_ALIGNMENT;
                         ugeth->tx_bd_ring_offset[j] =
                                 kmalloc((u32) (length + align),  
GFP_KERNEL);

                         if (ugeth->tx_bd_ring_offset[j] != 0)
                                 ugeth->p_tx_bd_ring[j] =
                                         (void*)((ugeth- 
 >tx_bd_ring_offset[j] +
                                         align) & ~(align - 1));
                 } else if (uf_info->bd_mem_part == MEM_PART_MURAM) {
                         ugeth->tx_bd_ring_offset[j] =
                             qe_muram_alloc(length,
                                             
UCC_GETH_TX_BD_RING_ALIGNMENT);
                         if (!IS_MURAM_ERR(ugeth->tx_bd_ring_offset[j]))
                                 ugeth->p_tx_bd_ring[j] =
                                     (u8 *) qe_muram_addr(ugeth->
                                                           
tx_bd_ring_offset[j]);
                 }

ideally all this would be handled via the dma mapping API, the  
question is how to convey to the API to use the IO memory vs the  
system memory?  Should we look at adding a new GFP_IOMEM flag or do  
something based on struct device?

Any ideas on direction (or if this is a solved problem elsewhere)  
would be appreciated.

Thanks

- kumar

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

* Re: DMA mapping API for non-system memory pools
  2007-02-09 23:33 DMA mapping API for non-system memory pools Kumar Gala
@ 2007-02-09 23:53 ` James Bottomley
  2007-02-09 23:54 ` Matthew Jacob
  1 sibling, 0 replies; 3+ messages in thread
From: James Bottomley @ 2007-02-09 23:53 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Russell King, Linux Kernel list

On Fri, 2007-02-09 at 17:33 -0600, Kumar Gala wrote:
> ideally all this would be handled via the dma mapping API, the  
> question is how to convey to the API to use the IO memory vs the  
> system memory?  Should we look at adding a new GFP_IOMEM flag or do  
> something based on struct device?
> 
> Any ideas on direction (or if this is a solved problem elsewhere)  
> would be appreciated.

Doesn't the dma_declare_coherent_memory() API work for this case?  it
was designed for the ARM SoC (and the voyager weird SCSI card).

James



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

* Re: DMA mapping API for non-system memory pools
  2007-02-09 23:33 DMA mapping API for non-system memory pools Kumar Gala
  2007-02-09 23:53 ` James Bottomley
@ 2007-02-09 23:54 ` Matthew Jacob
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Jacob @ 2007-02-09 23:54 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Russell King, James Bottomley, Linux Kernel list

Yes- this would be interesting to know wrt to doing things like
PCI<>PCI xfers (e.g., for things like the Micromemory NVRAM card).

On 2/9/07, Kumar Gala <galak@kernel.crashing.org> wrote:
> We've been having a discussion on the linuxppc-dev list about how to
> handle IO memory that exists on some PPC SoC devices.  These IO
> memories behave like system memory but are faster to the processor or
> device needed accessing for things like buffer descriptors.
>

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

end of thread, other threads:[~2007-02-09 23:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-09 23:33 DMA mapping API for non-system memory pools Kumar Gala
2007-02-09 23:53 ` James Bottomley
2007-02-09 23:54 ` Matthew Jacob

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).