Re: [PATCH] powerpc: add kernel parameter iommu_alloc_quiet
From: Torsten Duwe <hidden>
Date: 2016-09-01 13:47:23
On Thu, Sep 01, 2016 at 09:56:42AM -0300, Mauricio Faria de Oliveira wrote:
This patch introduces the 'iommu_alloc_quiet=driver_name' parameter to suppress the 'iommu_alloc failures' messages for that one driver. This is an additional approach for this 'problem' of flooding logs, not as fine-grained and not enabled by default as DMA_ATTR_NO_WARN, but it has the advantage that it doesn't introduce any ABI changes. That is important/requirement for the distribution kernels - where the DMA_ATTR_NO_WARN changes to 'enum dma_attr' are not acceptable because it breaks the kernel ABI.
[...]
quoted hunk ↗ jump to hunk
@@ -479,8 +496,8 @@ int ppc_iommu_map_sg(struct device *dev, struct iommu_table *tbl, /* Handle failure */ if (unlikely(entry == DMA_ERROR_CODE)) { - if (!(attrs & DMA_ATTR_NO_WARN) && - printk_ratelimit()) + if (strncmp(iommu_alloc_quiet, dev->driver->name, IOMMU_ALLOC_QUIET_LEN) && + !(attrs & DMA_ATTR_NO_WARN) && printk_ratelimit()) dev_info(dev, "iommu_alloc failed, tbl %p " "vaddr %lx npages %lu\n", tbl, vaddr, npages);@@ -777,8 +794,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 (!(attrs & DMA_ATTR_NO_WARN) && - printk_ratelimit()) { + if (strncmp(iommu_alloc_quiet, dev->driver->name, IOMMU_ALLOC_QUIET_LEN) && + !(attrs & DMA_ATTR_NO_WARN) && printk_ratelimit()) { dev_info(dev, "iommu_alloc failed, tbl %p " "vaddr %p npages %d\n", tbl, vaddr, npages);
JFYI, my strongly preferred solution would still be to just dev_dbg() the whole thing. Which group of people would be interested in these messages, after all? Torsten