All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/1] scsi/ses: Saw "Failed to get diagnostic page 0x1"
@ 2021-09-10 19:04 wenxiong
  2021-09-11  0:23   ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: wenxiong @ 2021-09-10 19:04 UTC (permalink / raw)
  To: jejb; +Cc: linux-scsi, brking1, martin.petersen, wenxiong, Wen Xiong, Wen Xiong

From: Wen Xiong <root@ltczz405-lp2.aus.stglabs.ibm.com>

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

From scsi logging level with error=3, looks ses_recv_diag not try on a UA.
The patch addes retrying on a UA in ses_recv_diag();

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

diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c
index c2afba2a5414..93f6a8ce1bea 100644
--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -87,9 +87,16 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code,
 		0
 	};
 	unsigned char recv_page_code;
+	struct scsi_sense_hdr sshdr;
+	int retries = SES_RETRIES;
+
+	do {
+		ret =  scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf,
+			bufflen, &sshdr, NULL, SES_TIMEOUT, SES_RETRIES, NULL);
+
+	} while (scsi_sense_valid(&sshdr) &&
+                 sshdr.sense_key == UNIT_ATTENTION && --retries);
 
-	ret =  scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, bufflen,
-				NULL, SES_TIMEOUT, SES_RETRIES, NULL);
 	if (unlikely(ret))
 		return ret;
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-09-14 18:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10 19:04 [PATCH V2 1/1] scsi/ses: Saw "Failed to get diagnostic page 0x1" wenxiong
2021-09-11  0:23 ` kernel test robot
2021-09-11  0:23   ` kernel test robot
2021-09-11  0:44 ` James Bottomley
     [not found]   ` <f754c31d348465f96ad4cd7541a86168@imap.linux.ibm.com>
2021-09-13 21:13     ` Martin K. Petersen
     [not found]     ` <OF31B21169.103CCF65-ON0025874F.00776468-0025874F.00778F79@ibm.com>
2021-09-14 15:27       ` Martin K. Petersen
2021-09-14 15:50         ` James Bottomley
2021-09-14 18:13           ` Martin K. Petersen
2021-09-14 15:52 ` Martin K. Petersen

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.