Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4dfa9c47 authored by Anton Blanchard's avatar Anton Blanchard Committed by Benjamin Herrenschmidt
Browse files

powerpc: iommu: Add device name to iommu error printks



Right now its difficult to see which device is running out of iommu space:

iommu_alloc failed, tbl c00000076e096660 vaddr c000000768806600 npages 1

Use dev_info() so we get the device name and location:

ipr 0000:00:01.0: iommu_alloc failed, tbl c00000076e096660 vaddr c000000768806600 npages 1

Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 7a9d1256
Loading
Loading
Loading
Loading
+8 −6
Original line number Original line Diff line number Diff line
@@ -311,8 +311,9 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
		/* Handle failure */
		/* Handle failure */
		if (unlikely(entry == DMA_ERROR_CODE)) {
		if (unlikely(entry == DMA_ERROR_CODE)) {
			if (printk_ratelimit())
			if (printk_ratelimit())
				printk(KERN_INFO "iommu_alloc failed, tbl %p vaddr %lx"
				dev_info(dev, "iommu_alloc failed, tbl %p "
				       " npages %lx\n", tbl, vaddr, npages);
					 "vaddr %lx npages %lu\n", tbl, vaddr,
					 npages);
			goto failure;
			goto failure;
		}
		}


@@ -579,9 +580,9 @@ dma_addr_t iommu_map_page(struct device *dev, struct iommu_table *tbl,
					 attrs);
					 attrs);
		if (dma_handle == DMA_ERROR_CODE) {
		if (dma_handle == DMA_ERROR_CODE) {
			if (printk_ratelimit())  {
			if (printk_ratelimit())  {
				printk(KERN_INFO "iommu_alloc failed, "
				dev_info(dev, "iommu_alloc failed, tbl %p "
						"tbl %p vaddr %p npages %d\n",
					 "vaddr %p npages %d\n", tbl, vaddr,
						tbl, vaddr, npages);
					 npages);
			}
			}
		} else
		} else
			dma_handle |= (uaddr & ~IOMMU_PAGE_MASK);
			dma_handle |= (uaddr & ~IOMMU_PAGE_MASK);
@@ -627,7 +628,8 @@ void *iommu_alloc_coherent(struct device *dev, struct iommu_table *tbl,
	 * the tce tables.
	 * the tce tables.
	 */
	 */
	if (order >= IOMAP_MAX_ORDER) {
	if (order >= IOMAP_MAX_ORDER) {
		printk("iommu_alloc_consistent size too large: 0x%lx\n", size);
		dev_info(dev, "iommu_alloc_consistent size too large: 0x%lx\n",
			 size);
		return NULL;
		return NULL;
	}
	}