aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/pci-calgary_64.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index af9f436096a2..849a0995d970 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -261,12 +261,15 @@ static dma_addr_t iommu_alloc(struct device *dev, struct iommu_table *tbl,
261 void *vaddr, unsigned int npages, int direction) 261 void *vaddr, unsigned int npages, int direction)
262{ 262{
263 unsigned long entry; 263 unsigned long entry;
264 dma_addr_t ret = DMA_ERROR_CODE; 264 dma_addr_t ret;
265 265
266 entry = iommu_range_alloc(dev, tbl, npages); 266 entry = iommu_range_alloc(dev, tbl, npages);
267 267
268 if (unlikely(entry == DMA_ERROR_CODE)) 268 if (unlikely(entry == DMA_ERROR_CODE)) {
269 goto error; 269 printk(KERN_WARNING "Calgary: failed to allocate %u pages in "
270 "iommu %p\n", npages, tbl);
271 return DMA_ERROR_CODE;
272 }
270 273
271 /* set the return dma address */ 274 /* set the return dma address */
272 ret = (entry << PAGE_SHIFT) | ((unsigned long)vaddr & ~PAGE_MASK); 275 ret = (entry << PAGE_SHIFT) | ((unsigned long)vaddr & ~PAGE_MASK);
@@ -274,13 +277,7 @@ static dma_addr_t iommu_alloc(struct device *dev, struct iommu_table *tbl,
274 /* put the TCEs in the HW table */ 277 /* put the TCEs in the HW table */
275 tce_build(tbl, entry, npages, (unsigned long)vaddr & PAGE_MASK, 278 tce_build(tbl, entry, npages, (unsigned long)vaddr & PAGE_MASK,
276 direction); 279 direction);
277
278 return ret; 280 return ret;
279
280error:
281 printk(KERN_WARNING "Calgary: failed to allocate %u pages in "
282 "iommu %p\n", npages, tbl);
283 return DMA_ERROR_CODE;
284} 281}
285 282
286static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, 283static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,