linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Lee Sang Hyun <sh425.lee@samsung.com>,
	linux-scsi@vger.kernel.org, alim.akhtar@samsung.com,
	avri.altman@wdc.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com, beanhuo@micron.com,
	asutoshd@codeaurora.org, cang@codeaurora.org,
	grant.jung@samsung.com, sc.suh@samsung.com, hy50.seo@samsung.com,
	kwmad.kim@samsung.com
Subject: Re: [RESEND RFC PATCH v1] scsi: ufs: add retries for SSU
Date: Sat, 18 Jul 2020 13:30:17 -0700	[thread overview]
Message-ID: <6ac05df5-71ff-e71d-a4df-94118f67caf1@acm.org> (raw)
In-Reply-To: <1594971576-40264-1-git-send-email-sh425.lee@samsung.com>

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?

Thanks,

Bart.

  reply	other threads:[~2020-07-18 20:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200717074740epcas2p2b1c8e7bf7dc28f13c5a9999373f4601b@epcas2p2.samsung.com>
2020-07-17  7:39 ` [RESEND RFC PATCH v1] scsi: ufs: add retries for SSU Lee Sang Hyun
2020-07-18 20:30   ` Bart Van Assche [this message]
2020-07-22  9:14     ` Stanley Chu
2020-07-22 15:10       ` Bart Van Assche
2020-07-25  3:10         ` Stanley Chu

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=6ac05df5-71ff-e71d-a4df-94118f67caf1@acm.org \
    --to=bvanassche@acm.org \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=cang@codeaurora.org \
    --cc=grant.jung@samsung.com \
    --cc=hy50.seo@samsung.com \
    --cc=jejb@linux.ibm.com \
    --cc=kwmad.kim@samsung.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sc.suh@samsung.com \
    --cc=sh425.lee@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).