[7474] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Patch for hang removing SCSI Host module

daemon@ATHENA.MIT.EDU (Steve_J_Brueggeman@notes.seagate.c)
Tue Nov 2 11:09:17 1999

From:   Steve_J_Brueggeman@notes.seagate.com
To:     linux-scsi@vger.rutgers.edu
Message-ID: <8825681D.00515A38.00@sv-gw1.stsv.seagate.com>
Date:   Tue, 2 Nov 1999 08:47:33 -0600
Mime-Version: 1.0
Content-type: text/plain; charset=us-ascii
Content-Disposition: inline

Below is a patch to fix a problem with SCSI Host adapters that use the new error
handler.  This problem
only affects systems that have scsi compiled into the kernel, but had host
adapters that have the
use_new_eh_code flag set, and were compiled as modules.  (ie; qlogicfc)

The problem was that the scsi_error_handler() would block all signals if scsi.o
was not compiled as
a module, disregarding whether or not the host adapter was compiled as a module.

As a result, unloading a module for a host adapter would never complete, since
the scsi_error_handler task
 would never notice the signal, and never up() the semaphore.

Steve Brueggeman



--- linux-2.3.24/drivers/scsi/scsi_error.c    Thu Oct 14 16:32:18 1999
+++ linux-2.3.24.01/drivers/scsi/scsi_error.c      Mon Nov  1 12:49:20 1999
@@ -35,11 +35,8 @@
 #include "hosts.h"
 #include "constants.h"

-#ifdef MODULE
-#define SHUTDOWN_SIGS   (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGTERM))
-#else
+#define SHUTDOWN_SIGS_KILLABLE
(sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGTERM))
 #define SHUTDOWN_SIGS   (0UL)
-#endif

 #ifdef DEBUG
 #define SENSE_TIMEOUT SCSI_TIMEOUT
@@ -1763,7 +1760,12 @@
     DECLARE_MUTEX_LOCKED(sem);
     unsigned long flags;

-    siginitsetinv(&current->blocked, SHUTDOWN_SIGS);
+    if(host->loaded_as_module) {
+         siginitsetinv(&current->blocked, SHUTDOWN_SIGS_KILLABLE);
+    } else {
+         siginitsetinv(&current->blocked, SHUTDOWN_SIGS);
+    }
+

     lock_kernel();





-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post