mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH CYCLADES 1/2] fix cli()/sti() for ISA Cyclom-Y boards
@ 2003-06-18 21:48 John Stoffel
  2003-06-18 22:43 ` viro
  0 siblings, 1 reply; 3+ messages in thread
From: John Stoffel @ 2003-06-18 21:48 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, Alan Cox


Hi Linus,

This trivially fixes the cyclades driver under ISA to get rid of the
cli()/sti() locking and use a spin lock as described in the
Documentation/cli-sti-removal.txt instructions.  I'm using this on an
SMP system without any problems so far.

Thanks,
John
john@stoffel.org



diff -ur l-2.5.72/drivers/char/cyclades.c l-2.5.72-cyclades/drivers/char/cyclades.c
--- l-2.5.72/drivers/char/cyclades.c	Wed Jun 18 10:26:21 2003
+++ l-2.5.72-cyclades/drivers/char/cyclades.c	Wed Jun 18 17:33:06 2003
@@ -867,6 +867,7 @@
 static int cyz_issue_cmd(struct cyclades_card *, uclong, ucchar, uclong);
 #ifdef CONFIG_ISA
 static unsigned detect_isa_irq (volatile ucchar *);
+spinlock_t isa_card_lock = SPIN_LOCK_UNLOCKED;
 #endif /* CONFIG_ISA */
 
 static int cyclades_get_proc_info(char *, char **, off_t , int , int *, void *);
@@ -1050,14 +1051,14 @@
     udelay(5000L);
 
     /* Enable the Tx interrupts on the CD1400 */
-    save_flags(flags); cli();
+    spin_lock_irqsave(&isa_card_lock,flags);
 	cy_writeb((u_long)address + (CyCAR<<index), 0);
 	cyy_issue_cmd(address, CyCHAN_CTL|CyENB_XMTR, index);
 
 	cy_writeb((u_long)address + (CyCAR<<index), 0);
 	cy_writeb((u_long)address + (CySRER<<index), 
 		cy_readb(address + (CySRER<<index)) | CyTxRdy);
-    restore_flags(flags);
+    spin_unlock_irqrestore(&isa_card_lock, flags);
 
     /* Wait ... */
     udelay(5000L);
@@ -5675,13 +5676,13 @@
     }
 #endif /* CONFIG_CYZ_INTR */
 
-    save_flags(flags); cli();
+    spin_lock_irqsave(&isa_card_lock, flags);
 
     if ((e1 = tty_unregister_driver(cy_serial_driver)))
             printk("cyc: failed to unregister Cyclades serial driver(%d)\n",
 		e1);
 
-    restore_flags(flags);
+    spin_unlock_irqrestore(&isa_card_lock,flags);
     put_tty_driver(cy_serial_driver);
 
     for (i = 0; i < NR_CARDS; i++) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-06-19  0:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-18 21:48 [PATCH CYCLADES 1/2] fix cli()/sti() for ISA Cyclom-Y boards John Stoffel
2003-06-18 22:43 ` viro
2003-06-19  1:05   ` John Stoffel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®