All of lore.kernel.org
 help / color / mirror / Atom feed
* [Kernel-janitors] [PATCH] swim3.c - convert cli to spinlock
@ 2004-01-24  3:53 Timmy Yee
  2004-01-27 21:26 ` Randy.Dunlap
  0 siblings, 1 reply; 2+ messages in thread
From: Timmy Yee @ 2004-01-24  3:53 UTC (permalink / raw)
  To: kernel-janitors

Hi,

This patch replaces the cli function calls with the spinlock function calls
for the swim3 driver.

--- linux-2.6.2-rc1/drivers/block/swim3.c	2003-08-09 18:19:06.000000000 -0700
+++ linux-2.6.2-rc1-mpi/drivers/block/swim3.c	2004-01-22 16:20:28.000000000 -0800
@@ -360,7 +360,7 @@
 {
 	unsigned long flags;
 
-	save_flags(flags); cli();
+	spin_lock_irqsave(&swim3_lock, flags);
 	if (fs->timeout_pending)
 		del_timer(&fs->timeout);
 	fs->timeout.expires = jiffies + nticks;
@@ -368,7 +368,7 @@
 	fs->timeout.data = (unsigned long) fs;
 	add_timer(&fs->timeout);
 	fs->timeout_pending = 1;
-	restore_flags(flags);
+	spin_unlock_irqrestore(&swim3_lock, flags);
 }
 
 static inline void scan_track(struct floppy_state *fs)
@@ -755,8 +755,7 @@
 {
 	unsigned long flags;
 
-	save_flags(flags);
-	cli();
+	spin_lock_irqsave(&swim3_lock, flags);
 	if (fs->state != idle) {
 		++fs->wanted;
 		while (fs->state != available) {
@@ -770,7 +769,7 @@
 		--fs->wanted;
 	}
 	fs->state = state;
-	restore_flags(flags);
+	spin_unlock_irqrestore(&swim3_lock, flags);
 	return 0;
 }
 
@@ -778,11 +777,10 @@
 {
 	unsigned long flags;
 
-	save_flags(flags);
-	cli();
+	spin_lock_irqsave(&swim3_lock, flags);
 	fs->state = idle;
 	start_request(fs);
-	restore_flags(flags);
+	spin_unlock_irqrestore(&swim3_lock, flags);
 }
 
 static int fd_eject(struct floppy_state *fs)
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [Kernel-janitors] [PATCH] swim3.c - convert cli to spinlock
  2004-01-24  3:53 [Kernel-janitors] [PATCH] swim3.c - convert cli to spinlock Timmy Yee
@ 2004-01-27 21:26 ` Randy.Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: Randy.Dunlap @ 2004-01-27 21:26 UTC (permalink / raw)
  To: kernel-janitors

On Fri, 23 Jan 2004 19:53:12 -0800 Timmy Yee <shoujun@masterofpi.org> wrote:

| Hi,
| 
| This patch replaces the cli function calls with the spinlock function calls
| for the swim3 driver.

Timmy,

I'm not going to use this.  I checked with the powermac people
and much more is needed to make swim3 work and they have patched
code already.

Thanks,
--
~Randy
kernel-janitors project:  http://janitor.kernelnewbies.org/
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2004-01-27 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-24  3:53 [Kernel-janitors] [PATCH] swim3.c - convert cli to spinlock Timmy Yee
2004-01-27 21:26 ` Randy.Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.