vserver 1.9.3
[linux-2.6.git] / drivers / scsi / scsi_error.c
index 288f2fd..617412e 100644 (file)
@@ -22,7 +22,7 @@
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <linux/blkdev.h>
-#include <linux/smp_lock.h>
+#include <linux/delay.h>
 
 #include <scsi/scsi.h>
 #include <scsi/scsi_dbg.h>
@@ -42,8 +42,8 @@
  * These should *probably* be handled by the host itself.
  * Since it is allowed to sleep, it probably should.
  */
-#define BUS_RESET_SETTLE_TIME   (10*HZ)
-#define HOST_RESET_SETTLE_TIME  (10*HZ)
+#define BUS_RESET_SETTLE_TIME   (10)
+#define HOST_RESET_SETTLE_TIME  (10)
 
 /* called with shost->host_lock held */
 void scsi_eh_wakeup(struct Scsi_Host *shost)
@@ -643,15 +643,13 @@ static void scsi_eh_finish_cmd(struct scsi_cmnd *scmd,
  * Notes:
  *    This has the unfortunate side effect that if a shost adapter does
  *    not automatically request sense information, that we end up shutting
- *    it down before we request it.  All shosts should be doing this
- *    anyways, so for now all I have to say is tough noogies if you end up
- *    in here.  On second thought, this is probably a good idea.  We
- *    *really* want to give authors an incentive to automatically request
- *    this.
+ *    it down before we request it.
  *
- *    In 2.5 this capability will be going away.
+ *    All drivers should request sense information internally these days,
+ *    so for now all I have to say is tough noogies if you end up in here.
  *
- *    Really?  --hch
+ *    XXX: Long term this code should go away, but that needs an audit of
+ *         all LLDDs first.
  **/
 static int scsi_eh_get_sense(struct list_head *work_q,
                             struct list_head *done_q)
@@ -1044,7 +1042,7 @@ static int scsi_try_bus_reset(struct scsi_cmnd *scmd)
 
        if (rtn == SUCCESS) {
                if (!scmd->device->host->hostt->skip_settle_delay)
-                       scsi_sleep(BUS_RESET_SETTLE_TIME);
+                       ssleep(BUS_RESET_SETTLE_TIME);
                spin_lock_irqsave(scmd->device->host->host_lock, flags);
                scsi_report_bus_reset(scmd->device->host, scmd->device->channel);
                spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
@@ -1076,7 +1074,7 @@ static int scsi_try_host_reset(struct scsi_cmnd *scmd)
 
        if (rtn == SUCCESS) {
                if (!scmd->device->host->hostt->skip_settle_delay)
-                       scsi_sleep(HOST_RESET_SETTLE_TIME);
+                       ssleep(HOST_RESET_SETTLE_TIME);
                spin_lock_irqsave(scmd->device->host->host_lock, flags);
                scsi_report_bus_reset(scmd->device->host, scmd->device->channel);
                spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
@@ -1215,43 +1213,6 @@ static void scsi_eh_offline_sdevs(struct list_head *work_q,
        return;
 }
 
-/**
- * scsi_sleep_done - timer function for scsi_sleep
- * @sem:       semphore to signal
- *
- **/
-static void scsi_sleep_done(unsigned long data)
-{
-       struct semaphore *sem = (struct semaphore *)data;
-
-       if (sem)
-               up(sem);
-}
-
-/**
- * scsi_sleep - sleep for specified timeout
- * @timeout:   timeout value
- *
- **/
-void scsi_sleep(int timeout)
-{
-       DECLARE_MUTEX_LOCKED(sem);
-       struct timer_list timer;
-
-       init_timer(&timer);
-       timer.data = (unsigned long)&sem;
-       timer.expires = jiffies + timeout;
-       timer.function = (void (*)(unsigned long))scsi_sleep_done;
-
-       SCSI_LOG_ERROR_RECOVERY(5, printk("sleeping for timer tics %d\n",
-                                         timeout));
-
-       add_timer(&timer);
-
-       down(&sem);
-       del_timer(&timer);
-}
-
 /**
  * scsi_decide_disposition - Disposition a cmd on return from LLD.
  * @scmd:      SCSI cmd to examine.
@@ -1639,8 +1600,6 @@ int scsi_error_handler(void *data)
        int rtn;
        DECLARE_MUTEX_LOCKED(sem);
 
-       lock_kernel();
-
        /*
         *    Flush resources
         */
@@ -1652,8 +1611,6 @@ int scsi_error_handler(void *data)
        shost->eh_wait = &sem;
        shost->ehandler = current;
 
-       unlock_kernel();
-
        /*
         * Wake up the thread that created us.
         */