aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSteffen Maier <maier@linux.ibm.com>2019-03-26 09:36:59 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2019-03-27 21:26:12 -0400
commit242ec1455151267fe35a0834aa9038e4c4670884 (patch)
tree860b584a799aad50487ff6b3e24d4a81015ed877 /drivers
parentfe67888fc007a76b81e37da23ce5bd8fb95890b0 (diff)
scsi: zfcp: fix scsi_eh host reset with port_forced ERP for non-NPIV FCP devices
Suppose more than one non-NPIV FCP device is active on the same channel. Send I/O to storage and have some of the pending I/O run into a SCSI command timeout, e.g. due to bit errors on the fibre. Now the error situation stops. However, we saw FCP requests continue to timeout in the channel. The abort will be successful, but the subsequent TUR fails. Scsi_eh starts. The LUN reset fails. The target reset fails. The host reset only did an FCP device recovery. However, for non-NPIV FCP devices, this does not close and reopen ports on the SAN-side if other non-NPIV FCP device(s) share the same open ports. In order to resolve the continuing FCP request timeouts, we need to explicitly close and reopen ports on the SAN-side. This was missing since the beginning of zfcp in v2.6.0 history commit ea127f975424 ("[PATCH] s390 (7/7): zfcp host adapter."). Note: The FSF requests for forced port reopen could run into FSF request timeouts due to other reasons. This would trigger an internal FCP device recovery. Pending forced port reopen recoveries would get dismissed. So some ports might not get fully reopened during this host reset handler. However, subsequent I/O would trigger the above described escalation and eventually all ports would be forced reopen to resolve any continuing FCP request timeouts due to earlier bit errors. Signed-off-by: Steffen Maier <maier@linux.ibm.com> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: <stable@vger.kernel.org> #3.0+ Reviewed-by: Jens Remus <jremus@linux.ibm.com> Reviewed-by: Benjamin Block <bblock@linux.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/s390/scsi/zfcp_erp.c14
-rw-r--r--drivers/s390/scsi/zfcp_ext.h2
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c4
3 files changed, 20 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index c0b2348d7ce6..e8fc28dba8df 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -624,6 +624,20 @@ static void zfcp_erp_strategy_memwait(struct zfcp_erp_action *erp_action)
624 add_timer(&erp_action->timer); 624 add_timer(&erp_action->timer);
625} 625}
626 626
627void zfcp_erp_port_forced_reopen_all(struct zfcp_adapter *adapter,
628 int clear, char *dbftag)
629{
630 unsigned long flags;
631 struct zfcp_port *port;
632
633 write_lock_irqsave(&adapter->erp_lock, flags);
634 read_lock(&adapter->port_list_lock);
635 list_for_each_entry(port, &adapter->port_list, list)
636 _zfcp_erp_port_forced_reopen(port, clear, dbftag);
637 read_unlock(&adapter->port_list_lock);
638 write_unlock_irqrestore(&adapter->erp_lock, flags);
639}
640
627static void _zfcp_erp_port_reopen_all(struct zfcp_adapter *adapter, 641static void _zfcp_erp_port_reopen_all(struct zfcp_adapter *adapter,
628 int clear, char *dbftag) 642 int clear, char *dbftag)
629{ 643{
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index 3fce47b0b21b..c6acca521ffe 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -70,6 +70,8 @@ extern void zfcp_erp_port_reopen(struct zfcp_port *port, int clear,
70 char *dbftag); 70 char *dbftag);
71extern void zfcp_erp_port_shutdown(struct zfcp_port *, int, char *); 71extern void zfcp_erp_port_shutdown(struct zfcp_port *, int, char *);
72extern void zfcp_erp_port_forced_reopen(struct zfcp_port *, int, char *); 72extern void zfcp_erp_port_forced_reopen(struct zfcp_port *, int, char *);
73extern void zfcp_erp_port_forced_reopen_all(struct zfcp_adapter *adapter,
74 int clear, char *dbftag);
73extern void zfcp_erp_set_lun_status(struct scsi_device *, u32); 75extern void zfcp_erp_set_lun_status(struct scsi_device *, u32);
74extern void zfcp_erp_clear_lun_status(struct scsi_device *, u32); 76extern void zfcp_erp_clear_lun_status(struct scsi_device *, u32);
75extern void zfcp_erp_lun_reopen(struct scsi_device *, int, char *); 77extern void zfcp_erp_lun_reopen(struct scsi_device *, int, char *);
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index f4f6a07c5222..221d0dfb8493 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -368,6 +368,10 @@ static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt)
368 struct zfcp_adapter *adapter = zfcp_sdev->port->adapter; 368 struct zfcp_adapter *adapter = zfcp_sdev->port->adapter;
369 int ret = SUCCESS, fc_ret; 369 int ret = SUCCESS, fc_ret;
370 370
371 if (!(adapter->connection_features & FSF_FEATURE_NPIV_MODE)) {
372 zfcp_erp_port_forced_reopen_all(adapter, 0, "schrh_p");
373 zfcp_erp_wait(adapter);
374 }
371 zfcp_erp_adapter_reopen(adapter, 0, "schrh_1"); 375 zfcp_erp_adapter_reopen(adapter, 0, "schrh_1");
372 zfcp_erp_wait(adapter); 376 zfcp_erp_wait(adapter);
373 fc_ret = fc_block_scsi_eh(scpnt); 377 fc_ret = fc_block_scsi_eh(scpnt);