All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <menon.nishanth@gmail.com>
To: lvcargnini@gmail.com
Cc: OMAP <Linux-omap-open-source@linux.omap.com>
Subject: Re: DMA omap
Date: Thu, 25 Oct 2007 19:32:05 -0500	[thread overview]
Message-ID: <47213585.5020702@gmail.com> (raw)
In-Reply-To: <ae36f8040710241228i25b7a2dy73585f7bd2491191@mail.gmail.com>

Luís Cargnini stated on 10/24/2007 2:28 PM:
> Dear fellows,
> I want to use DMA on my driver, please someone can help me,
> how could I use the functions omap_mcbsp_xmit_buffer, omap_mcbsp_recv_buffer
> and how to obtain the DMA addres that  could be used as the parameter
> dma_addr_t buffer in both functions
I am a bit rusty around this now a days, so please correct me if I am wrong:

There used to be dma_alloc_coherent when I used to work on audio driver.
you could check up again.. there are two ways you can use this buffer:
a) cached memory: this is the general form when u do a kalloc and use
memory.. Some recommend this esp if you are doing a mmap and there is
large amoung of user space processing required-cached memory speeds up
things for u. the trouble is that when u give it to DMA, it tends to
read what is directly in SDRAM as it does not know what is in MPU Cache.
so the trick is that before you give it to dma, u need to flush the
cache.. this is a tricky business, if you have small memory buffers and
u flush often.. u will kill system performance.
b) uncached memory: u might on the other hand not want any flushing to
be done, instead allocate memory in which all accesses are done straight
to the SDRAM. This is called write-through mode. in this any access to
allocated memory will go straight to the SDRAM instead of being cached..
some folks consider this as not optimal, but again it is use case
dependent. this kind of memory can be got using dma_alloc_coherent or
it's equivalent.
Regards,
Nishanth Menon

  reply	other threads:[~2007-10-26  0:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-24 19:28 DMA omap Luís Cargnini
2007-10-26  0:32 ` Nishanth Menon [this message]
2007-10-26 16:58   ` Hingkwan Huen

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=47213585.5020702@gmail.com \
    --to=menon.nishanth@gmail.com \
    --cc=Linux-omap-open-source@linux.omap.com \
    --cc=lvcargnini@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.