Commit c1b2037f authored by Jitendra Kalsaria's avatar Jitendra Kalsaria Committed by David S. Miller

qlcnic: Use usleep_range() instead of msleep() for sleep less than 20ms

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: default avatarJitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: default avatarShahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 40e2b8ed
...@@ -2701,7 +2701,7 @@ static int qlcnic_83xx_poll_flash_status_reg(struct qlcnic_adapter *adapter) ...@@ -2701,7 +2701,7 @@ static int qlcnic_83xx_poll_flash_status_reg(struct qlcnic_adapter *adapter)
QLC_83XX_FLASH_STATUS_READY) QLC_83XX_FLASH_STATUS_READY)
break; break;
msleep(QLC_83XX_FLASH_STATUS_REG_POLL_DELAY); usleep_range(1000, 1100);
} while (--retries); } while (--retries);
if (!retries) if (!retries)
......
...@@ -341,7 +341,7 @@ qlcnic_pcie_sem_lock(struct qlcnic_adapter *adapter, int sem, u32 id_reg) ...@@ -341,7 +341,7 @@ qlcnic_pcie_sem_lock(struct qlcnic_adapter *adapter, int sem, u32 id_reg)
} }
return -EIO; return -EIO;
} }
msleep(1); usleep_range(1000, 1500);
} }
if (id_reg) if (id_reg)
......
...@@ -537,7 +537,7 @@ int qlcnic_pinit_from_rom(struct qlcnic_adapter *adapter) ...@@ -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_3 + 0xc, 0);
QLCWR32(adapter, QLCNIC_CRB_PEG_NET_4 + 0x8, 0); QLCWR32(adapter, QLCNIC_CRB_PEG_NET_4 + 0x8, 0);
QLCWR32(adapter, QLCNIC_CRB_PEG_NET_4 + 0xc, 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_STATUS1, 0);
QLC_SHARED_REG_WR32(adapter, QLCNIC_PEG_HALT_STATUS2, 0); QLC_SHARED_REG_WR32(adapter, QLCNIC_PEG_HALT_STATUS2, 0);
...@@ -1198,7 +1198,7 @@ qlcnic_load_firmware(struct qlcnic_adapter *adapter) ...@@ -1198,7 +1198,7 @@ qlcnic_load_firmware(struct qlcnic_adapter *adapter)
flashaddr += 8; flashaddr += 8;
} }
} }
msleep(1); usleep_range(1000, 1500);
QLCWR32(adapter, QLCNIC_CRB_PEG_NET_0 + 0x18, 0x1020); QLCWR32(adapter, QLCNIC_CRB_PEG_NET_0 + 0x18, 0x1020);
QLCWR32(adapter, QLCNIC_ROMUSB_GLB_SW_RESET, 0x80001e); QLCWR32(adapter, QLCNIC_ROMUSB_GLB_SW_RESET, 0x80001e);
...@@ -1295,7 +1295,7 @@ void qlcnic_request_firmware(struct qlcnic_adapter *adapter) ...@@ -1295,7 +1295,7 @@ void qlcnic_request_firmware(struct qlcnic_adapter *adapter)
rc = qlcnic_validate_firmware(adapter); rc = qlcnic_validate_firmware(adapter);
if (rc != 0) { if (rc != 0) {
release_firmware(adapter->fw); release_firmware(adapter->fw);
msleep(1); usleep_range(1000, 1500);
goto next; goto next;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment