Thread (17 messages) 17 messages, 2 authors, 2021-01-05

Re: [PATCH 1/8] pm80xx: No busywait in MPI init check

From: Jinpu Wang <jinpu.wang@cloud.ionos.com>
Date: 2021-01-04 06:46:09

On Wed, Dec 30, 2020 at 5:47 AM Viswas G [off-list ref] wrote:
From: akshatzen <redacted>

We do not need to busy wait during mpi_init_check. I confirmed that
mpi_init_check is not being invoked in an ATOMIC context. It is being
called from pm8001_pci_resume, pm8001_pci_probe. Hence we are
replacing the udelay which busy waits with msleep.

Signed-off-by: akshatzen <redacted>
Signed-off-by: Viswas G <redacted>
Signed-off-by: Ruksar Devadi <redacted>
Signed-off-by: Radha Ramachandran <redacted>
Thanks akshatzen!
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
quoted hunk ↗ jump to hunk
---
 drivers/scsi/pm8001/pm80xx_hwi.c | 6 +++---
 drivers/scsi/pm8001/pm80xx_hwi.h | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index 6772b0924dac..9c4b8b374ab8 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -997,7 +997,7 @@ static int mpi_init_check(struct pm8001_hba_info *pm8001_ha)
                max_wait_count = SPC_DOORBELL_CLEAR_TIMEOUT;
        }
        do {
-               udelay(1);
+               msleep(FW_READY_INTERVAL);
                value = pm8001_cr32(pm8001_ha, 0, MSGU_IBDB_SET);
                value &= SPCv_MSGU_CFG_TABLE_UPDATE;
        } while ((value != 0) && (--max_wait_count));
@@ -1010,9 +1010,9 @@ static int mpi_init_check(struct pm8001_hba_info *pm8001_ha)
                return -EBUSY;
        }
        /* check the MPI-State for initialization upto 100ms*/
-       max_wait_count = 100 * 1000;/* 100 msec */
+       max_wait_count = 5;/* 100 msec */
        do {
-               udelay(1);
+               msleep(FW_READY_INTERVAL);
                gst_len_mpistate =
                        pm8001_mr32(pm8001_ha->general_stat_tbl_addr,
                                        GST_GSTLEN_MPIS_OFFSET);
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h
index ec48bc276de6..2b6b52551968 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.h
+++ b/drivers/scsi/pm8001/pm80xx_hwi.h
@@ -220,8 +220,8 @@
 #define SAS_DOPNRJT_RTRY_TMO            128
 #define SAS_COPNRJT_RTRY_TMO            128

-#define SPCV_DOORBELL_CLEAR_TIMEOUT    (30 * 1000 * 1000) /* 30 sec */
-#define SPC_DOORBELL_CLEAR_TIMEOUT     (15 * 1000 * 1000) /* 15 sec */
+#define SPCV_DOORBELL_CLEAR_TIMEOUT    (30 * 50) /* 30 sec */
+#define SPC_DOORBELL_CLEAR_TIMEOUT     (15 * 50) /* 15 sec */

 /*
   Making ORR bigger than IT NEXUS LOSS which is 2000000us = 2 second.
--
2.16.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help