This removes cli/sti from i2c-elektor which protected pcf_pending from changing. Replaced by a spinlock instead. Jan diff -urN -X exclude linux-bk/drivers/i2c/i2c-elektor.c 2.5.75-bk1/drivers/i2c/i2c-elektor.c --- linux-bk/drivers/i2c/i2c-elektor.c Sun Jun 15 14:04:13 2003 +++ 2.5.75-bk1/drivers/i2c/i2c-elektor.c Sat Jul 12 11:51:34 2003 @@ -59,6 +59,8 @@ need to be rewriten - but for now just remove this for simpler reading */ static wait_queue_head_t pcf_wait; + +spinlock_t pcf_pending_lock = SPIN_LOCK_UNLOCKED; static int pcf_pending; /* ----- global defines ----------------------------------------------- */ @@ -120,12 +122,12 @@ int timeout = 2; if (irq > 0) { - cli(); + spin_lock_irq(&pcf_pending_lock); if (pcf_pending == 0) { interruptible_sleep_on_timeout(&pcf_wait, timeout*HZ ); } else pcf_pending = 0; - sti(); + spin_unlock_irq(&pcf_pending_lock); } else { udelay(100); } @@ -133,8 +135,11 @@ static irqreturn_t pcf_isa_handler(int this_irq, void *dev_id, struct pt_regs *regs) { + unsigned long flags; + spin_lock_irqsave(&pcf_pending_lock, flags); pcf_pending = 1; wake_up_interruptible(&pcf_wait); + spin_unlock_irqrestore(&pcf_pending_lock, flags); return IRQ_HANDLED; }