Re: [PATCH 1/2] swiotlb: Rate-limit printing when running out of SW-IOMMU space

2016-11-05 Thread Konrad Rzeszutek Wilk
On Mon, Oct 31, 2016 at 04:45:03PM +0100, Geert Uytterhoeven wrote:
> If the system runs out of SW-IOMMU space, changes are high successive
> requests will fail, too, flooding the kernel log.  This is true
> especially for streaming DMA, which is typically used repeatedly outside
> the driver's initialization routine.  Add rate-limiting to fix this.
> 
> While at it, get rid of the open-coded dev_name() handling by using the
> appropriate dev_err_*() variant.
> 
> Signed-off-by: Geert Uytterhoeven 

applied.
> ---
>  lib/swiotlb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/swiotlb.c b/lib/swiotlb.c
> index 22e13a0e19d76a2b..6ce764410ae475cc 100644
> --- a/lib/swiotlb.c
> +++ b/lib/swiotlb.c
> @@ -714,8 +714,8 @@ void swiotlb_tbl_sync_single(struct device *hwdev, 
> phys_addr_t tlb_addr,
>* When the mapping is small enough return a static buffer to limit
>* the damage, or panic when the transfer is too big.
>*/
> - printk(KERN_ERR "DMA: Out of SW-IOMMU space for %zu bytes at "
> -"device %s\n", size, dev ? dev_name(dev) : "?");
> + dev_err_ratelimited(dev, "DMA: Out of SW-IOMMU space for %zu bytes\n",
> + size);
>  
>   if (size <= io_tlb_overflow || !do_panic)
>   return;
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] swiotlb: Rate-limit printing when running out of SW-IOMMU space

2016-10-31 Thread Sergei Shtylyov

On 10/31/2016 06:45 PM, Geert Uytterhoeven wrote:


If the system runs out of SW-IOMMU space, changes are high successive


   s/changes/chances/?


requests will fail, too, flooding the kernel log.  This is true
especially for streaming DMA, which is typically used repeatedly outside
the driver's initialization routine.  Add rate-limiting to fix this.

While at it, get rid of the open-coded dev_name() handling by using the
appropriate dev_err_*() variant.

Signed-off-by: Geert Uytterhoeven 

[...]

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] swiotlb: Rate-limit printing when running out of SW-IOMMU space

2016-10-31 Thread Geert Uytterhoeven
If the system runs out of SW-IOMMU space, changes are high successive
requests will fail, too, flooding the kernel log.  This is true
especially for streaming DMA, which is typically used repeatedly outside
the driver's initialization routine.  Add rate-limiting to fix this.

While at it, get rid of the open-coded dev_name() handling by using the
appropriate dev_err_*() variant.

Signed-off-by: Geert Uytterhoeven 
---
 lib/swiotlb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 22e13a0e19d76a2b..6ce764410ae475cc 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -714,8 +714,8 @@ void swiotlb_tbl_sync_single(struct device *hwdev, 
phys_addr_t tlb_addr,
 * When the mapping is small enough return a static buffer to limit
 * the damage, or panic when the transfer is too big.
 */
-   printk(KERN_ERR "DMA: Out of SW-IOMMU space for %zu bytes at "
-  "device %s\n", size, dev ? dev_name(dev) : "?");
+   dev_err_ratelimited(dev, "DMA: Out of SW-IOMMU space for %zu bytes\n",
+   size);
 
if (size <= io_tlb_overflow || !do_panic)
return;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html