From: Mauricio Faria de Oliveira Date: Sat, 10 Sep 2016 10:34:30 +0000 (+1000) Subject: powerpc: implement the DMA_ATTR_NO_WARN attribute X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=80dcc7a2aaeb9dcab37c8596aa15a18db70f938e;p=deliverable%2Flinux.git powerpc: implement the DMA_ATTR_NO_WARN attribute Add support for the DMA_ATTR_NO_WARN attribute on powerpc iommu code. Link: http://lkml.kernel.org/r/1470092390-25451-3-git-send-email-mauricfo@linux.vnet.ibm.com Signed-off-by: Mauricio Faria de Oliveira Acked-by: Michael Ellerman Cc: Keith Busch Cc: Jens Axboe Cc: Benjamin Herrenschmidt Cc: Krzysztof Kozlowski Signed-off-by: Andrew Morton --- diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index 37d6e741be82..5f202a566ec5 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c @@ -479,7 +479,8 @@ int ppc_iommu_map_sg(struct device *dev, struct iommu_table *tbl, /* Handle failure */ if (unlikely(entry == DMA_ERROR_CODE)) { - if (printk_ratelimit()) + if (!(attrs & DMA_ATTR_NO_WARN) && + printk_ratelimit()) dev_info(dev, "iommu_alloc failed, tbl %p " "vaddr %lx npages %lu\n", tbl, vaddr, npages); @@ -776,7 +777,8 @@ dma_addr_t iommu_map_page(struct device *dev, struct iommu_table *tbl, mask >> tbl->it_page_shift, align, attrs); if (dma_handle == DMA_ERROR_CODE) { - if (printk_ratelimit()) { + if (!(attrs & DMA_ATTR_NO_WARN) && + printk_ratelimit()) { dev_info(dev, "iommu_alloc failed, tbl %p " "vaddr %p npages %d\n", tbl, vaddr, npages);