Re: [PATCH 11/28] scsi: drop bus reset for wd33c93-compatible boards

2017-06-28 Thread Christoph Hellwig
On Wed, Jun 28, 2017 at 10:24:59AM +0200, Hannes Reinecke wrote:
> 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.

The changelog could be expanded a bit, especially about the
weird locking state before this patch, but except for that:

Reviewed-by: Christoph Hellwig 


Re: [PATCH 11/28] scsi: drop bus reset for wd33c93-compatible boards

2017-06-28 Thread Johannes Thumshirn

Reviewed-by: Johannes Thumshirn 
-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


[PATCH 11/28] scsi: drop bus reset for wd33c93-compatible boards

2017-06-28 Thread Hannes Reinecke
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 
---
 drivers/scsi/a2091.c   | 17 -
 drivers/scsi/a3000.c   | 17 -
 drivers/scsi/gvp11.c   | 18 --
 drivers/scsi/mvme147.c | 16 
 drivers/scsi/sgiwd93.c | 15 ---
 drivers/scsi/wd33c93.c |  2 ++
 6 files changed, 2 insertions(+), 83 deletions(-)

diff --git a/drivers/scsi/a2091.c b/drivers/scsi/a2091.c
index 9176bfb..61aadc7 100644
--- a/drivers/scsi/a2091.c
+++ b/drivers/scsi/a2091.c
@@ -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 = {
.module = THIS_MODULE,
.name   = "Commodore A2091/A590 SCSI",
@@ -171,7 +155,6 @@ static int a2091_bus_reset(struct scsi_cmnd *cmd)
.proc_name  = "A2901",
.queuecommand   = wd33c93_queuecommand,
.eh_abort_handler   = wd33c93_abort,
-   .eh_bus_reset_handler   = a2091_bus_reset,
.eh_host_reset_handler  = wd33c93_host_reset,
.can_queue  = CAN_QUEUE,
.this_id= 7,
diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c
index e6375b4..2427a85 100644
--- a/drivers/scsi/a3000.c
+++ b/drivers/scsi/a3000.c
@@ -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 = {
.module = THIS_MODULE,
.name   = "Amiga 3000 built-in SCSI",
@@ -186,7 +170,6 @@ static int a3000_bus_reset(struct scsi_cmnd *cmd)
.proc_name  = "A3000",
.queuecommand   = wd33c93_queuecommand,
.eh_abort_handler   = wd33c93_abort,
-   .eh_bus_reset_handler   = a3000_bus_reset,
.eh_host_reset_handler  = wd33c93_host_reset,
.can_queue  = CAN_QUEUE,
.this_id= 7,
diff --git a/drivers/scsi/gvp11.c b/drivers/scsi/gvp11.c
index 3b6f83f..a27fc49 100644
--- a/drivers/scsi/gvp11.c
+++ b/drivers/scsi/gvp11.c
@@ -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 = {
.module = THIS_MODULE,
.name   = "GVP Series II SCSI",
@@ -196,7 +179,6 @@ static int gvp11_bus_reset(struct scsi_cmnd *cmd)
.proc_name  = "GVP11",
.queuecommand   = wd33c93_queuecommand,
.eh_abort_handler   = wd33c93_abort,
-   .eh_bus_reset_handler   = gvp11_bus_reset,
.eh_host_reset_handler  = wd33c93_host_reset,
.can_queue  = CAN_QUEUE,
.this_id= 7,
diff --git a/drivers/scsi/mvme147.c b/drivers/scsi/mvme147.c
index e7f6661..4f51570 100644
--- a/drivers/scsi/mvme147.c
+++ b/drivers/scsi/mvme147.c
@@ -121,21 +121,6 @@ int mvme147_detect(struct scsi_host_template *tpnt)
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);
-
-