All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: Michael Breuer <mbreuer@majjas.com>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>,
	David Miller <davem@davemloft.net>,
	akpm@linux-foundation.org, flyboy@gmail.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Michael Chan <mchan@broadcom.com>, Don Fry <pcnet32@verizon.net>,
	Francois Romieu <romieu@fr.zoreil.com>,
	Matt Carlson <mcarlson@broadcom.com>
Subject: Re: [PATCH] sky2:  receive dma mapping error handling
Date: Sun, 31 Jan 2010 01:34:49 +0100	[thread overview]
Message-ID: <20100131003449.GA11935@del.dom.local> (raw)
In-Reply-To: <4B645EF4.4050701@majjas.com>

On Sat, Jan 30, 2010 at 11:31:48AM -0500, Michael Breuer wrote:
> On 01/28/2010 06:36 PM, Stephen Hemminger wrote:
> >Please try this patch (and only this patch), on 2.6.33-rc5[*];
> >none of the other patches that did not make it upstream because that
> >confuses things too much.
> >
> >The code that checks for DMA mapping errors on receive buffers would
> >not handle errors correctly.  I doubt you have these errors, but if you
> >did then it would explain the problems.  The code has to be a little
> >tricky and build mapping for new rx buffer before releasing old one,
> >that way if new mapping fails, the old one can be reused.
> >
> >If it works for you, I will resubmit with signed-off.
> >
> >-
> >
> Nope - tx crash again. This time the system stayed up (but hosed)
> for a few hours. When I tried to recover eth0 the system then
> crashed.
> 
> Brief summary of events (log extract below):
> 
> System start Jan 28 19:29
> Everything seemed good (load and all) until 17:13:11 the following
> day when I got rx errors:
> 
> Jan 29 17:13:11 mail kernel: sky2 eth0: rx error, status 0x6230010
> length 1518
> Jan 29 17:13:11 mail kernel: sky2 eth0: rx error, status 0x7f40010
> length 1518

These are length errors, but status shows more than 1518, e.g. 2036
here, unless I miss something. Please, don't use jumbo frames in your
network until we fully debug it for regular frames (Stephen admitted
sky2 jumbo might be broken).

...
> As I started looking at logs, the system hung and rebooted. I'm up
> now with dma debug enabled, however as with 2.6.32.4 num_entries is
> dropping and I don't think that dma debug will remain enabled long
> enough to catch a crash.

Could you try the patch below to show maybe some other users of
dma-debug entries?

Jarek P.
---

 lib/dma-debug.c |   52 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 51 insertions(+), 1 deletions(-)

diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 7d2f0b3..e2dcc9c 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -310,6 +310,53 @@ static void hash_bucket_del(struct dma_debug_entry *entry)
 	list_del(&entry->list);
 }
 
+struct dma_debug_dev {
+	struct device *dev;
+	unsigned int cnt;
+};
+
+#define DMA_DEBUG_DEVS 100
+static struct dma_debug_dev dma_debug_devs[DMA_DEBUG_DEVS];
+
+static void debug_dma_dump_devs(void)
+{
+	int idx, i;
+
+	memset(dma_debug_devs, 0, sizeof(struct dma_debug_dev) * DMA_DEBUG_DEVS);
+
+	for (idx = 0; idx < HASH_SIZE; idx++) {
+		struct hash_bucket *bucket = &dma_entry_hash[idx];
+		struct dma_debug_entry *entry;
+		unsigned long flags;
+
+		spin_lock_irqsave(&bucket->lock, flags);
+
+		list_for_each_entry(entry, &bucket->list, list) {
+			for (i = 0; i < DMA_DEBUG_DEVS; i++) {
+				struct device *dev = dma_debug_devs[i].dev;
+
+				if (!dev || dev == entry->dev) {
+					dma_debug_devs[i].dev = entry->dev;
+					dma_debug_devs[i].cnt++;
+					break;
+				}
+			}
+		}
+
+		spin_unlock_irqrestore(&bucket->lock, flags);
+	}
+
+	for (i = 0; i < DMA_DEBUG_DEVS; i++) {
+		struct device *dev = dma_debug_devs[i].dev;
+
+		if (!dev)
+			break;
+
+		pr_info("DMA-API: %s: entries: %d\n", dev_name(dev),
+			dma_debug_devs[i].cnt);
+	}
+}
+
 /*
  * Dump mapping entries for debugging purposes
  */
