direct-io.hg
changeset 6073:e87001315978
dma_map_single can't sleep since it may be called with locks held, or
interrupts off, etc. Thus it shouldn't make sleeping allocations.
Signed-off-by: Chris Wright <chrisw@osdl.org>
interrupts off, etc. Thus it shouldn't make sleeping allocations.
Signed-off-by: Chris Wright <chrisw@osdl.org>
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Wed Aug 10 09:50:05 2005 +0000 (2005-08-10) |
parents | 878ba6d3954e |
children | d74e320900fd |
files | linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c |
line diff
1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c Wed Aug 10 09:45:06 2005 +0000 1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c Wed Aug 10 09:50:05 2005 +0000 1.3 @@ -182,8 +182,8 @@ dma_map_single(struct device *dev, void 1.4 if ((((unsigned int)ptr & ~PAGE_MASK) + size) <= PAGE_SIZE) { 1.5 dma = virt_to_bus(ptr); 1.6 } else { 1.7 - BUG_ON((bnc = dma_alloc_coherent(dev, size, &dma, 0)) == NULL); 1.8 - BUG_ON((ent = kmalloc(sizeof(*ent), GFP_KERNEL)) == NULL); 1.9 + BUG_ON((bnc = dma_alloc_coherent(dev, size, &dma, GFP_ATOMIC)) == NULL); 1.10 + BUG_ON((ent = kmalloc(sizeof(*ent), GFP_ATOMIC)) == NULL); 1.11 if (direction != DMA_FROM_DEVICE) 1.12 memcpy(bnc, ptr, size); 1.13 ent->dma = dma;
2.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c Wed Aug 10 09:45:06 2005 +0000 2.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c Wed Aug 10 09:50:05 2005 +0000 2.3 @@ -234,8 +234,8 @@ dma_map_single(struct device *dev, void 2.4 if (((((unsigned long)ptr) & ~PAGE_MASK) + size) <= PAGE_SIZE) { 2.5 dma = virt_to_bus(ptr); 2.6 } else { 2.7 - BUG_ON((bnc = dma_alloc_coherent(dev, size, &dma, 0)) == NULL); 2.8 - BUG_ON((ent = kmalloc(sizeof(*ent), GFP_KERNEL)) == NULL); 2.9 + BUG_ON((bnc = dma_alloc_coherent(dev, size, &dma, GFP_ATOMIC)) == NULL); 2.10 + BUG_ON((ent = kmalloc(sizeof(*ent), GFP_ATOMIC)) == NULL); 2.11 if (direction != DMA_FROM_DEVICE) 2.12 memcpy(bnc, ptr, size); 2.13 ent->dma = dma;