All of lore.kernel.org
 help / color / mirror / Atom feed
From: wenxiong@linux.vnet.ibm.com
To: jejb@linux.ibm.com
Cc: linux-scsi@vger.kernel.org, brking1@linux.vnet.ibm.com,
	wenxiong@us.ibm.com, Wen Xiong <wenxiong@linux.vnet.ibm.com>
Subject: [PATCH 1/1] scsi/ses: Saw "Failed to get diagnostic page 0x1" during
Date: Tue, 17 Aug 2021 14:57:35 -0500	[thread overview]
Message-ID: <1629230255-11616-1-git-send-email-wenxiong@linux.vnet.ibm.com> (raw)

From: Wen Xiong <wenxiong@linux.vnet.ibm.com>

We saw two errors with Slider drawer:
- Failed to get diagnostic page 0x1 during booting up
- /sys/class/enclosure are empty with ipr adapter + Slider drawer

From scsi logging level with error=3, looks ses_recv_diag not try on a UA.
Added scsi_test_unit_ready() which retried with UA. The patch fixes
both of above errors.

Signed-Off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Reviewed-by: Brian King <brking@linux.vnet.ibm.com>
---
 drivers/scsi/ses.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c
index c2afba2a5414..5811639a0747 100644
--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -633,6 +633,8 @@ static int ses_intf_add(struct device *cdev,
 	int num_enclosures;
 	struct enclosure_device *edev;
 	struct ses_component *scomp = NULL;
+	struct scsi_sense_hdr sshdr;
+	int ret;
 
 	if (!scsi_device_enclosure(sdev)) {
 		/* not an enclosure, but might be in one */
@@ -654,6 +656,10 @@ static int ses_intf_add(struct device *cdev,
 	if (!hdr_buf || !ses_dev)
 		goto err_init_free;
 
+	ret = scsi_test_unit_ready(sdev, SES_TIMEOUT, SES_RETRIES, &sshdr);
+	if (!scsi_status_is_good(ret))
+		goto err_init_free;
+
 	page = 1;
 	result = ses_recv_diag(sdev, page, hdr_buf, INIT_ALLOC_SIZE);
 	if (result)
-- 
2.27.0


             reply	other threads:[~2021-08-17 21:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17 19:57 wenxiong [this message]
2021-09-08  4:12 ` [PATCH 1/1] scsi/ses: Saw "Failed to get diagnostic page 0x1" during 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=1629230255-11616-1-git-send-email-wenxiong@linux.vnet.ibm.com \
    --to=wenxiong@linux.vnet.ibm.com \
    --cc=brking1@linux.vnet.ibm.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=wenxiong@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.