From: Joerg Roedel <joerg.roedel@amd.com>
To: Torsten Kaiser <just.for.lkml@googlemail.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
Linus Torvalds <torvalds@linux-foundation.org>,
mingo@elte.hu, lethal@linux-sh.org, hancockrwd@gmail.com,
jens.axboe@oracle.com, bharrosh@panasas.com,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] dma-debug: disable DMA_API_DEBUG for now
Date: Thu, 11 Jun 2009 10:10:32 +0200 [thread overview]
Message-ID: <20090611081032.GN5139@amd.com> (raw)
In-Reply-To: <64bb37e0906101341j341f5179o9abfa888a6b96fc3@mail.gmail.com>
On Wed, Jun 10, 2009 at 10:41:53PM +0200, Torsten Kaiser wrote:
> I applied this patch to the just released 2.6.30, but it does not fix
> the false warning on my System.
>
> Jun 10 21:10:14 treogen [ 2611.715341] ------------[ cut here ]------------
> Jun 10 21:10:14 treogen [ 2611.715359] WARNING: at lib/dma-debug.c:565
> check_unmap+0x536/0x620()
> Jun 10 21:10:14 treogen [ 2611.715363] Hardware name: KFN5-D SLI
> Jun 10 21:10:14 treogen [ 2611.715369] sata_sil24 0000:04:00.0:
> DMA-API: device driver frees DMA sg list with different entry count [map count=2] [unmap count=1]
Ok, thats because we need also to check for sg_call_ents in the best-fit
checks. Can you please test if you can reproduce it with the attached
patch?
>From 1e83c7eab546314ad9dbe08602d243bb83e93b50 Mon Sep 17 00:00:00 2001
From: Joerg Roedel <joerg.roedel@amd.com>
Date: Thu, 11 Jun 2009 10:03:42 +0200
Subject: [PATCH] dma-debug: check for sg_call_ents in best-fit algorithm too
If we don't check for sg_call_ents the hash_bucket_find function might
still return the wrong dma_debug_entry for sg mappings.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
lib/dma-debug.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index ad65fc0..eb86ec3 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -262,11 +262,12 @@ static struct dma_debug_entry *hash_bucket_find(struct hash_bucket *bucket,
*/
matches += 1;
match_lvl = 0;
- entry->size == ref->size ? ++match_lvl : match_lvl;
- entry->type == ref->type ? ++match_lvl : match_lvl;
- entry->direction == ref->direction ? ++match_lvl : match_lvl;
+ entry->size == ref->size ? ++match_lvl : 0;
+ entry->type == ref->type ? ++match_lvl : 0;
+ entry->direction == ref->direction ? ++match_lvl : 0;
+ entry->sg_call_ents == ref->sg_call_ents ? ++match_lvl : 0;
- if (match_lvl == 3) {
+ if (match_lvl == 4) {
/* perfect-fit - return the result */
return entry;
} else if (match_lvl > last_lvl) {
--
1.6.3.1
--
| Advanced Micro Devices GmbH
Operating | Karl-Hammerschmidt-Str. 34, 85609 Dornach bei München
System |
Research | Geschäftsführer: Thomas M. McCoy, Giuliano Meroni
Center | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
| Registergericht München, HRB Nr. 43632
next prev parent reply other threads:[~2009-06-11 8:11 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-05 8:33 [PATCH] dma-debug: disable DMA_API_DEBUG for now FUJITA Tomonori
2009-06-05 10:41 ` Joerg Roedel
2009-06-05 11:38 ` FUJITA Tomonori
2009-06-05 12:44 ` Joerg Roedel
2009-06-05 14:57 ` Arnd Bergmann
2009-06-05 15:52 ` Torsten Kaiser
2009-06-05 18:20 ` Joerg Roedel
2009-06-05 20:25 ` Torsten Kaiser
2009-06-05 22:11 ` Torsten Kaiser
2009-06-07 8:13 ` Ingo Molnar
2009-06-07 8:22 ` Torsten Kaiser
2009-06-07 10:45 ` FUJITA Tomonori
2009-06-07 10:22 ` [tip:core/iommu] dma-debug: change hash_bucket_find from first-fit to best-fit tip-bot for Joerg Roedel
2009-06-10 20:41 ` [PATCH] dma-debug: disable DMA_API_DEBUG for now Torsten Kaiser
2009-06-11 8:10 ` Joerg Roedel [this message]
2009-06-11 17:38 ` Torsten Kaiser
2009-06-12 7:50 ` Joerg Roedel
2009-06-12 14:13 ` Joerg Roedel
2009-06-12 14:51 ` Torsten Kaiser
2009-06-13 11:10 ` Joerg Roedel
2009-06-13 14:26 ` Torsten Kaiser
2009-06-13 17:34 ` Joerg Roedel
2009-06-13 17:08 ` Torsten Kaiser
2009-06-15 7:46 ` Joerg Roedel
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=20090611081032.GN5139@amd.com \
--to=joerg.roedel@amd.com \
--cc=bharrosh@panasas.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=hancockrwd@gmail.com \
--cc=jens.axboe@oracle.com \
--cc=just.for.lkml@googlemail.com \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=torvalds@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox