]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
powerpc: implement the DMA_ATTR_NO_WARN attribute
authorMauricio Faria de Oliveira <mauricfo at linux.vnet.ibm.com>
Wed, 30 Nov 2016 11:14:44 +0000 (09:14 -0200)
committerBrad Figg <brad.figg@canonical.com>
Thu, 8 Dec 2016 18:58:11 +0000 (10:58 -0800)
BugLink: http://bugs.launchpad.net/bugs/1633128
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 <mauricfo at
linux.vnet.ibm.com>
Acked-by: Michael Ellerman <mpe at ellerman.id.au>
Cc: Keith Busch <keith.busch at intel.com>
Cc: Jens Axboe <axboe at fb.com>
Cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>
Cc: Krzysztof Kozlowski <k.kozlowski at samsung.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
(back ported from commit af8a24988e48f9ed20acf4d5230ac216d5baf723)
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
arch/powerpc/kernel/iommu.c

index a8e3490b54e3b828e7821ab3152d03192cef150d..f1e20ea33bd68ab9c38b78c0c2ab35c6fba94365 100644 (file)
@@ -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 (unlikely(!dma_get_attr(DMA_ATTR_NO_WARN, attrs)) &&
+                           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 (unlikely(!dma_get_attr(DMA_ATTR_NO_WARN, attrs)) &&
+                           printk_ratelimit())  {
                                dev_info(dev, "iommu_alloc failed, tbl %p "
                                         "vaddr %p npages %d\n", tbl, vaddr,
                                         npages);