From: Hannes Reinecke <hare@suse.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
James Bottomley <james.bottomley@hansenpartnership.com>,
Sumit Saxena <sumit.saxena@broadcom.com>,
Kashyap Desai <kashyap.desai@broadcom.com>,
megaraidlinux.pdl@broadcom.com, linux-scsi@vger.kernel.org,
Hannes Reinecke <hare@suse.de>, Hannes Reinecke <hare@suse.com>
Subject: [PATCH] megaraid_sas: boot hangs while LD is offline
Date: Tue, 15 Aug 2017 13:59:15 +0200 [thread overview]
Message-ID: <1502798355-59330-1-git-send-email-hare@suse.de> (raw)
Offline Logical drives (LDs) should not allowed to be visible
to the OS, as the OS will hang trying to send commands to it.
This patch skips offline LDs like it already does for
non-system physical drives (PDs).
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/megaraid/megaraid_sas_base.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 5202c2f..39b08fc 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -1897,14 +1897,19 @@ static void megasas_set_static_target_properties(struct scsi_device *sdev,
static int megasas_slave_configure(struct scsi_device *sdev)
{
- u16 pd_index = 0;
+ u16 pd_index = 0, ld_index;
struct megasas_instance *instance;
int ret_target_prop = DCMD_FAILED;
bool is_target_prop = false;
instance = megasas_lookup_instance(sdev->host->host_no);
if (instance->pd_list_not_supported) {
- if (!MEGASAS_IS_LOGICAL(sdev) && sdev->type == TYPE_DISK) {
+ if (MEGASAS_IS_LOGICAL(sdev)) {
+ ld_index = ((sdev->channel - MEGASAS_MAX_PD_CHANNELS) *
+ MEGASAS_MAX_DEV_PER_CHANNEL) + sdev->id;
+ if (instance->ld_ids[ld_index] == 0xff)
+ return -ENXIO;
+ } else if (sdev->type == TYPE_DISK) {
pd_index = (sdev->channel * MEGASAS_MAX_DEV_PER_CHANNEL) +
sdev->id;
if (instance->pd_list[pd_index].driveState !=
--
1.8.5.6
next reply other threads:[~2017-08-15 11:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-15 11:59 Hannes Reinecke [this message]
2017-08-16 13:05 ` [PATCH] megaraid_sas: boot hangs while LD is offline Sumit Saxena
2017-08-16 13:06 ` Hannes Reinecke
-- strict thread matches above, loose matches on Subject: below --
2016-01-15 13:43 Hannes Reinecke
2016-01-18 5:48 ` Kashyap Desai
2016-01-18 6:54 ` Hannes Reinecke
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=1502798355-59330-1-git-send-email-hare@suse.de \
--to=hare@suse.de \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=james.bottomley@hansenpartnership.com \
--cc=kashyap.desai@broadcom.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=megaraidlinux.pdl@broadcom.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