linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] blk API update (and bug fix) to CDU535 cdrom driver
@ 2003-09-10 19:58 Matthew Wilcox
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2003-09-10 19:58 UTC (permalink / raw)
  To: Felipe W Damasio, Jens Axboe; +Cc: linux-kernel


This cli-sti removal seems exactly as broken as all the ones i've NAKed on
kernel-janitors.  There's no evidence that I can see for locking in the
interrupt handler.  Here's a race example:

CPU 1				CPU 2
sony_sleep();
spin_lock_irq(&sonycd535_lock);
enable_interrupts();
				cdu535_interrupt();
				disable_interrupts();
				if (waitqueue_active(&cdu535_irq_wait)) {

prepare_to_wait(&cdu535_irq_wait, &wait, TASK_INTERRUPTIBLE);
spin_unlock_irq(&sonycd535_lock);

Either you need to move prepare_to_wait before enable_interrupts or
grab the sonycd535_lock in interrupt context.

Hang on a minute.  This driver is always polled, and never interrupt
driven.  There's no problem because this code path is never executed :-P
Nevertheless, it's probaby worth fixing so other more complex drivers
(eg cdu31a) don't copy it wrongly.

BTW, I bet sony_sleep() shouldn't be calling the new-and-improved yield().

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <3F5DDEA8.6040901@terra.com.br>]

end of thread, other threads:[~2003-09-10 19:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-10 19:58 [PATCH] blk API update (and bug fix) to CDU535 cdrom driver Matthew Wilcox
     [not found] <3F5DDEA8.6040901@terra.com.br>
     [not found] ` <20030909143341.GA18257@suse.de>
     [not found]   ` <3F5DEA0D.6030701@terra.com.br>
     [not found]     ` <20030909153536.GH18257@suse.de>
2003-09-09 17:50       ` Felipe W Damasio
2003-09-09 19:55         ` Jens Axboe
2003-09-09 20:21           ` Felipe W Damasio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).