WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] dma_map_single can't sleep since it may be called with l

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] dma_map_single can't sleep since it may be called with locks held, or
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 10 Aug 2005 05:50:12 -0400
Delivery-date: Wed, 10 Aug 2005 09:50:47 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID e8700131597849db2fc37321356b11e689a1717d
# Parent  878ba6d3954ee783549c2014c997116ff1e1194f
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 878ba6d3954e -r e87001315978 
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 
09:45:06 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c       Wed Aug 10 
09:50:05 2005
@@ -182,8 +182,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;
diff -r 878ba6d3954e -r e87001315978 
linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c
--- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c     Wed Aug 10 
09:45:06 2005
+++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c     Wed Aug 10 
09:50:05 2005
@@ -234,8 +234,8 @@
        if (((((unsigned long)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

<Prev in Thread] Current Thread [Next in Thread>