scsi: pm80xx: Avoid busywait in FW ready check
authorakshatzen <akshatzen@google.com>
Mon, 2 Nov 2020 16:55:27 +0000 (22:25 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 5 Nov 2020 03:55:38 +0000 (22:55 -0500)
commit48cd6b38eb4f2874f091c4776ea1c26e7e4f967e
tree45dc0bd68e8e0b5ea369949676719bfd6b1c5fec
parent4a2efd4b89fcaa6e9a7b4ce49a441afaacba00ea
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>
drivers/scsi/pm8001/pm80xx_hwi.c
drivers/scsi/pm8001/pm80xx_hwi.h