ARM: tegra: Prevent requeuing in-progress DMA requests
authorStephen Warren <swarren@nvidia.com>
Wed, 5 Jan 2011 21:24:12 +0000 (14:24 -0700)
committerColin Cross <ccross@android.com>
Mon, 10 Jan 2011 03:18:04 +0000 (19:18 -0800)
commitaa49ac169f2f7f6a827f42118ec17355682b7a7f
treeb7199361c7b701e3d84336c87bc2c3e3ac22db13
parent178b6def88f0bc15a045ef7455cc7650d4deb859
ARM: tegra: Prevent requeuing in-progress DMA requests

If a request already in the queue is passed to tegra_dma_enqueue_req,
tegra_dma_req.node->{next,prev} will end up pointing to itself instead
of at tegra_dma_channel.list, which is the way a the end-of-list
should be set up. When the DMA request completes and is list_del'd,
the list head will still point at it, yet the node's next/prev will
contain the list poison values. When the next DMA request completes,
a kernel panic will occur when those poison values are dereferenced.

This makes the DMA driver more robust in the face of buggy clients.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Colin Cross <ccross@android.com>
arch/arm/mach-tegra/dma.c