qla2xxx: ISP8044 poll ipmdio bus timeout improvement.
authorJoe Carnuccio <joe.carnuccio@qlogic.com>
Fri, 11 Apr 2014 20:54:29 +0000 (16:54 -0400)
committerChristoph Hellwig <hch@lst.de>
Mon, 19 May 2014 11:31:03 +0000 (13:31 +0200)
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/qla2xxx/qla_nx2.c

index 75e947a23b5c07521210a22e72e14cab25de6a08..e5b4a409289324812301fc13d0ddebf87130047e 100644 (file)
@@ -175,18 +175,17 @@ qla8044_poll_wait_ipmdio_bus_idle(struct scsi_qla_host *vha,
        uint32_t temp;
 
        /* jiffies after 100 msecs */
-       timeout = jiffies + (HZ / 1000) * TIMEOUT_100_MS;
+       timeout = jiffies + msecs_to_jiffies(TIMEOUT_100_MS);
        do {
                temp = qla8044_ipmdio_rd_reg(vha, addr1, addr3, mask, addr2);
                if ((temp & 0x1) != 1)
                        break;
-       } while (!time_after_eq(jiffies, timeout));
-
-       if (time_after_eq(jiffies, timeout)) {
-               ql_log(ql_log_warn, vha, 0xb152,
-                   "Error in processing mdiobus idle\n");
-               return -1;
-       }
+               if (time_after_eq(jiffies, timeout)) {
+                       ql_log(ql_log_warn, vha, 0xb152,
+                           "Error in processing mdiobus idle\n");
+                       return -1;
+               }
+       } while (1);
 
        return 0;
 }