scsi: qla2xxx: Complain if waiting for pending commands times out
authorBart Van Assche <bvanassche@acm.org>
Fri, 9 Aug 2019 03:01:54 +0000 (20:01 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 13 Aug 2019 01:34:07 +0000 (21:34 -0400)
Such a timeout is a severe issue. Hence complain if waiting for pending
commands times out. This patch fixes a small bug: it modifies
qla82xx_chip_reset_cleanup() such that the "Done waiting" message is
reported if qla82xx_chip_reset_cleanup() succeeded instead of if that
function failed.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_nx.c
drivers/scsi/qla2xxx/qla_os.c

index 1fd9a086748e39786a986aabb3903ead7605cdee..2d9a379fd8fb38dcbbcc17e676e966259e9ff269 100644 (file)
@@ -6634,7 +6634,8 @@ qla2x00_quiesce_io(scsi_qla_host_t *vha)
                                        LOOP_DOWN_TIME);
        }
        /* Wait for pending cmds to complete */
-       qla2x00_eh_wait_for_pending_commands(vha, 0, 0, WAIT_HOST);
+       WARN_ON_ONCE(qla2x00_eh_wait_for_pending_commands(vha, 0, 0, WAIT_HOST)
+                    != QLA_SUCCESS);
 }
 
 void
index c1c832271ccbe00df4864d2e96caa67f0efdac89..a91d426add75a60a4807a6fb2376b9adf39d1a49 100644 (file)
@@ -3710,10 +3710,12 @@ qla82xx_chip_reset_cleanup(scsi_qla_host_t *vha)
 
                /* Wait for pending cmds (physical and virtual) to complete */
                if (qla2x00_eh_wait_for_pending_commands(vha, 0, 0,
-                   WAIT_HOST)) {
+                   WAIT_HOST) == QLA_SUCCESS) {
                        ql_dbg(ql_dbg_init, vha, 0x00b3,
                            "Done wait for "
                            "pending commands.\n");
+               } else {
+                       WARN_ON_ONCE(true);
                }
        }
 }
index 2ba06a84c501d147f3a9396a330b55a1757ccd46..e91681cbd75db3537fbe2852085ac5c6b30873b6 100644 (file)
@@ -1059,8 +1059,8 @@ qc24_fail_command:
  *    cmd = Scsi Command to wait on.
  *
  * Return:
- *    Not Found : 0
- *    Found : 1
+ *    Completed in time : QLA_SUCCESS
+ *    Did not complete in time : QLA_FUNCTION_FAILED
  */
 static int
 qla2x00_eh_wait_on_command(struct scsi_cmnd *cmd)
@@ -1372,6 +1372,9 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
        return ret;
 }
 
+/*
+ * Returns: QLA_SUCCESS or QLA_FUNCTION_FAILED.
+ */
 int
 qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *vha, unsigned int t,
        uint64_t l, enum nexus_wait_type type)