lkml.org 
[lkml]   [1998]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: cli/sti in char/vt.c [patch]
Hi Pavel,

> Hi!
>
> > The following patch (against 2.1.103) attempts to fix that. I believe it
> > also makes it SMP safe, but I only have a UP, so can't test.
>
> Don't think so. Well, it is safe on i386, but on other architectures,
> test_and_set_bit is not guaranteed to be atomic. [And I'm afraid that
> this code is used on non-i386 but similar hw around machines?]

a) As you wrote above, the code is SMP safe on i386 architectures.

b) The code wraps a PC-specific feature (the speaker port, driven by a
8253/82C54 counter/timer chip or equivalent).

> You should better use atomic_t mksound_lock, and
> atomic_inc/atomic_dec.
>
> Correct and post to linus ;-)

No. The patch by Rafael is correct as it stands now.

First come up with a real-life example of an *SMP* motherboard which
has:

1) a PC-style speaker port with an 8253/82C54 chip, and
2) two or more non-i386 processors with a non-SMP-friendly
test_and_set_bit(),

_then_ the patch will eventually have to be changed.

Otherwise your entire argument above is entirely hypothetical.

Regards,
------------------------
André Balsa
andrebalsa@altern.org

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.074 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site