lkml.org 
[lkml]   [2009]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: LOCK prefix on uni processor has its use
From
Date
Harald Welte <HaraldWelte@viatech.com> writes:
> * All X86 instructions except rep-strings are atomic wrt interrupts.
> * The lock prefix has uses on a UP processor: It keeps DMA devices from
> interfering with a read-modify-write sequence

In theory yes, but not in Linux -- normal drivers simply don't use LOCK in any way
on a UP kernel.

We discussed exactly this in the earlier subthread :)

> Now the question is: Is this a valid operation of a driver? Should the driver
> do such things, or is such a driver broken?

The driver is broken because if it relies on this it will not work on a UP kernel.
Also it's not portable and in general a bad idea.

> When would that occur? I'm trying
> to come up with a case, but typically you e.g. allocate some DMA buffer and
> then don't touch it until the hardware has processed it.

Is it known which driver has this problem?

-Andi (who finds hpa's "timing theory" to be more believable anyways)

--
ak@linux.intel.com -- Speaking for myself only.


\
 
 \ /
  Last update: 2009-05-27 20:11    [from the cache]
©2003-2011 Jasper Spaans