Commit 5f88d042 authored by David S. Miller's avatar David S. Miller

[SCSI]: drivers/scsi/esp.c needs interrupt.h plus fix abort/reset locking.

parent 4d1738db
......@@ -24,6 +24,7 @@
#include <linux/stat.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/interrupt.h>
#include "scsi.h"
#include "hosts.h"
......@@ -1931,15 +1932,12 @@ static void esp_dump_state(struct esp *esp)
ESPLOG(("\n"));
}
/* Abort a command. */
/* Abort a command. The host_lock is acquired by caller. */
static int esp_abort(Scsi_Cmnd *SCptr)
{
struct esp *esp = (struct esp *) SCptr->host->hostdata;
unsigned long flags;
int don;
spin_lock_irqsave(esp->ehost->host_lock, flags);
ESPLOG(("esp%d: Aborting command\n", esp->esp_id));
esp_dump_state(esp);
......@@ -1954,7 +1952,6 @@ static int esp_abort(Scsi_Cmnd *SCptr)
esp->msgout_len = 1;
esp->msgout_ctr = 0;
esp_cmd(esp, ESP_CMD_SATN);
spin_unlock_irqrestore(esp->ehost->host_lock, flags);
return SUCCESS;
}
......@@ -1983,7 +1980,6 @@ static int esp_abort(Scsi_Cmnd *SCptr)
if (don)
ESP_INTSON(esp->dregs);
spin_unlock_irqrestore(esp->ehost->host_lock, flags);
return SUCCESS;
}
}
......@@ -1997,7 +1993,6 @@ static int esp_abort(Scsi_Cmnd *SCptr)
if (esp->current_SC) {
if (don)
ESP_INTSON(esp->dregs);
spin_unlock_irqrestore(esp->ehost->host_lock, flags);
return FAILED;
}
......@@ -2010,7 +2005,7 @@ static int esp_abort(Scsi_Cmnd *SCptr)
if (don)
ESP_INTSON(esp->dregs);
spin_unlock_irqrestore(esp->ehost->host_lock, flags);
return FAILED;
}
......@@ -2067,18 +2062,21 @@ static int esp_do_resetbus(struct esp *esp)
/* Reset ESP chip, reset hanging bus, then kill active and
* disconnected commands for targets without soft reset.
*
* The host_lock is acquired by caller.
*/
static int esp_reset(Scsi_Cmnd *SCptr)
{
struct esp *esp = (struct esp *) SCptr->host->hostdata;
unsigned long flags;
spin_lock_irqsave(esp->ehost->host_lock, flags);
(void) esp_do_resetbus(esp);
spin_unlock_irqrestore(esp->ehost->host_lock, flags);
spin_unlock_irq(esp->ehost->host_lock);
wait_event(esp->reset_queue, (esp->resetting_bus == 0));
spin_lock_irq(esp->ehost->host_lock);
return SUCCESS;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment