]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
qla2xxx: Don't check for firmware hung during the reset context for ISP82XX.
authorTej Prakash <tej.prakash@qlogic.com>
Fri, 11 Apr 2014 20:54:39 +0000 (16:54 -0400)
committerChristoph Hellwig <hch@lst.de>
Mon, 19 May 2014 11:31:04 +0000 (13:31 +0200)
Signed-off-by: Tej Prakash <tej.prakash@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/qla2xxx/qla_nx.c

index 190283eba481a177d448e51f5b8b581d63ea7862..58f3c912d96ea6ac14ac743281c4c584fd5a84ba 100644 (file)
@@ -2852,47 +2852,30 @@ static int
 qla82xx_device_bootstrap(scsi_qla_host_t *vha)
 {
        int rval = QLA_SUCCESS;
-       int i, timeout;
+       int i;
        uint32_t old_count, count;
        struct qla_hw_data *ha = vha->hw;
-       int need_reset = 0, peg_stuck = 1;
+       int need_reset = 0;
 
        need_reset = qla82xx_need_reset(ha);
 
-       old_count = qla82xx_rd_32(ha, QLA82XX_PEG_ALIVE_COUNTER);
-
-       for (i = 0; i < 10; i++) {
-               timeout = msleep_interruptible(200);
-               if (timeout) {
-                       qla82xx_wr_32(ha, QLA82XX_CRB_DEV_STATE,
-                               QLA8XXX_DEV_FAILED);
-                       return QLA_FUNCTION_FAILED;
-               }
-
-               count = qla82xx_rd_32(ha, QLA82XX_PEG_ALIVE_COUNTER);
-               if (count != old_count)
-                       peg_stuck = 0;
-       }
-
        if (need_reset) {
                /* We are trying to perform a recovery here. */
-               if (peg_stuck)
+               if (ha->flags.isp82xx_fw_hung)
                        qla82xx_rom_lock_recovery(ha);
-               goto dev_initialize;
        } else  {
-               /* Start of day for this ha context. */
-               if (peg_stuck) {
-                       /* Either we are the first or recovery in progress. */
-                       qla82xx_rom_lock_recovery(ha);
-                       goto dev_initialize;
-               } else
-                       /* Firmware already running. */
-                       goto dev_ready;
+               old_count = qla82xx_rd_32(ha, QLA82XX_PEG_ALIVE_COUNTER);
+               for (i = 0; i < 10; i++) {
+                       msleep(200);
+                       count = qla82xx_rd_32(ha, QLA82XX_PEG_ALIVE_COUNTER);
+                       if (count != old_count) {
+                               rval = QLA_SUCCESS;
+                               goto dev_ready;
+                       }
+               }
+               qla82xx_rom_lock_recovery(ha);
        }
 
-       return rval;
-
-dev_initialize:
        /* set to DEV_INITIALIZING */
        ql_log(ql_log_info, vha, 0x009e,
            "HW State: INITIALIZING.\n");