From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Steve Sistare <steven.sistare@oracle.com>,
Sumit Saxena <sumit.saxena@broadcom.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Sasha Levin <sashal@kernel.org>,
megaraidlinux.pdl@broadcom.com, linux-scsi@vger.kernel.org
Subject: [PATCH AUTOSEL 4.14 132/371] scsi: megaraid_sas: reduce module load time
Date: Thu, 16 Jan 2020 12:20:04 -0500 [thread overview]
Message-ID: <20200116172403.18149-75-sashal@kernel.org> (raw)
In-Reply-To: <20200116172403.18149-1-sashal@kernel.org>
From: Steve Sistare <steven.sistare@oracle.com>
[ Upstream commit 31b6a05f86e690e1818116fd23c3be915cc9d9ed ]
megaraid_sas takes 1+ seconds to load while waiting for firmware:
[2.822603] megaraid_sas 0000:03:00.0: Waiting for FW to come to ready state
[3.871003] megaraid_sas 0000:03:00.0: FW now in Ready state
This is due to the following loop in megasas_transition_to_ready(), which
waits a minimum of 1 second, even though the FW becomes ready in tens of
millisecs:
/*
* The cur_state should not last for more than max_wait secs
*/
for (i = 0; i < max_wait; i++) {
...
msleep(1000);
...
dev_info(&instance->pdev->dev, "FW now in Ready state\n");
This is a regression, caused by a change of the msleep granularity from 1
to 1000 due to concern about waiting too long on systems with coarse
jiffies.
To fix, increase iterations and use msleep(20), which results in:
[2.670627] megaraid_sas 0000:03:00.0: Waiting for FW to come to ready state
[2.739386] megaraid_sas 0000:03:00.0: FW now in Ready state
Fixes: fb2f3e96d80f ("scsi: megaraid_sas: Fix msleep granularity")
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/megaraid/megaraid_sas_base.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 577513649afb..6abad63b127a 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -3823,12 +3823,12 @@ megasas_transition_to_ready(struct megasas_instance *instance, int ocr)
/*
* The cur_state should not last for more than max_wait secs
*/
- for (i = 0; i < max_wait; i++) {
+ for (i = 0; i < max_wait * 50; i++) {
curr_abs_state = instance->instancet->
read_fw_status_reg(instance->reg_set);
if (abs_state == curr_abs_state) {
- msleep(1000);
+ msleep(20);
} else
break;
}
--
2.20.1
next parent reply other threads:[~2020-01-16 17:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200116172403.18149-1-sashal@kernel.org>
2020-01-16 17:20 ` Sasha Levin [this message]
2020-01-16 17:20 ` [PATCH AUTOSEL 4.14 158/371] scsi: qla2xxx: Unregister chrdev if module initialization fails Sasha Levin
2020-01-16 17:20 ` [PATCH AUTOSEL 4.14 159/371] scsi: target/core: Fix a race condition in the LUN lookup code Sasha Levin
2020-01-16 17:20 ` [PATCH AUTOSEL 4.14 174/371] scsi: qla2xxx: Fix a format specifier Sasha Levin
2020-01-16 17:20 ` [PATCH AUTOSEL 4.14 175/371] scsi: qla2xxx: Avoid that qlt_send_resp_ctio() corrupts memory Sasha Levin
2020-01-16 17:22 ` [PATCH AUTOSEL 4.14 248/371] scsi: libfc: fix null pointer dereference on a null lport Sasha Levin
2020-01-16 17:22 ` [PATCH AUTOSEL 4.14 290/371] scsi: fnic: fix msix interrupt allocation Sasha Levin
2020-01-16 17:23 ` [PATCH AUTOSEL 4.14 339/371] scsi: esas2r: unlock on error in esas2r_nvram_read_direct() Sasha Levin
2020-01-16 17:23 ` [PATCH AUTOSEL 4.14 342/371] scsi: core: scsi_trace: Use get_unaligned_be*() Sasha Levin
2020-01-16 17:23 ` [PATCH AUTOSEL 4.14 357/371] scsi: qla4xxx: fix double free bug Sasha Levin
2020-01-16 17:23 ` [PATCH AUTOSEL 4.14 358/371] scsi: bnx2i: fix potential use after free Sasha Levin
2020-01-16 17:23 ` [PATCH AUTOSEL 4.14 359/371] scsi: target: core: Fix a pr_debug() argument Sasha Levin
2020-01-16 17:23 ` [PATCH AUTOSEL 4.14 365/371] scsi: qla2xxx: fix rports not being mark as lost in sync fabric scan Sasha Levin
2020-01-16 17:23 ` [PATCH AUTOSEL 4.14 366/371] scsi: qla2xxx: Fix qla2x00_request_irqs() for MSI Sasha Levin
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=20200116172403.18149-75-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=megaraidlinux.pdl@broadcom.com \
--cc=stable@vger.kernel.org \
--cc=steven.sistare@oracle.com \
--cc=sumit.saxena@broadcom.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;
as well as URLs for NNTP newsgroup(s).