[PATCH][2.5.28] opti621 irq fallout

Zwane Mwaikambo (zwane@linuxpower.ca)
Sat, 27 Jul 2002 12:54:02 +0200 (SAST)


Index: linux-2.5.28/drivers/ide/opti621.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.28/drivers/ide/opti621.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 opti621.c
--- linux-2.5.28/drivers/ide/opti621.c 26 Jul 2002 18:11:11 -0000 1.1.1.1
+++ linux-2.5.28/drivers/ide/opti621.c 26 Jul 2002 19:18:00 -0000
@@ -131,6 +131,7 @@
#define MISC_REG 6 /* index of Miscellaneous register */

int reg_base;
+static spinlock_t opti621_lock = SPIN_LOCK_UNLOCKED;

#define PIO_NOT_EXIST 254
#define PIO_DONT_KNOW 255
@@ -281,8 +282,7 @@
hwif->name, ax, second.data_time, second.recovery_time, drdy);
#endif

- save_flags(flags); /* all CPUs */
- cli(); /* all CPUs */
+ spin_lock_irqsave(&opti621_lock, flags);

reg_base = hwif->io_ports[IDE_DATA_OFFSET];
outb(0xc0, reg_base+CNTRL_REG); /* allow Register-B */
@@ -307,7 +307,7 @@
write_reg(misc, MISC_REG); /* set address setup, DRDY timings, */
/* and read prefetch for both drives */

- restore_flags(flags); /* all CPUs */
+ spin_unlock_irqrestore(&opti621_lock, flags);
}

/*

-- 
function.linuxpower.ca

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/