Re: [PATCH V2 1/1] scsi/ses: Saw "Failed to get diagnostic page 0x1"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2021-09-10 at 14:04 -0500, wenxiong@xxxxxxxxxxxxxxxxxx wrote:
> 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();

Do we know why the device is returning a UA?  Presumably it's a check
condition UA meaning the device is trying to tell us something and
wants us to request sense?

> 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, 

This grew an additional argument: you want to replace the NULL with the
sshdr, I think ... and compile test it next time.

> SES_RETRIES, NULL);

I think you want a 1 here instead of SES_RETRIES because you're
retrying for SES_RETRIES in an outer loop now, so if you maxed out both
sets of retries, you'd retry for SES_RETRIES^2.

If this is a CC/UA, you can simplify all this by setting

cmd->expecting_cc_ua = 1

and avoiding the loop.

James





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux