All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.6.8.1 MegaRAID Driver Race
@ 2004-08-23 21:57 bradgoodman.com
  2004-08-23 22:16 ` Andrew Morton
  2004-08-28 19:15 ` Alan Cox
  0 siblings, 2 replies; 3+ messages in thread
From: bradgoodman.com @ 2004-08-23 21:57 UTC (permalink / raw)
  To: akpm, Atul.Mukker, bgoodman, linux-kernel, marcelo, torvalds

[PATCH] 2.6.8.1 to LSI Logic MegaRAID Adapter - ioctl function calls 
mega_internal_command, which uses wait_event, which calls schedule.
This means schedule() is called while big kernel_lock is held.

Locks/Unlocks were done here because 

1. There are a lot of return()s in the ioctl function to dodge.
2. mega_internal_command is also called by read and writes,
   which don't hold big kernel_lock

Brad Goodman <brad@bradgoodman.com>


--- drivers/scsi/megaraid.c.orig	Mon Aug 23 15:57:09 2004
+++ drivers/scsi/megaraid.c	Mon Aug 23 15:18:48 2004
@@ -38,6 +38,7 @@
 #include <linux/blkdev.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
+#include <linux/smp_lock.h>
 #include <linux/delay.h>
 #include <linux/proc_fs.h>
 #include <linux/reboot.h>
@@ -3622,7 +3623,9 @@
 			/*
 			 * Issue the command
 			 */
+			unlock_kernel();
 			mega_internal_command(adapter, LOCK_INT, &mc, pthru);
+			lock_kernel();
 
 			rval = mega_n_to_m((void __user *)arg, &mc);
 
@@ -3705,7 +3708,9 @@
 			/*
 			 * Issue the command
 			 */
+			unlock_kernel();
 			mega_internal_command(adapter, LOCK_INT, &mc, NULL);
+			lock_kernel();
 
 			rval = mega_n_to_m((void __user *)arg, &mc);
 

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

end of thread, other threads:[~2004-08-28 20:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-23 21:57 [PATCH] 2.6.8.1 MegaRAID Driver Race bradgoodman.com
2004-08-23 22:16 ` Andrew Morton
2004-08-28 19:15 ` Alan Cox

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.