Re: [PATCH](s): Use spinlocks instead of STI/CLI in SoundBlaster

Pavel Machek (pavel@suse.cz)
Sat, 27 Jan 2001 11:26:29 +0100


Hi!

> I hear on the grapevine that 2.4 kernel modules should use spinlocks
> in preference to cli() and sti(). Well I'm not sure how big a win it
> is, particularly on a UP machine, but here's a patch for the
> SoundBlaster. I've added a spinlock_t to the "struct b_devc" so that
> multiple SoundBlasters each get their own lock. After all, each SB has
> its own IRQ and IO, correct?
>
> There also seems to be something here called a Jazz16. This has a
> global lock because it looks like there can only be one of them.

Should not you initialize spinlock?

> --- linux-2.4.0/drivers/sound/sb.h.orig Fri Jan 26 13:57:40 2001
> +++ linux-2.4.0/drivers/sound/sb.h Fri Jan 26 13:58:42 2001
> @@ -137,6 +137,8 @@
> void (*midi_input_intr) (int dev, unsigned char data);
> void *midi_irq_cookie; /* IRQ cookie for the midi */
>
> + spinlock_t lock;
> +
Pavel

-- 
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/