qlcnic: Use usleep_range() instead of msleep() for sleep less than 20ms
authorJitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Wed, 27 Aug 2014 16:43:19 +0000 (12:43 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sat, 30 Aug 2014 03:15:36 +0000 (20:15 -0700)
As per recommendation, msleep() may sleep longer than intended time for
values less than 20ms. So, use usleep_range() instead of msleep()

Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c

index 528c651138b47883b8dbba4bdb8674e77424b4b5..840bf36b5e9d0d8ac5ddca14cc5e1afca26191f8 100644 (file)
@@ -2701,7 +2701,7 @@ static int qlcnic_83xx_poll_flash_status_reg(struct qlcnic_adapter *adapter)
                    QLC_83XX_FLASH_STATUS_READY)
                        break;
 
-               msleep(QLC_83XX_FLASH_STATUS_REG_POLL_DELAY);
+               usleep_range(1000, 1100);
        } while (--retries);
 
        if (!retries)
index 851cb4a80d50a6d4b2733ac2693fd799cca37885..8102673cb37f6931fd16f26d70357a594ef831ad 100644 (file)
@@ -341,7 +341,7 @@ qlcnic_pcie_sem_lock(struct qlcnic_adapter *adapter, int sem, u32 id_reg)
                        }
                        return -EIO;
                }
-               msleep(1);
+               usleep_range(1000, 1500);
        }
 
        if (id_reg)
index c4262c23ed7c77b009f6c5cebf233a54ebfd685b..be41e4c77b657285841c610c1f30a701dc2c87ee 100644 (file)
@@ -537,7 +537,7 @@ int qlcnic_pinit_from_rom(struct qlcnic_adapter *adapter)
        QLCWR32(adapter, QLCNIC_CRB_PEG_NET_3 + 0xc, 0);
        QLCWR32(adapter, QLCNIC_CRB_PEG_NET_4 + 0x8, 0);
        QLCWR32(adapter, QLCNIC_CRB_PEG_NET_4 + 0xc, 0);
-       msleep(1);
+       usleep_range(1000, 1500);
 
        QLC_SHARED_REG_WR32(adapter, QLCNIC_PEG_HALT_STATUS1, 0);
        QLC_SHARED_REG_WR32(adapter, QLCNIC_PEG_HALT_STATUS2, 0);
@@ -1198,7 +1198,7 @@ qlcnic_load_firmware(struct qlcnic_adapter *adapter)
                        flashaddr += 8;
                }
        }
-       msleep(1);
+       usleep_range(1000, 1500);
 
        QLCWR32(adapter, QLCNIC_CRB_PEG_NET_0 + 0x18, 0x1020);
        QLCWR32(adapter, QLCNIC_ROMUSB_GLB_SW_RESET, 0x80001e);
@@ -1295,7 +1295,7 @@ next:
                rc = qlcnic_validate_firmware(adapter);
                if (rc != 0) {
                        release_firmware(adapter->fw);
-                       msleep(1);
+                       usleep_range(1000, 1500);
                        goto next;
                }
        }