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] [xen-unstable] [IA64] Fix bug in xen_alloc_coherent()

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] Fix bug in xen_alloc_coherent()
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 16 Jun 2007 05:49:08 -0700
Delivery-date: Sat, 16 Jun 2007 05:47:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 Alex Williamson <alex.williamson@xxxxxx>
# Date 1181582491 21600
# Node ID 8655f7b7d50cd351be4525080223421f835b5bb9
# Parent  f63349a4051d13cc40b576cdd2f3f5deaebe1c18
[IA64] Fix bug in xen_alloc_coherent()

xen_create_contiguous_region() needs an order, not a mask.  Also change
s/hwdev/dev/ for consistency.

Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---
 linux-2.6-xen-sparse/arch/ia64/xen/xen_dma.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff -r f63349a4051d -r 8655f7b7d50c 
linux-2.6-xen-sparse/arch/ia64/xen/xen_dma.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/xen_dma.c      Mon Jun 11 11:17:33 
2007 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/xen_dma.c      Mon Jun 11 11:21:31 
2007 -0600
@@ -22,6 +22,7 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
+#include <linux/bitops.h>
 #include <linux/dma-mapping.h>
 #include <linux/mm.h>
 #include <asm/scatterlist.h>
@@ -40,18 +41,18 @@ do {                                                        
        \
  * when merged with upstream Linux.
  */
 static inline int
-address_needs_mapping(struct device *hwdev, dma_addr_t addr)
+address_needs_mapping(struct device *dev, dma_addr_t addr)
 {
        dma_addr_t mask = 0xffffffff;
 
        /* If the device has a mask, use it, otherwise default to 32 bits */
-       if (hwdev && hwdev->dma_mask)
-               mask = *hwdev->dma_mask;
+       if (dev && dev->dma_mask)
+               mask = *dev->dma_mask;
        return (addr & ~mask) != 0;
 }
 
 int
-xen_map_sg(struct device *hwdev, struct scatterlist *sg, int nents,
+xen_map_sg(struct device *dev, struct scatterlist *sg, int nents,
           int direction)
 {
        int i;
@@ -60,7 +61,7 @@ xen_map_sg(struct device *hwdev, struct 
                sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset;
                sg[i].dma_length  = sg[i].length;
 
-               IOMMU_BUG_ON(address_needs_mapping(hwdev, sg[i].dma_address));
+               IOMMU_BUG_ON(address_needs_mapping(dev, sg[i].dma_address));
        }
 
        return nents;
@@ -68,7 +69,7 @@ EXPORT_SYMBOL(xen_map_sg);
 EXPORT_SYMBOL(xen_map_sg);
 
 void
-xen_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
+xen_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
             int direction)
 {
 }
@@ -101,7 +102,7 @@ xen_alloc_coherent(struct device *dev, s
                return NULL;
 
        if (xen_create_contiguous_region(vaddr, order,
-                                        dev->coherent_dma_mask)) {
+                                        fls64(dev->coherent_dma_mask))) {
                free_pages(vaddr, order);
                return NULL;
        }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64] Fix bug in xen_alloc_coherent(), Xen patchbot-unstable <=