Re: [patch 6/7] SDHCI: Check DMA for overruns at end of transfer

From: Ben Dooks
Date: Sat Nov 15 2008 - 19:05:29 EST


On Fri, Nov 14, 2008 at 11:00:26PM +0100, Pierre Ossman wrote:
> On Mon, 03 Nov 2008 20:09:50 +0000
> Ben Dooks <ben-linux@xxxxxxxxx> wrote:
>
> > At the end of a transfer, check that the DMA engine in the
> > SDHCI controller actually did what it was meant to and didn't
> > overrun the end of the buffer.
> >
> > This seems to be triggered by a timeout during an CMD25 (multiple block
> > write) to a card. The mmc_block module then issues a command to find out
> > how much data was moved and this seems to end up triggering this DMA
> > check. The result is the card's queue generates an OOPS as the stack has
> > been trampled on due to the extra data transfered.
> >
> > Signed-off-by: Ben Dooks <ben-linux@xxxxxxxxx>
>
> I'm sorry, but I don't see how this is anywhere near acceptable. This
> should be a panic at the very least, and until this can be sorted out
> and avoided the driver should avoid using DMA on these chips.

A panic won't help get the debug logs out of the kernel. This only
turned up whilst debugging the controller, I got the timeout clock
calculation wrong and thus ended up timing out pretty much all the
CMD25s and seeing this problem.

--
Ben (ben@xxxxxxxxx, http://www.fluff.org/)

'a smiley only costs 4 bytes'
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/