From: Fernando Guzman Lugo <x0095840@xxxxxx> Date: Wed, 21 Jan 2009 17:39:38 -0600 Subject: [PATCH] BRIDGE: Change GFP_ATOMIC to GFP_KERNEL This patch replace the memory allocations which use GFP_ATOMIC with GFP_KERNEL since the calls for memory allocation in dspbridge are not in interrupt context. Signed-off-by: Fernando Guzman Lugo <x0095840@xxxxxx> Acked-by: Hiroshi DOYU <Hiroshi.DOYU@xxxxxxxxx> --- drivers/dsp/bridge/services/mem.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/dsp/bridge/services/mem.c b/drivers/dsp/bridge/services/mem.c index 9256744..95efe92 --- a/drivers/dsp/bridge/services/mem.c +++ b/drivers/dsp/bridge/services/mem.c @@ -281,10 +281,10 @@ void *MEM_Alloc(u32 cBytes, enum MEM_POOLATTRS type) /* If non-paged memory required, see note at top of file. */ case MEM_PAGED: #ifndef MEM_CHECK - pMem = kmalloc(cBytes, GFP_ATOMIC); + pMem = kmalloc(cBytes, GFP_KERNEL); #else pMem = kmalloc(cBytes + sizeof(struct memInfo), - GFP_ATOMIC); + GFP_KERNEL); if (pMem) { pMem->size = cBytes; pMem->caller = __builtin_return_address(0); @@ -303,11 +303,11 @@ void *MEM_Alloc(u32 cBytes, enum MEM_POOLATTRS type) case MEM_LARGEVIRTMEM: #ifndef MEM_CHECK /* FIXME - Replace with 'vmalloc' after BP fix */ - pMem = __vmalloc(cBytes, GFP_ATOMIC, PAGE_KERNEL); + pMem = __vmalloc(cBytes, GFP_KERNEL, PAGE_KERNEL); #else /* FIXME - Replace with 'vmalloc' after BP fix */ pMem = __vmalloc((cBytes + sizeof(struct memInfo)), - GFP_ATOMIC, PAGE_KERNEL); + GFP_KERNEL, PAGE_KERNEL); if (pMem) { pMem->size = cBytes; pMem->caller = __builtin_return_address(0); @@ -357,7 +357,7 @@ void *MEM_AllocPhysMem(u32 cBytes, u32 ulAlign, OUT u32 *pPhysicalAddress) (u32 *)&paMem); } else pVaMem = dma_alloc_coherent(NULL, cBytes, &paMem, - GFP_ATOMIC); + GFP_KERNEL); if (pVaMem == NULL) { *pPhysicalAddress = 0; GT_1trace(MEM_debugMask, GT_6CLASS, @@ -389,13 +389,13 @@ void *MEM_Calloc(u32 cBytes, enum MEM_POOLATTRS type) /* If non-paged memory required, see note at top of file. */ case MEM_PAGED: #ifndef MEM_CHECK - pMem = kmalloc(cBytes, GFP_ATOMIC); + pMem = kmalloc(cBytes, GFP_KERNEL); if (pMem) memset(pMem, 0, cBytes); #else pMem = kmalloc(cBytes + sizeof(struct memInfo), - GFP_ATOMIC); + GFP_KERNEL); if (pMem) { memset((void *)((u32)pMem + sizeof(struct memInfo)), 0, cBytes); @@ -414,14 +414,14 @@ void *MEM_Calloc(u32 cBytes, enum MEM_POOLATTRS type) case MEM_LARGEVIRTMEM: #ifndef MEM_CHECK /* FIXME - Replace with 'vmalloc' after BP fix */ - pMem = __vmalloc(cBytes, GFP_ATOMIC, PAGE_KERNEL); + pMem = __vmalloc(cBytes, GFP_KERNEL, PAGE_KERNEL); if (pMem) memset(pMem, 0, cBytes); #else /* FIXME - Replace with 'vmalloc' after BP fix */ pMem = __vmalloc(cBytes + sizeof(struct memInfo), - GFP_ATOMIC, PAGE_KERNEL); + GFP_KERNEL, PAGE_KERNEL); if (pMem) { memset((void *)((u32)pMem + sizeof(struct memInfo)), 0, cBytes); -- 1.5.6.4
Attachment:
0001-BRIDGE-Change-GFP_ATOMIC-to-GFP_KERNEL.patch
Description: 0001-BRIDGE-Change-GFP_ATOMIC-to-GFP_KERNEL.patch