public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Viswas G <Viswas.G@microchip.com.com>
To: <linux-scsi@vger.kernel.org>
Cc: <Vasanthalakshmi.Tharmarajan@microchip.com>,
	<Viswas.G@microchip.com>, <Ruksar.devadi@microchip.com>,
	<yuuzheng@google.com>, <vishakhavc@google.com>,
	<radha@google.com>, <akshatzen@google.com>,
	<bjashnani@google.com>, <jinpu.wang@cloud.ionos.com>
Subject: [PATCH 1/8] pm80xx: No busywait in MPI init check
Date: Wed, 30 Dec 2020 10:27:36 +0530	[thread overview]
Message-ID: <20201230045743.14694-2-Viswas.G@microchip.com.com> (raw)
In-Reply-To: <20201230045743.14694-1-Viswas.G@microchip.com.com>

From: akshatzen <akshatzen@google.com>

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 <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>
---
 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


  reply	other threads:[~2020-12-30  4:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30  4:57 [PATCH 0/8] pm80xx updates Viswas G
2020-12-30  4:57 ` Viswas G [this message]
2021-01-04  6:45   ` [PATCH 1/8] pm80xx: No busywait in MPI init check Jinpu Wang
2020-12-30  4:57 ` [PATCH 2/8] pm80xx: check fatal error Viswas G
2021-01-05 13:19   ` Jinpu Wang
2020-12-30  4:57 ` [PATCH 3/8] pm80xx: check main config table address Viswas G
2021-01-05 13:23   ` Jinpu Wang
2020-12-30  4:57 ` [PATCH 4/8] pm80xx: fix missing tag_free in NVMD DATA req Viswas G
2021-01-05 13:24   ` Jinpu Wang
2020-12-30  4:57 ` [PATCH 5/8] pm80xx: fix driver fatal dump failure Viswas G
2021-01-05 13:25   ` Jinpu Wang
2020-12-30  4:57 ` [PATCH 6/8] pm80xx: Simultaneous poll for all FW readiness Viswas G
2021-01-05 13:31   ` Jinpu Wang
2020-12-30  4:57 ` [PATCH 7/8] pm80xx: Log SATA IOMB completion status on failure Viswas G
2021-01-05 13:33   ` Jinpu Wang
2020-12-30  4:57 ` [PATCH 8/8] pm80xx: Add sysfs attribute for ioc health Viswas G
2021-01-05 13:35   ` Jinpu Wang
2021-01-08  3:21 ` [PATCH 0/8] pm80xx updates Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201230045743.14694-2-Viswas.G@microchip.com.com \
    --to=viswas.g@microchip.com.com \
    --cc=Ruksar.devadi@microchip.com \
    --cc=Vasanthalakshmi.Tharmarajan@microchip.com \
    --cc=Viswas.G@microchip.com \
    --cc=akshatzen@google.com \
    --cc=bjashnani@google.com \
    --cc=jinpu.wang@cloud.ionos.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=radha@google.com \
    --cc=vishakhavc@google.com \
    --cc=yuuzheng@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox