public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
To: "Vitja Makarov" <vitja.makarov@gmail.com>
Cc: linux-mtd@lists.infradead.org, David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH] mtd_dataflash use command allocated on stack
Date: Thu, 26 Jun 2008 21:55:25 +0200	[thread overview]
Message-ID: <20080626215525.177e1694@siona.local> (raw)
In-Reply-To: <1925ef8a0804222100y2b0ff8d6rd640ad723d0517bc@mail.gmail.com>

Sorry about the late response...I'm currently getting up to speed with
various mailing lists.

On Wed, 23 Apr 2008 08:00:34 +0400
"Vitja Makarov" <vitja.makarov@gmail.com> wrote:

> If you are asking about could spi DMA from stack, I think so, as
> spi_sync() is called before ret, but there still are cache issues,
> dataflash or better spi driver should call invalidate/flush for the
> given address if needed, I moved it to spi_bfin code, and that seems
> to work for me wo modifyng original dataflash driver.

NO! DMA from stack is NOT safe!

The problem isn't missing cache flushing -- any driver that uses DMA
must do that anyway -- but that the flushed lines get sucked right back
in when the function returns.

Also note that DMA from stack may work _sometimes_, but you never know
when the buffer happens to share a cache line with some return
address...

Haavard

      reply	other threads:[~2008-06-26 19:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-04  5:02 [PATCH] mtd_dataflash use command allocated on stack Vitja Makarov
2008-04-22 20:20 ` David Woodhouse
2008-04-23  4:00   ` Vitja Makarov
2008-06-26 19:55     ` Haavard Skinnemoen [this message]

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=20080626215525.177e1694@siona.local \
    --to=haavard.skinnemoen@atmel.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=vitja.makarov@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox