From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755278AbYKDB24 (ORCPT ); Mon, 3 Nov 2008 20:28:56 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750940AbYKDB2s (ORCPT ); Mon, 3 Nov 2008 20:28:48 -0500 Received: from out5.smtp.messagingengine.com ([66.111.4.29]:59042 "EHLO out5.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750827AbYKDB2r (ORCPT ); Mon, 3 Nov 2008 20:28:47 -0500 X-Sasl-enc: x2uvSzEFs6fxE1Nvr3tCmo6t1RG4NlpBTG3Qb8yfi1Ov 1225762125 Date: Mon, 3 Nov 2008 23:28:40 -0200 From: Henrique de Moraes Holschuh To: Ben Dooks Cc: linux-kernel@vger.kernel.org, drzeus-mmc@drzeus.cx, sdhci-devel@list.drzeus.cx Subject: Re: [patch 6/7] SDHCI: Check DMA for overruns at end of transfer Message-ID: <20081104012840.GA16742@khazad-dum.debian.net> References: <20081103200944.099353331@fluff.org.uk> <20081103201010.820070757@fluff.org.uk> <20081103211200.GA10721@khazad-dum.debian.net> <20081103211625.GG14806@trinity.fluff.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081103211625.GG14806@trinity.fluff.org> X-GPG-Fingerprint: 1024D/1CDB0FE3 5422 5C61 F6B7 06FB 7E04 3738 EE25 DE3F 1CDB 0FE3 User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 03 Nov 2008, Ben Dooks wrote: > On Mon, Nov 03, 2008 at 07:12:00PM -0200, Henrique de Moraes Holschuh wrote: > > Maybe I didn't understand it right, but if the DMA controller could overrun > > a buffer, don't you ALSO need to add defensive padding (i.e. increase the > > buffer) to make sure nothing important gets overrun? > > This is only generated by problems elsewhere in the driver, such as > getting the timeout clock wrong. It is here just as a precaution and > as an aide to debugging, it should not trigger in normal circumstances. Then why is it just a WARN_ON, since you had a rogue DMA operation overwriting unknown kernel memory? Seems like an outright BUG_ON to me. > There is a seperate problem where the DMA buffer is passed from the stack > which is, IIRC, a complete no-no under Linux. Can't say much on that. I just found it strange that something as damaging as an overrun was only getting a WARN_ON and no defensive measure. If it is not going to happen normally, it might not require a defensive buffer, but once it happens, it looks like one must reboot ASAP from what you said... -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh