From: dedekind1@gmail.com (Artem Bityutskiy)
To: linux-arm-kernel@lists.infradead.org
Subject: Hit BUG_ON in dma-mapping.c:425 (RFC)
Date: Thu, 24 Mar 2011 10:36:18 +0200 [thread overview]
Message-ID: <1300955778.2735.68.camel@localhost> (raw)
In-Reply-To: <20110324082521.GB9844@n2100.arm.linux.org.uk>
On Thu, 2011-03-24 at 08:25 +0000, Russell King - ARM Linux wrote:
> On Thu, Mar 24, 2011 at 04:18:13PM +0800, Nicolas Ferre wrote:
> > diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
> > --- a/drivers/spi/atmel_spi.c
> > +++ b/drivers/spi/atmel_spi.c
> > @@ -647,6 +647,22 @@ static void atmel_spi_next_message(struct spi_master *master)
> > atmel_spi_next_xfer(master, msg);
> > }
> >
> > +static void *adjust_buffer_location(struct device *dev, void *buf)
> > +{
> > + if (likely(buf < high_memory)) {
> > + return buf;
> > + } else {
> > + struct page *pg;
> > +
> > + pg = vmalloc_to_page(buf);
> > + if (pg == 0) {
> > + dev_err(dev, "failed to vmalloc_to_page\n");
> > + return NULL;
> > + }
> > + return page_address(pg) + ((size_t)buf & ~PAGE_MASK);
> > + }
> > +}
> > +
>
> This really doesn't fix the problem. If the page is read or written via
> the vmalloc mapping, you'll have stale data.
>
> DMA to vmalloc areas is dodgy at best.
This topics pops up often. So what is the right fix? And sorry for my
ignorance.
--
Best Regards,
Artem Bityutskiy (????? ????????)
next prev parent reply other threads:[~2011-03-24 8:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-05 16:49 Hit BUG_ON in dma-mapping.c:425 Nicolas Ferre
2011-01-05 16:55 ` Russell King - ARM Linux
2011-01-06 10:38 ` Nicolas Ferre
2011-01-06 11:19 ` Artem Bityutskiy
2011-03-24 8:18 ` Hit BUG_ON in dma-mapping.c:425 (RFC) Nicolas Ferre
2011-03-24 8:25 ` Russell King - ARM Linux
2011-03-24 8:36 ` Artem Bityutskiy [this message]
2011-03-24 9:27 ` Russell King - ARM Linux
2011-03-24 9:41 ` Russell King - ARM Linux
2011-03-24 11:08 ` Artem Bityutskiy
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=1300955778.2735.68.camel@localhost \
--to=dedekind1@gmail.com \
--cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).