From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: David Brownell <david-b@pacbell.net>,
Pierre Ossman <drzeus-mmc@drzeus.cx>,
Andrew Morton <akpm@linux-foundation.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
Andrew Victor <linux@maxim.org.za>,
Russell King <rmk@arm.linux.org.uk>
Subject: Re: [patch 2.6.27-rc3] at91_mci: don't use coherent dma buffers
Date: Fri, 22 Aug 2008 09:40:00 +0200 [thread overview]
Message-ID: <48AE6D50.4030609@atmel.com> (raw)
In-Reply-To: <200808181607.21516.david-b@pacbell.net>
Pierre, Andrew,
You can add my...
David Brownell :
> From: David Brownell <dbrownell@users.sourceforge.net>
>
> At91_mci is abusing dma_free_coherent(), which may not be called
> with IRQs disabled. I saw "mkfs.ext3" on an MMC card objecting
> voluminously as each write completed:
>
> WARNING: at arch/arm/mm/consistent.c:368 dma_free_coherent+0x2c/0x224()
> [<c002726c>] (dump_stack+0x0/0x14) from [<c00387d4>] (warn_on_slowpath+0x4c/0x68)
> [<c0038788>] (warn_on_slowpath+0x0/0x68) from [<c0028768>] (dma_free_coherent+0x2c/0x224)
> r6:00008008 r5:ffc06000 r4:00000000
> [<c002873c>] (dma_free_coherent+0x0/0x224) from [<c01918ac>] (at91_mci_irq+0x374/0x420)
> [<c0191538>] (at91_mci_irq+0x0/0x420) from [<c0065d9c>] (handle_IRQ_event+0x2c/0x6c)
> ...
>
> This bug has been around for a LONG time. The MM warning is
> from late 2005, but the driver merged a year later ... so I'm
> puzzled why nobody noticed this before now.
>
> The fix involves noting that this buffer shouldn't be DMA-coherent;
> it's just used for normal DMA writes. So replace it with standard
> kmalloc() buffering and DMA mapping calls.
>
> This is the quickie fix. A better one would not rely on allocating
> large bounce buffers. (Note that dma_alloc_coherent could have failed
> too, but that case was ignored... kmalloc is a bit more likely to
> fail though.)
>
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
...
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
--
Nicolas Ferre
next prev parent reply other threads:[~2008-08-22 7:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-18 23:07 [patch 2.6.27-rc3] at91_mci: don't use coherent dma buffers David Brownell
2008-08-21 13:50 ` Pierre Ossman
2008-08-22 7:40 ` Nicolas Ferre [this message]
2008-08-22 8:40 ` Nicolas Ferre
2008-08-27 19:01 ` Pierre Ossman
2008-08-27 19:11 ` Andrew Morton
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=48AE6D50.4030609@atmel.com \
--to=nicolas.ferre@atmel.com \
--cc=akpm@linux-foundation.org \
--cc=david-b@pacbell.net \
--cc=drzeus-mmc@drzeus.cx \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@maxim.org.za \
--cc=rmk@arm.linux.org.uk \
/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