diff options
author | akshatzen <akshatzen@google.com> | 2020-11-02 19:55:27 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-11-05 06:55:38 +0300 |
commit | 48cd6b38eb4f2874f091c4776ea1c26e7e4f967e (patch) | |
tree | 45dc0bd68e8e0b5ea369949676719bfd6b1c5fec /drivers/scsi/pm8001/pm80xx_hwi.h | |
parent | 4a2efd4b89fcaa6e9a7b4ce49a441afaacba00ea (diff) | |
download | linux-48cd6b38eb4f2874f091c4776ea1c26e7e4f967e.tar.xz |
scsi: pm80xx: Avoid busywait in FW ready check
In function check_fw_ready() we busy wait using udelay. The CPU is not
released and we see need_resched failures.
Busy waiting is not necessary since we are in process context and we can
sleep instead. Replace udelay with msleep of 20 ms intervals while waiting
for firmware to become ready.
It has been verified that check_fw_ready is not being used in interrupt
context anywhere, hence it is safe to make this change.
Link: https://lore.kernel.org/r/20201102165528.26510-4-Viswas.G@microchip.com.com
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: akshatzen <akshatzen@google.com>
Signed-off-by: Viswas G <Viswas.G@microchip.com>
Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com>
Signed-off-by: Radha Ramachandran <radha@google.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/pm8001/pm80xx_hwi.h')
-rw-r--r-- | drivers/scsi/pm8001/pm80xx_hwi.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h index 701951a0f715..ec48bc276de6 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.h +++ b/drivers/scsi/pm8001/pm80xx_hwi.h @@ -1639,3 +1639,9 @@ typedef struct SASProtocolTimerConfig SASProtocolTimerConfig_t; #define MEMBASE_II_SHIFT_REGISTER 0x1010 #endif + +/** + * As we know sleep (1~20) ms may result in sleep longer than ~20 ms, hence we + * choose 20 ms interval. + */ +#define FW_READY_INTERVAL 20 |