@@ -363,8 +410,11 @@ static struct dma_debug_entry *__dma_entry_alloc(void)
 	memset(entry, 0, sizeof(*entry));
 
 	num_free_entries -= 1;
-	if (num_free_entries < min_free_entries)
+	if (num_free_entries < min_free_entries) {
 		min_free_entries = num_free_entries;
+		if ((min_free_entries & 0xffff) == 0)
+			debug_dma_dump_devs();
+	}
 
 	return entry;
 }

  reply	other threads:[~2010-01-31  0:34 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20  9:41 [PATCH] sky2: Fix WARNING: at lib/dma-debug.c:902 check_sync Jarek Poplawski
2010-01-20 18:03 ` Stephen Hemminger
2010-01-20 20:11   ` Michael Chan
2010-01-20 20:30     ` Stephen Hemminger
2010-01-20 20:58       ` Jarek Poplawski
2010-01-20 22:50         ` David Miller
2010-01-20 22:45       ` David Miller
2010-01-20 18:09 ` Stephen Hemminger
2010-01-20 22:24 ` Alan Cox
2010-01-20 22:53   ` David Miller
2010-01-20 22:53   ` Jarek Poplawski
2010-01-21 15:22     ` FUJITA Tomonori
2010-01-21 18:41       ` Jarek Poplawski
2010-01-22  5:11         ` FUJITA Tomonori
2010-01-22  6:38           ` David Miller
2010-02-03  1:18             ` FUJITA Tomonori
2010-02-03  1:27               ` David Miller
2010-01-21 19:59 ` Michael Breuer
2010-01-21 20:41   ` Jarek Poplawski
2010-01-21 20:46     ` Michael Breuer
2010-01-21 21:02       ` Jarek Poplawski
2010-01-22 18:01     ` Hang: 2.6.32.4 sky2/DMAR (was [PATCH] sky2: Fix WARNING: at lib/dma-debug.c:902 check_sync) Michael Breuer
2010-01-22 21:53       ` Jarek Poplawski
2010-01-22 22:14         ` Michael Breuer
2010-01-22 23:06           ` Jarek Poplawski
2010-01-22 23:25             ` Michael Breuer
2010-01-22 23:46               ` Jarek Poplawski
2010-01-22 23:50                 ` Michael Breuer
2010-01-23 23:21                   ` Jarek Poplawski
2010-01-24  1:53                     ` Michael Breuer
2010-01-27 15:34                     ` Michael Breuer
2010-01-27 16:50                       ` Stephen Hemminger
2010-01-27 16:57                         ` Michael Breuer
2010-01-27 17:45                           ` Stephen Hemminger
2010-01-27 17:57                             ` Michael Breuer
2010-01-27 18:33                               ` Michael Breuer
2010-01-27 23:54                             ` Hang: 2.6.32.4 sky2/DMAR David Miller
2010-01-27 17:56                           ` Hang: 2.6.32.4 sky2/DMAR (was [PATCH] sky2: Fix WARNING: at lib/dma-debug.c:902 check_sync) Stephen Hemminger
2010-01-27 17:58                             ` Michael Breuer
2010-01-27 18:08                             ` Michael Breuer
2010-01-27 18:45                               ` Michael Breuer
2010-01-27 19:23                                 ` Jarek Poplawski
2010-01-27 19:32                                   ` Jarek Poplawski
2010-01-28 15:32                                 ` Michael Breuer
2010-01-28 16:43                                   ` Michael Breuer
2010-01-28 17:08                                     ` Stephen Hemminger
2010-01-28 18:46                                       ` Michael Breuer
2010-01-28 22:34                                         ` Jarek Poplawski
2010-01-28 22:43                                           ` Michael Breuer
2010-01-28 22:56                                             ` Jarek Poplawski
2010-01-28 22:59                                               ` Michael Breuer
2010-01-28 23:36                                                 ` [PATCH] sky2: receive dma mapping error handling Stephen Hemminger
2010-01-29  0:05                                                   ` Michael Breuer
2010-01-30 16:30                                                   ` Michael Breuer
2010-01-30 16:31                                                   ` Michael Breuer
2010-01-31  0:34                                                     ` Jarek Poplawski [this message]
2010-01-31  4:17                                                       ` Michael Breuer
2010-01-31 22:25                                                         ` Jarek Poplawski
2010-01-31 23:58                                                           ` Michael Breuer
2010-01-31  4:55                                                       ` Michael Breuer
2010-01-31 18:50                                                         ` Michael Breuer
2010-01-31 21:58                                                           ` Michael Breuer
2010-01-31 22:18                                                             ` Jarek Poplawski
2010-02-01  0:19                                                               ` Michael Breuer
2010-02-01  4:26                                                                 ` Michael Breuer
2010-02-01 10:47                                                                   ` Jarek Poplawski
2010-02-01  9:17                                                                 ` [PATCH v2] sky2: Fix transmit dma mapping handling Jarek Poplawski
2010-02-01 17:52                                                                   ` Michael Breuer
2010-02-01 18:08                                                               ` [PATCH] sky2: receive dma mapping error handling Stephen Hemminger
2010-02-01 18:20                                                               ` Stephen Hemminger
2010-02-01 18:44                                                                 ` Michael Breuer
2010-02-01 20:13                                                                 ` Jarek Poplawski
2010-02-01 20:41                                                                   ` Jarek Poplawski
2010-02-01 21:27                                                                 ` [PATCH v3] " Jarek Poplawski
2010-02-01 22:29                                                                   ` Stephen Hemminger
2010-02-01 22:46                                                                     ` Jarek Poplawski
2010-02-01 22:51                                                                       ` Stephen Hemminger
2010-02-01 21:42                                                                 ` [PATCH v3b resent] sky2: Fix transmit dma mapping handling Jarek Poplawski
2010-02-03  4:07                                                                 ` [PATCH] sky2: receive dma mapping error handling Michael Breuer
2010-02-03 16:47                                                                   ` Michael Breuer
2010-02-03 16:56                                                                     ` Stephen Hemminger
2010-02-03 17:07                                                                       ` Michael Breuer
2010-02-03 18:23                                                                         ` Justin P. Mattock
2010-02-03 18:25                                                                           ` Stephen Hemminger
2010-02-03 18:48                                                                             ` Justin P. Mattock
2010-11-06 16:57                                                                         ` Sky2 2.6.36-09934-g2aab243 DMAR error with tcp timestamp enabled Michael Breuer
2010-11-08  3:13                                                                           ` Stephen Hemminger
2010-11-08  3:38                                                                             ` Michael Breuer
2010-11-08 16:46                                                                               ` Stephen Hemminger
2010-02-03 17:16                                                                       ` [PATCH] sky2: receive dma mapping error handling Justin P. Mattock
2010-02-02 22:44                                                   ` Andi Kleen
2012-01-16 16:39       ` Regression: sky2 kernel between 3.1 and 3.2.1 (last known good 3.0.9) Michael Breuer
2012-01-20 14:24         ` Michael Breuer
2012-01-20 16:10           ` Stephen Hemminger
2012-01-20 16:17             ` Michael Breuer
2012-01-20 16:26         ` Stephen Hemminger
2012-01-20 16:44           ` Michael Breuer
2012-01-21 15:29             ` Michael Breuer
2012-01-22 18:03               ` Stephen Hemminger

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=20100131003449.GA11935@del.dom.local \
    --to=jarkao2@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=flyboy@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbreuer@majjas.com \
    --cc=mcarlson@broadcom.com \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pcnet32@verizon.net \
    --cc=romieu@fr.zoreil.com \
    --cc=shemminger@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.