#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>
* 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)
* 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)
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);
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);
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.
int rtn;
DECLARE_MUTEX_LOCKED(sem);
- lock_kernel();
-
/*
* Flush resources
*/
shost->eh_wait = &sem;
shost->ehandler = current;
- unlock_kernel();
-
/*
* Wake up the thread that created us.
*/