LKML Archive on
help / color / mirror / Atom feed
From: Kumar Gala <>
To: Russell King <>,
	James Bottomley <>
Cc: Linux Kernel list <>
Subject: DMA mapping API for non-system memory pools
Date: Fri, 9 Feb 2007 17:33:01 -0600	[thread overview]
Message-ID: <> (raw)

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

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

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.


- kumar

             reply	other threads:[~2007-02-09 23:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-09 23:33 Kumar Gala [this message]
2007-02-09 23:53 ` James Bottomley
2007-02-09 23:54 ` Matthew Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: DMA mapping API for non-system memory pools' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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