diff mbox

[RFC/PATCH] dmaengine: Unconditionally enable high-order unmap pools

Message ID 1386596071-24828-1-git-send-email-ezequiel.garcia@free-electrons.com (mailing list archive)
State Superseded
Delegated to: Dan Williams
Headers show

Commit Message

Ezequiel Garcia Dec. 9, 2013, 1:34 p.m. UTC
There's no reason for conditioning these pools to CONFIG_ASYNC_TX_DMA.
Moreover, the pools are required by dmaengine driver's self-tests and
dmatest module.

Without this commit you'll get this ugly exception when running dmatest
with !CONFIG_ASYNC_TX_DMA.

Unable to handle kernel paging request at virtual address 65747960
pgd = c0004000
[65747960] *pgd=00000000
Internal error: Oops: 80000005 [#4] SMP ARM
CPU: 0 PID: 1024 Comm: dma3chan0-xor0 Tainted: G      D      3.13.0-rc1-g85726de #19
task: dfb18c40 ti: df230000 task.ti: df230000
PC is at 0x65747960
LR is at mempool_alloc+0x44/0x11c
pc : [<65747960>]    lr : [<c006ce78>]    psr: 80000113
sp : df231e20  ip : df231e20  fp : df231f64
r10: 00000010  r9 : df230000  r8 : c00494b0
r7 : 000112d0  r6 : 00000e24  r5 : 00011280  r4 : c03da694
r3 : 65747962  r2 : 000110d0  r1 : 00000000  r0 : 00011280
Flags: Nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5387d  Table: 1f1fc019  DAC: 00000015
Process dma3chan0-xor0 (pid: 1024, stack limit = 0xdf230240)
Stack: (0xdf231e20 to 0xdf232000)
1e20: df231f64 c0011bc0 df1b2388 00001fce df23c000 00001efa 00004000 000000d0
1e40: df8f7410 00000e24 000011aa 00000e24 00002553 000011aa df231f64 c0172bc0
1e60: 00000e24 00000001 fffffff4 c01740fc c04673bc df240000 df231f64 c0173fe8
1e80: d19a0cd2 00000000 00000ad5 00000000 00000028 7030977c dfb18c40 dfb18c40
1ea0: 0000128b 00000001 60604c34 00000002 00000004 00000010 df231f20 00000000
1ec0: ffffffff c0adc340 df231e80 df231e88 00000000 00000000 df95c8b4 c04673bc
1ee0: c000962c 00000001 00000001 c0039adc 00000e24 00000003 00000000 00000000
1f00: df95c848 df1b7480 60604c34 00000002 c00437f0 b150ad6e 00000000 df231f20
1f20: 00000000 df231f24 df231f24 a0000113 c0173c04 c044f340 c044f340 c044f340
1f40: 00000000 00000000 df1b7340 df1b7480 c0173c04 00000000 00000000 00000000
1f60: 00000000 c0035a88 5eadfef9 00000000 5bce9bd2 df1b7480 00000000 00000000
1f80: df231f80 df231f80 00000000 00000000 df231f90 df231f90 df231fac df1b7340
1fa0: c00359c4 00000000 00000000 c000e398 00000000 00000000 00000000 00000000
1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
1fe0: 00000000 00000000 00000000 00000000 00000013 00000000 fedcffd9 fdfdfdb6
[<c006ce78>] (mempool_alloc+0x44/0x11c) from [<c0172bc0>] (dmaengine_get_unmap_data+0x20/0x44)
[<c0172bc0>] (dmaengine_get_unmap_data+0x20/0x44) from [<c01740fc>] (dmatest_func+0x4f8/0x1098)
[<c01740fc>] (dmatest_func+0x4f8/0x1098) from [<c0035a88>] (kthread+0xc4/0xe0)
[<c0035a88>] (kthread+0xc4/0xe0) from [<c000e398>] (ret_from_fork+0x14/0x3c)
Code: bad PC value
---[ end trace 63410b5ee737eb3b ]---

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
Altough it fixes a real issue, I'm sending this one as RFC given I'm not
entirely sure why the #if was added in the first place.

If the fix is correct, it should be pushed for v3.13, with the rest of the
dmaengine_unmap_data infrastructure.

 drivers/dma/dmaengine.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index ea806bd..c7a61a3 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -912,11 +912,9 @@  struct dmaengine_unmap_pool {
 #define __UNMAP_POOL(x) { .size = x, .name = "dmaengine-unmap-" __stringify(x) }
 static struct dmaengine_unmap_pool unmap_pool[] = {
 	__UNMAP_POOL(2),
-	#if IS_ENABLED(CONFIG_ASYNC_TX_DMA)
 	__UNMAP_POOL(16),
 	__UNMAP_POOL(128),
 	__UNMAP_POOL(256),
-	#endif
 };
 
 static struct dmaengine_unmap_pool *__get_unmap_pool(int nr)