Re: [RESEND RFC PATCH v1] scsi: ufs: add retries for SSU

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

 



Hi Bart,

On Sat, 2020-07-18 at 13:30 -0700, Bart Van Assche wrote:
> On 2020-07-17 00:39, Lee Sang Hyun wrote:
> > -	ret = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, &sshdr,
> > -			START_STOP_TIMEOUT, 0, 0, RQF_PM, NULL);
> > -	if (ret) {
> > -		sdev_printk(KERN_WARNING, sdp,
> > -			    "START_STOP failed for power mode: %d, result %x\n",
> > -			    pwr_mode, ret);
> > -		if (driver_byte(ret) == DRIVER_SENSE)
> > -			scsi_print_sense_hdr(sdp, NULL, &sshdr);
> > +	for (retries = 0; retries < SSU_RETRIES; retries++) {
> > +		ret = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, &sshdr,
> > +				START_STOP_TIMEOUT, 0, 0, RQF_PM, NULL);
> > +		if (ret) {
> > +			sdev_printk(KERN_WARNING, sdp,
> > +				    "START_STOP failed for power mode: %d, result %x\n",
> > +				    pwr_mode, ret);
> > +			if (driver_byte(ret) == DRIVER_SENSE)
> > +				scsi_print_sense_hdr(sdp, NULL, &sshdr);
> > +		} else {
> > +			break;
> > +		}
> 
> The ninth argument of scsi_execute() is called 'retries'. Wouldn't it be
> better to pass a nonzero value as the 'retries' argument of
> scsi_execute() instead of adding a loop around the scsi_execute() call?

If a SCSI command issued via scsi_execute() encounters "timeout" or
"check condition", scsi_noretry_cmd() will return 1 (true) because
blk_rq_is_passthrough() is true due to REQ_OP_SCSI_IN or REQ_OP_SCSI_OUT
flag was set to this SCSI command by scsi_execute(). Therefore even a
non-zero 'retries' value is assigned while calling scsi_execute(), the
failed command has no chance to be retried since the decision will be
no-retry by scsi_noretry_cmd().

(Take command timeout as example)
scsi_times_out()->scsi_abort_command()->scmd_eh_abort_handler(), here
scsi_noretry_cmd() returns 1, and then command will be finished (with
error code) without retry.

In scsi_noretry_cmd(), there is a comment message in section
"check_type" as below

	/*
	 * assume caller has checked sense and determined
	 * the check condition was retryable.
	 */

I am not sure if "timeout" and "check condition" cases in such SCSI
commands issued via scsi_execute() are specially designed to be unable
to retry.

Would you have any suggestions if LLD drivers would like to retry these
kinds of SCSI commands?

Thanks a lot,
Stanley Chu





[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