[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <64bb37e0906051511y766af2d3sc12ee2dd2048d905@mail.gmail.com>
Date: Sat, 6 Jun 2009 00:11:15 +0200
From: Torsten Kaiser <just.for.lkml@...glemail.com>
To: Joerg Roedel <joro@...tes.org>
Cc: Joerg Roedel <joerg.roedel@....com>,
FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
Linus Torvalds <torvalds@...ux-foundation.org>, mingo@...e.hu,
lethal@...ux-sh.org, hancockrwd@...il.com, jens.axboe@...cle.com,
bharrosh@...asas.com, linux-kernel@...r.kernel.org,
linux-scsi@...r.kernel.org
Subject: Re: [PATCH] dma-debug: disable DMA_API_DEBUG for now
On Fri, Jun 5, 2009 at 8:20 PM, Joerg Roedel <joro@...tes.org> wrote:
> On Fri, Jun 05, 2009 at 05:52:27PM +0200, Torsten Kaiser wrote:
>> Should there be a warning if more then one possible match were found?
>
> True. That would be better. But I tried to keep the code change as small
> as possible without disabling the feature completly.
>
>> * driver maps address 'a' with size 1
>> * driver maps same address 'a' with size 2
>> * driver wrongly unmaps the second allocation with size 1
>> -> no warning, because the first allocation is returned
>
> Hmm, I am not sure if we can handle this situation correctly in the
> dma-debug code. There is no unique key to identify a mapping request
> which allows to assign an unmap request to it. Currently dma-debug uses
> device and dma-address. But that seems not to be sufficient. The
> best-fit algorithm is also a but fuzzy of course.
Maybe we just shouldn't try to handle it at all:
static void add_dma_entry(struct dma_debug_entry *entry)
{
struct hash_bucket *bucket;
unsigned long flags;
bucket = get_hash_bucket(entry, &flags);
if(hash_bucket_find(bucket, entry)) {
printk(KERN_ERR "DMA-API: device mapped same address twice, "
"this use case cannot be handled currently -
disabling debugging\n");
global_disable = true;
}
hash_bucket_add(bucket, entry);
put_hash_bucket(bucket, &flags);
}
This would allow this feature to remain for most cased, but would also
prevent all false warnings.
Torsten
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists