Merge branch 'iommu-fixes-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu into x86/urgent

This commit is contained in:
Ingo Molnar 2008-11-06 15:23:35 +01:00
Родитель d6f0f39b7d 80be308dfa
Коммит 31f297143b
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -50,7 +50,7 @@ static int dma_ops_unity_map(struct dma_ops_domain *dma_dom,
/* returns !0 if the IOMMU is caching non-present entries in its TLB */ /* returns !0 if the IOMMU is caching non-present entries in its TLB */
static int iommu_has_npcache(struct amd_iommu *iommu) static int iommu_has_npcache(struct amd_iommu *iommu)
{ {
return iommu->cap & IOMMU_CAP_NPCACHE; return iommu->cap & (1UL << IOMMU_CAP_NPCACHE);
} }
/**************************************************************************** /****************************************************************************
@ -536,6 +536,9 @@ static void dma_ops_free_addresses(struct dma_ops_domain *dom,
{ {
address >>= PAGE_SHIFT; address >>= PAGE_SHIFT;
iommu_area_free(dom->bitmap, address, pages); iommu_area_free(dom->bitmap, address, pages);
if (address + pages >= dom->next_bit)
dom->need_flush = true;
} }
/**************************************************************************** /****************************************************************************
@ -992,8 +995,10 @@ static void __unmap_single(struct amd_iommu *iommu,
dma_ops_free_addresses(dma_dom, dma_addr, pages); dma_ops_free_addresses(dma_dom, dma_addr, pages);
if (amd_iommu_unmap_flush) if (amd_iommu_unmap_flush || dma_dom->need_flush) {
iommu_flush_pages(iommu, dma_dom->domain.id, dma_addr, size); iommu_flush_pages(iommu, dma_dom->domain.id, dma_addr, size);
dma_dom->need_flush = false;
}
} }
/* /*