public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: andrew.vasquez@qlogic.com
Subject: [PATCH] quiet down swiotlb warnings
Date: Fri, 01 Jun 2007 13:30:25 -0400	[thread overview]
Message-ID: <466057B1.9090309@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 424 bytes --]

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>

[-- Attachment #2: 2.6.21-swiotlb-quiet.patch --]
[-- Type: text/x-patch, Size: 1033 bytes --]

--- 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)

             reply	other threads:[~2007-06-01 17:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-01 17:30 Rik van Riel [this message]
2007-06-01 19:01 ` [PATCH] quiet down swiotlb warnings Andi Kleen
2007-06-01 18:12   ` Christoph Hellwig
2007-06-01 18:18     ` Rik van Riel
2007-06-01 19:37     ` Andi Kleen
2007-06-01 19:38       ` Rik van Riel
2007-06-01 19:47         ` Andi Kleen
2007-06-01 20:00           ` Andrew Vasquez
2007-06-01 20:14             ` Andi Kleen
2007-06-01 20:20               ` Rik van Riel
2007-06-01 20:26                 ` Andi Kleen
2007-06-02 15:21                   ` Muli Ben-Yehuda
2007-06-02 16:47                     ` Andi Kleen
2007-06-01 19:57       ` Christoph Hellwig
2007-06-01 18:16   ` Andrew Vasquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=466057B1.9090309@redhat.com \
    --to=riel@redhat.com \
    --cc=andrew.vasquez@qlogic.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox