From: "Vitja Makarov" <vitja.makarov@gmail.com>
To: "David Woodhouse" <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd_dataflash use command allocated on stack
Date: Wed, 23 Apr 2008 08:00:34 +0400 [thread overview]
Message-ID: <1925ef8a0804222100y2b0ff8d6rd640ad723d0517bc@mail.gmail.com> (raw)
In-Reply-To: <1208895638.9212.673.camel@pmac.infradead.org>
2008/4/23 David Woodhouse <dwmw2@infradead.org>:
> On Fri, 2008-04-04 at 09:02 +0400, Vitja Makarov wrote:
> > Hi!
> >
> >
> > Currently mtd_dataflash driver has command in their private structure.
> > That is only 4 bytes, sometimes actually 8 is needed.
> > Also it could be accessed twice before lock is taken.
> >
> > This patch moves command to stack.
>
> Is that allowed? The SPI code might DMA from it, surely?
>
> --
> dwmw2
>
>
I'm using this driver with dma enabled on blackfin arch and that seems to work.
Btw mutex is taken before priv->command is accessed so no race could be here.
But I still think that having command 4 bytes when it's actually 8 (4
+ 4 don't cares) isn't a good idea.
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.
next prev parent reply other threads:[~2008-04-23 4:00 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 [this message]
2008-06-26 19:55 ` Haavard Skinnemoen
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=1925ef8a0804222100y2b0ff8d6rd640ad723d0517bc@mail.gmail.com \
--to=vitja.makarov@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
/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