lkml.org 
[lkml]   [2007]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-24 19:43    [W:0.199 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site