alistair23-linux/arch/mips/alchemy/common
Manuel Lauss 22f4bb68b3 MIPS: Alchemy: Fix dbdma ring destruction memory debugcheck.
DBDMA descriptors need to be located at 32-byte aligned addresses;
however kmalloc in conjunction with the SLAB allocator and
CONFIG_DEBUG_SLUB enabled doesn't deliver any.  The dbdma code works
around that by allocating a larger area and realigning the start
address within it.

When freeing a channel however this adjustment is not taken into
account which results in an oops:

Kernel bug detected[#1]:
[...]
Call Trace:
[<80186010>] cache_free_debugcheck+0x284/0x318
[<801869d8>] kfree+0xe8/0x2a0
[<8010b31c>] au1xxx_dbdma_chan_free+0x2c/0x7c
[<80388dc8>] au1x_pcm_dbdma_free+0x34/0x4c
[<80388fa8>] au1xpsc_pcm_close+0x28/0x38
[<80383cb8>] soc_codec_close+0x14c/0x1cc
[<8036dbb4>] snd_pcm_release_substream+0x60/0xac
[<8036dc40>] snd_pcm_release+0x40/0xa0
[<8018c7a8>] __fput+0x11c/0x228
[<80188f60>] filp_close+0x7c/0x98
[<80189018>] sys_close+0x9c/0xe4
[<801022a0>] stack_done+0x20/0x3c

Fix this by recording the address delivered by kmalloc() and using
it as parameter to kfree().

This fix is only necessary with the SLAB allocator and CONFIG_DEBUG_SLAB
enabled;  non-debug SLAB, SLUB do return nicely aligned addresses,
debug-enabled SLUB currently panics early in the boot process.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
To: Linux-MIPS <linux-mips@linux-mips.org>
Cc: Manuel Lauss <manuel.lauss@gmail.com>
Patchwork: http://patchwork.linux-mips.org/patch/878/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-01 20:30:25 +01:00
..
clocks.c MIPS: Alchemy: move calc_clock function. 2009-01-11 09:57:27 +00:00
dbdma.c MIPS: Alchemy: Fix dbdma ring destruction memory debugcheck. 2010-02-01 20:30:25 +01:00
dma.c MIPS: Alchemy: rename directory 2008-10-11 16:18:50 +01:00
gpiolib-au1000.c MIPS: Alchemy: Rewrite GPIO support. 2009-06-17 11:06:28 +01:00
irq.c MIPS: Alchemy: Fix hang with high-frequency edge interrupts 2009-11-02 12:00:08 +01:00
Makefile MIPS: Alchemy: Rewrite GPIO support. 2009-06-17 11:06:28 +01:00
pci.c MIPS: Alchemy: rename directory 2008-10-11 16:18:50 +01:00
platform.c dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
power.c MIPS: Alchemy: new userspace suspend interface for development boards. 2009-01-11 09:57:27 +00:00
prom.c MIPS: Alchemy: rename directory 2008-10-11 16:18:50 +01:00
puts.c MIPS: Alchemy: rename directory 2008-10-11 16:18:50 +01:00
reset.c MIPS: Alchemy: devboards: Convert to gpio calls. 2009-06-17 11:06:29 +01:00
setup.c MIPS: Alchemy: override loops_per_jiffy detection 2009-09-17 20:07:51 +02:00
sleeper.S MIPS: Alchemy: Fix up PM code on Au1550/Au1200 2009-01-11 09:57:27 +00:00
time.c cpumask: remove dangerous CPU_MASK_ALL_PTR, &CPU_MASK_ALL.: mips 2009-09-24 09:34:36 +09:30