Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757146AbYHVHka (ORCPT ); Fri, 22 Aug 2008 03:40:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752810AbYHVHkW (ORCPT ); Fri, 22 Aug 2008 03:40:22 -0400 Received: from mail.atmel.fr ([81.80.104.162]:34184 "EHLO atmel-es2.atmel.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752423AbYHVHkV (ORCPT ); Fri, 22 Aug 2008 03:40:21 -0400 Message-ID: <48AE6D50.4030609@atmel.com> Date: Fri, 22 Aug 2008 09:40:00 +0200 From: Nicolas Ferre Organization: atmel User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: David Brownell , Pierre Ossman , Andrew Morton CC: lkml , Andrew Victor , Russell King Subject: Re: [patch 2.6.27-rc3] at91_mci: don't use coherent dma buffers References: <200808181607.21516.david-b@pacbell.net> In-Reply-To: <200808181607.21516.david-b@pacbell.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1757 Lines: 47 Pierre, Andrew, You can add my... David Brownell : > From: David Brownell > > 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() > [] (dump_stack+0x0/0x14) from [] (warn_on_slowpath+0x4c/0x68) > [] (warn_on_slowpath+0x0/0x68) from [] (dma_free_coherent+0x2c/0x224) > r6:00008008 r5:ffc06000 r4:00000000 > [] (dma_free_coherent+0x0/0x224) from [] (at91_mci_irq+0x374/0x420) > [] (at91_mci_irq+0x0/0x420) from [] (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 ... Signed-off-by: Nicolas Ferre -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/