]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Dec 2008 03:50:26 +0000 (19:50 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Dec 2008 03:50:26 +0000 (19:50 -0800)
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: fix default_spin_lock_flags() prototype
  AMD IOMMU: __unmap_single: check for bad_dma_address instead of 0
  AMD IOMMU: fix WARN_ON in dma_ops unmap path
  AMD IOMMU: fix typo in comment
  AMD IOMMU: fix loop counter in free_pagetable function
  AMD IOMMU: fix iommu_map_page function

arch/x86/kernel/amd_iommu.c
arch/x86/kernel/paravirt-spinlocks.c

index 5662e226b0c922c1d2622e9173687bd6285b3e52..a7b6dec6fc3f4afc72f57651b1523156d415431b 100644 (file)
@@ -344,7 +344,7 @@ static int iommu_map(struct protection_domain *dom,
        u64 __pte, *pte, *page;
 
        bus_addr  = PAGE_ALIGN(bus_addr);
-       phys_addr = PAGE_ALIGN(bus_addr);
+       phys_addr = PAGE_ALIGN(phys_addr);
 
        /* only support 512GB address spaces for now */
        if (bus_addr > IOMMU_MAP_SIZE_L3 || !(prot & IOMMU_PROT_MASK))
@@ -600,7 +600,7 @@ static void dma_ops_free_pagetable(struct dma_ops_domain *dma_dom)
                        continue;
 
                p2 = IOMMU_PTE_PAGE(p1[i]);
-               for (j = 0; j < 512; ++i) {
+               for (j = 0; j < 512; ++j) {
                        if (!IOMMU_PTE_PRESENT(p2[j]))
                                continue;
                        p3 = IOMMU_PTE_PAGE(p2[j]);
@@ -910,7 +910,7 @@ static void dma_ops_domain_unmap(struct amd_iommu *iommu,
        if (address >= dom->aperture_size)
                return;
 
-       WARN_ON(address & 0xfffULL || address > dom->aperture_size);
+       WARN_ON(address & ~PAGE_MASK || address >= dom->aperture_size);
 
        pte  = dom->pte_pages[IOMMU_PTE_L1_INDEX(address)];
        pte += IOMMU_PTE_L0_INDEX(address);
@@ -922,8 +922,8 @@ static void dma_ops_domain_unmap(struct amd_iommu *iommu,
 
 /*
  * This function contains common code for mapping of a physically
- * contiguous memory region into DMA address space. It is uses by all
- * mapping functions provided by this IOMMU driver.
+ * contiguous memory region into DMA address space. It is used by all
+ * mapping functions provided with this IOMMU driver.
  * Must be called with the domain lock held.
  */
 static dma_addr_t __map_single(struct device *dev,
@@ -983,7 +983,8 @@ static void __unmap_single(struct amd_iommu *iommu,
        dma_addr_t i, start;
        unsigned int pages;
 
-       if ((dma_addr == 0) || (dma_addr + size > dma_dom->aperture_size))
+       if ((dma_addr == bad_dma_address) ||
+           (dma_addr + size > dma_dom->aperture_size))
                return;
 
        pages = iommu_num_pages(dma_addr, size, PAGE_SIZE);
index 0e9f1982b1dd1aca8c60025f3ff691b311ee8390..95777b0faa7388f9c236bb093fae1a4934bb91c0 100644 (file)
@@ -7,7 +7,8 @@
 
 #include <asm/paravirt.h>
 
-static void default_spin_lock_flags(struct raw_spinlock *lock, unsigned long flags)
+static inline void
+default_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags)
 {
        __raw_spin_lock(lock);
 }