From: Wen Xiong <root@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxx> Reviewed-by: Brian King <brking@xxxxxxxxxxxxxxxxxx> --- 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