[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46A63964.7000900@garzik.org>
Date: Tue, 24 Jul 2007 13:39:48 -0400
From: Jeff Garzik <jeff@...zik.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
CC: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Satyam Sharma <ssatyam@....iitk.ac.in>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
David Howells <dhowells@...hat.com>,
Nick Piggin <nickpiggin@...oo.com.au>, Andi Kleen <ak@...e.de>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 4/8] i386: bitops: Kill volatile-casting of memory addresses
Linus Torvalds wrote:
> And before we remove that "volatile", we'd better make damn sure that
> there isn't any driver that does
>
> /* Wait for the command queue to be cleared by DMA */
> while (test_bit(...))
> ;
>
> or similar.
>
> Yes, it's annoying, but this is a scary and subtle area. And we sadly
> _have_ had code that does things like that.
I certainly cannot speak for all the grotty drivers out there, but I've
never ever seen anything like the above. I would consider anyone using
kernel bit operations on DMA memory to be more than a little crazy. But
that's just me :)
Usually you will see
while (1) {
rmb();
if (software_index == hardware_index_in_DMA_memory)
break;
... handle a unit of work ...
}
Though ISTR being told that even rmb() was not sufficient in all cases
[nonetheless, that's what I use in net and SATA drivers and email
recommendations, and people seem happy]
Jeff
-
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