scsi: pm80xx: Increase timeout for pm80xx mpi_uninit_check()
authorIgor Pylypiv <ipylypiv@google.com>
Tue, 6 Apr 2021 18:05:33 +0000 (11:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:50:26 +0000 (09:50 +0200)
[ Upstream commit 3f744a14f331f56703a9d74e86520db045f11831 ]

The mpi_uninit_check() takes longer for inbound doorbell register to be
cleared. Increase the timeout substantially so that the driver does not
fail to load.

Previously, the inbound doorbell wait time was mistakenly increased in the
mpi_init_check() instead of mpi_uninit_check(). It is okay to leave the
mpi_init_check() wait time as-is as these are timeout values and if there
is a failure, waiting longer is not an issue.

Link: https://lore.kernel.org/r/20210406180534.1924345-2-ipylypiv@google.com
Fixes: e90e236250e9 ("scsi: pm80xx: Increase timeout for pm80xx mpi_uninit_check")
Reviewed-by: Vishakha Channapattan <vishakhavc@google.com>
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/pm8001/pm80xx_hwi.c

index 055f7649676ec468b7db17a229ca875481a36b91..27b354860a16e95abba82ecbd53466ec50d41d59 100644 (file)
@@ -1488,9 +1488,9 @@ static int mpi_uninit_check(struct pm8001_hba_info *pm8001_ha)
 
        /* wait until Inbound DoorBell Clear Register toggled */
        if (IS_SPCV_12G(pm8001_ha->pdev)) {
-               max_wait_count = 4 * 1000 * 1000;/* 4 sec */
+               max_wait_count = 30 * 1000 * 1000; /* 30 sec */
        } else {
-               max_wait_count = 2 * 1000 * 1000;/* 2 sec */
+               max_wait_count = 15 * 1000 * 1000; /* 15 sec */
        }
        do {
                udelay(1);