scsi: drop bus reset for wd33c93-compatible boards
The bus reset function is just a wrapper calling host reset under the host lock. So move taking of the host lock into the host reset function and drop bus reset. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
63cd2f7f90
commit
ec05e23896
@@ -147,22 +147,6 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int a2091_bus_reset(struct scsi_cmnd *cmd)
|
|
||||||
{
|
|
||||||
struct Scsi_Host *instance = cmd->device->host;
|
|
||||||
|
|
||||||
/* FIXME perform bus-specific reset */
|
|
||||||
|
|
||||||
/* FIXME 2: kill this function, and let midlayer fall back
|
|
||||||
to the same action, calling wd33c93_host_reset() */
|
|
||||||
|
|
||||||
spin_lock_irq(instance->host_lock);
|
|
||||||
wd33c93_host_reset(cmd);
|
|
||||||
spin_unlock_irq(instance->host_lock);
|
|
||||||
|
|
||||||
return SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct scsi_host_template a2091_scsi_template = {
|
static struct scsi_host_template a2091_scsi_template = {
|
||||||
.module = THIS_MODULE,
|
.module = THIS_MODULE,
|
||||||
.name = "Commodore A2091/A590 SCSI",
|
.name = "Commodore A2091/A590 SCSI",
|
||||||
@@ -171,7 +155,6 @@ static struct scsi_host_template a2091_scsi_template = {
|
|||||||
.proc_name = "A2901",
|
.proc_name = "A2901",
|
||||||
.queuecommand = wd33c93_queuecommand,
|
.queuecommand = wd33c93_queuecommand,
|
||||||
.eh_abort_handler = wd33c93_abort,
|
.eh_abort_handler = wd33c93_abort,
|
||||||
.eh_bus_reset_handler = a2091_bus_reset,
|
|
||||||
.eh_host_reset_handler = wd33c93_host_reset,
|
.eh_host_reset_handler = wd33c93_host_reset,
|
||||||
.can_queue = CAN_QUEUE,
|
.can_queue = CAN_QUEUE,
|
||||||
.this_id = 7,
|
.this_id = 7,
|
||||||
|
|||||||
@@ -162,22 +162,6 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int a3000_bus_reset(struct scsi_cmnd *cmd)
|
|
||||||
{
|
|
||||||
struct Scsi_Host *instance = cmd->device->host;
|
|
||||||
|
|
||||||
/* FIXME perform bus-specific reset */
|
|
||||||
|
|
||||||
/* FIXME 2: kill this entire function, which should
|
|
||||||
cause mid-layer to call wd33c93_host_reset anyway? */
|
|
||||||
|
|
||||||
spin_lock_irq(instance->host_lock);
|
|
||||||
wd33c93_host_reset(cmd);
|
|
||||||
spin_unlock_irq(instance->host_lock);
|
|
||||||
|
|
||||||
return SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct scsi_host_template amiga_a3000_scsi_template = {
|
static struct scsi_host_template amiga_a3000_scsi_template = {
|
||||||
.module = THIS_MODULE,
|
.module = THIS_MODULE,
|
||||||
.name = "Amiga 3000 built-in SCSI",
|
.name = "Amiga 3000 built-in SCSI",
|
||||||
@@ -186,7 +170,6 @@ static struct scsi_host_template amiga_a3000_scsi_template = {
|
|||||||
.proc_name = "A3000",
|
.proc_name = "A3000",
|
||||||
.queuecommand = wd33c93_queuecommand,
|
.queuecommand = wd33c93_queuecommand,
|
||||||
.eh_abort_handler = wd33c93_abort,
|
.eh_abort_handler = wd33c93_abort,
|
||||||
.eh_bus_reset_handler = a3000_bus_reset,
|
|
||||||
.eh_host_reset_handler = wd33c93_host_reset,
|
.eh_host_reset_handler = wd33c93_host_reset,
|
||||||
.can_queue = CAN_QUEUE,
|
.can_queue = CAN_QUEUE,
|
||||||
.this_id = 7,
|
.this_id = 7,
|
||||||
|
|||||||
@@ -171,23 +171,6 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int gvp11_bus_reset(struct scsi_cmnd *cmd)
|
|
||||||
{
|
|
||||||
struct Scsi_Host *instance = cmd->device->host;
|
|
||||||
|
|
||||||
/* FIXME perform bus-specific reset */
|
|
||||||
|
|
||||||
/* FIXME 2: shouldn't we no-op this function (return
|
|
||||||
FAILED), and fall back to host reset function,
|
|
||||||
wd33c93_host_reset ? */
|
|
||||||
|
|
||||||
spin_lock_irq(instance->host_lock);
|
|
||||||
wd33c93_host_reset(cmd);
|
|
||||||
spin_unlock_irq(instance->host_lock);
|
|
||||||
|
|
||||||
return SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct scsi_host_template gvp11_scsi_template = {
|
static struct scsi_host_template gvp11_scsi_template = {
|
||||||
.module = THIS_MODULE,
|
.module = THIS_MODULE,
|
||||||
.name = "GVP Series II SCSI",
|
.name = "GVP Series II SCSI",
|
||||||
@@ -196,7 +179,6 @@ static struct scsi_host_template gvp11_scsi_template = {
|
|||||||
.proc_name = "GVP11",
|
.proc_name = "GVP11",
|
||||||
.queuecommand = wd33c93_queuecommand,
|
.queuecommand = wd33c93_queuecommand,
|
||||||
.eh_abort_handler = wd33c93_abort,
|
.eh_abort_handler = wd33c93_abort,
|
||||||
.eh_bus_reset_handler = gvp11_bus_reset,
|
|
||||||
.eh_host_reset_handler = wd33c93_host_reset,
|
.eh_host_reset_handler = wd33c93_host_reset,
|
||||||
.can_queue = CAN_QUEUE,
|
.can_queue = CAN_QUEUE,
|
||||||
.this_id = 7,
|
.this_id = 7,
|
||||||
|
|||||||
@@ -121,21 +121,6 @@ int mvme147_detect(struct scsi_host_template *tpnt)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mvme147_bus_reset(struct scsi_cmnd *cmd)
|
|
||||||
{
|
|
||||||
/* FIXME perform bus-specific reset */
|
|
||||||
|
|
||||||
/* FIXME 2: kill this function, and let midlayer fallback to
|
|
||||||
the same result, calling wd33c93_host_reset() */
|
|
||||||
|
|
||||||
spin_lock_irq(cmd->device->host->host_lock);
|
|
||||||
wd33c93_host_reset(cmd);
|
|
||||||
spin_unlock_irq(cmd->device->host->host_lock);
|
|
||||||
|
|
||||||
return SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static struct scsi_host_template driver_template = {
|
static struct scsi_host_template driver_template = {
|
||||||
.proc_name = "MVME147",
|
.proc_name = "MVME147",
|
||||||
.name = "MVME147 built-in SCSI",
|
.name = "MVME147 built-in SCSI",
|
||||||
@@ -143,7 +128,6 @@ static struct scsi_host_template driver_template = {
|
|||||||
.release = mvme147_release,
|
.release = mvme147_release,
|
||||||
.queuecommand = wd33c93_queuecommand,
|
.queuecommand = wd33c93_queuecommand,
|
||||||
.eh_abort_handler = wd33c93_abort,
|
.eh_abort_handler = wd33c93_abort,
|
||||||
.eh_bus_reset_handler = mvme147_bus_reset,
|
|
||||||
.eh_host_reset_handler = wd33c93_host_reset,
|
.eh_host_reset_handler = wd33c93_host_reset,
|
||||||
.can_queue = CAN_QUEUE,
|
.can_queue = CAN_QUEUE,
|
||||||
.this_id = 7,
|
.this_id = 7,
|
||||||
|
|||||||
@@ -192,20 +192,6 @@ static inline void init_hpc_chain(struct ip22_hostdata *hdata)
|
|||||||
hcp->desc.pnext = hdata->dma;
|
hcp->desc.pnext = hdata->dma;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sgiwd93_bus_reset(struct scsi_cmnd *cmd)
|
|
||||||
{
|
|
||||||
/* FIXME perform bus-specific reset */
|
|
||||||
|
|
||||||
/* FIXME 2: kill this function, and let midlayer fallback
|
|
||||||
to the same result, calling wd33c93_host_reset() */
|
|
||||||
|
|
||||||
spin_lock_irq(cmd->device->host->host_lock);
|
|
||||||
wd33c93_host_reset(cmd);
|
|
||||||
spin_unlock_irq(cmd->device->host->host_lock);
|
|
||||||
|
|
||||||
return SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Kludge alert - the SCSI code calls the abort and reset method with int
|
* Kludge alert - the SCSI code calls the abort and reset method with int
|
||||||
* arguments not with pointers. So this is going to blow up beautyfully
|
* arguments not with pointers. So this is going to blow up beautyfully
|
||||||
@@ -217,7 +203,6 @@ static struct scsi_host_template sgiwd93_template = {
|
|||||||
.name = "SGI WD93",
|
.name = "SGI WD93",
|
||||||
.queuecommand = wd33c93_queuecommand,
|
.queuecommand = wd33c93_queuecommand,
|
||||||
.eh_abort_handler = wd33c93_abort,
|
.eh_abort_handler = wd33c93_abort,
|
||||||
.eh_bus_reset_handler = sgiwd93_bus_reset,
|
|
||||||
.eh_host_reset_handler = wd33c93_host_reset,
|
.eh_host_reset_handler = wd33c93_host_reset,
|
||||||
.can_queue = 16,
|
.can_queue = 16,
|
||||||
.this_id = 7,
|
.this_id = 7,
|
||||||
|
|||||||
@@ -1578,6 +1578,7 @@ wd33c93_host_reset(struct scsi_cmnd * SCpnt)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
instance = SCpnt->device->host;
|
instance = SCpnt->device->host;
|
||||||
|
spin_lock_irq(instance->host_lock);
|
||||||
hostdata = (struct WD33C93_hostdata *) instance->hostdata;
|
hostdata = (struct WD33C93_hostdata *) instance->hostdata;
|
||||||
|
|
||||||
printk("scsi%d: reset. ", instance->host_no);
|
printk("scsi%d: reset. ", instance->host_no);
|
||||||
@@ -1603,6 +1604,7 @@ wd33c93_host_reset(struct scsi_cmnd * SCpnt)
|
|||||||
reset_wd33c93(instance);
|
reset_wd33c93(instance);
|
||||||
SCpnt->result = DID_RESET << 16;
|
SCpnt->result = DID_RESET << 16;
|
||||||
enable_irq(instance->irq);
|
enable_irq(instance->irq);
|
||||||
|
spin_unlock_irq(instance->host_lock);
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user