lkml.org 
[lkml]   [2007]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] quiet down swiotlb warnings
It turns out that the qla2xxx driver sometimes fills up the iotlb
on purpose and throttles itself when pci_map_sg() fails. In the
case of a driver that expects and handles pci_map_sg() failures,
we should not spam the user's console with swiotlb full messages.

If the user runs a driver that cannot handle the swiotlb filling
up, 5 warnings should be enough to leave a clue.

Signed-off-by: Rik van Riel <riel@redhat.com>
--- linux-2.6.21.noarch/lib/swiotlb.c.quiet 2007-06-01 13:23:04.000000000 -0400
+++ linux-2.6.21.noarch/lib/swiotlb.c 2007-06-01 13:25:49.000000000 -0400
@@ -505,6 +505,7 @@ swiotlb_free_coherent(struct device *hwd
static void
swiotlb_full(struct device *dev, size_t size, int dir, int do_panic)
{
+ static int warnings = 0;
/*
* Ran out of IOMMU space for this operation. This is very bad.
* Unfortunately the drivers cannot handle this operation properly.
@@ -512,8 +513,9 @@ swiotlb_full(struct device *dev, size_t
* 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->bus_id : "?");
+ if (++warnings < 5)
+ printk(KERN_ERR "DMA: Out of SW-IOMMU space for %zu bytes at "
+ "device %s\n", size, dev ? dev->bus_id : "?");

if (size > io_tlb_overflow && do_panic) {
if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL)
\
 
 \ /
  Last update: 2007-06-01 19:33    [W:0.084 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site