[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] dma_map_single can't sleep since it may be called with locks held, or



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 03594514c5759a367efa054ed9a47c103cb069fd
# Parent  9d79647165b1c481e660795ad660ddc8284ca8fe
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@xxxxxxxx>

diff -r 9d79647165b1 -r 03594514c575 
linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c
--- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c       Wed Aug 10 
00:31:07 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c       Wed Aug 10 
12:59:10 2005
@@ -261,8 +261,8 @@
        if ((((unsigned int)ptr & ~PAGE_MASK) + size) <= PAGE_SIZE) {
                dma = virt_to_bus(ptr);
        } else {
-               BUG_ON((bnc = dma_alloc_coherent(dev, size, &dma, 0)) == NULL);
-               BUG_ON((ent = kmalloc(sizeof(*ent), GFP_KERNEL)) == NULL);
+               BUG_ON((bnc = dma_alloc_coherent(dev, size, &dma, GFP_ATOMIC)) 
== NULL);
+               BUG_ON((ent = kmalloc(sizeof(*ent), GFP_ATOMIC)) == NULL);
                if (direction != DMA_FROM_DEVICE)
                        memcpy(bnc, ptr, size);
                ent->dma    = dma;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.