diff mbox series

[smartpqi,updates,V2,08/11] smartpqi: fix boot failure during lun rebuild

Message ID 20210928235442.201875-9-don.brace@microchip.com (mailing list archive)
State Accepted
Headers show
Series smartpqi updates | expand

Commit Message

Don Brace Sept. 28, 2021, 11:54 p.m. UTC
From: Mike McGowen <Mike.McGowen@microchip.com>

Move the delay in the register polling loop to
the beginning of the loop to ensure there is always
a delay between writing the register and reading it.

Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Mike McGowen <Mike.McGowen@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

John Donnelly Sept. 30, 2021, 6:24 p.m. UTC | #1
On 9/28/21 6:54 PM, Don Brace wrote:
> From: Mike McGowen <Mike.McGowen@microchip.com>
> 
> Move the delay in the register polling loop to
> the beginning of the loop to ensure there is always
> a delay between writing the register and reading it.
> 
> Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
> Reviewed-by: Scott Teel <scott.teel@microchip.com>
> Signed-off-by: Mike McGowen <Mike.McGowen@microchip.com>
> Signed-off-by: Don Brace <don.brace@microchip.com>


Acked-by: John Donnelly <john.p.donnelly@oracle.com>


> ---
>   drivers/scsi/smartpqi/smartpqi_init.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
> index 1e27e6ba0159..c28eb7ea4a24 100644
> --- a/drivers/scsi/smartpqi/smartpqi_init.c
> +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> @@ -4278,12 +4278,12 @@ static int pqi_create_admin_queues(struct pqi_ctrl_info *ctrl_info)
>   
>   	timeout = PQI_ADMIN_QUEUE_CREATE_TIMEOUT_JIFFIES + jiffies;
>   	while (1) {
> +		msleep(PQI_ADMIN_QUEUE_CREATE_POLL_INTERVAL_MSECS);
>   		status = readb(&pqi_registers->function_and_status_code);
>   		if (status == PQI_STATUS_IDLE)
>   			break;
>   		if (time_after(jiffies, timeout))
>   			return -ETIMEDOUT;
> -		msleep(PQI_ADMIN_QUEUE_CREATE_POLL_INTERVAL_MSECS);
>   	}
>   
>   	/*
>
diff mbox series

Patch

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 1e27e6ba0159..c28eb7ea4a24 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -4278,12 +4278,12 @@  static int pqi_create_admin_queues(struct pqi_ctrl_info *ctrl_info)
 
 	timeout = PQI_ADMIN_QUEUE_CREATE_TIMEOUT_JIFFIES + jiffies;
 	while (1) {
+		msleep(PQI_ADMIN_QUEUE_CREATE_POLL_INTERVAL_MSECS);
 		status = readb(&pqi_registers->function_and_status_code);
 		if (status == PQI_STATUS_IDLE)
 			break;
 		if (time_after(jiffies, timeout))
 			return -ETIMEDOUT;
-		msleep(PQI_ADMIN_QUEUE_CREATE_POLL_INTERVAL_MSECS);
 	}
 
 	/*