All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian King <brking@us.ibm.com>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Brian King <brking@linux.vnet.ibm.com>,
	linux-scsi@vger.kernel.org, thlin@linux.vnet.ibm.com
Subject: Re: [PATCH 1/1] scsi: Add EH Start Unit retry
Date: Mon, 02 Apr 2007 08:38:18 -0500	[thread overview]
Message-ID: <4611074A.30706@us.ibm.com> (raw)
In-Reply-To: <1175445379.27675.3.camel@mulgrave.il.steeleye.com>

James Bottomley wrote:
> On Thu, 2007-03-29 at 15:25 -0500, Brian King wrote:
> This is pretty much an open coded for loop ... how about just doing a
> for loop as attached below?

Fine by me. I was simply coding it up to look like scsi_eh_tur.

Thanks,

Brian

> 
> The two advantages to this are:
> 
>      1. it's cleaner and more readable
>      2. the compiler knows how to optimize it better
> 
> James
> 
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index 7a1a1bb..28a266c 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -932,10 +932,12 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
>  	static unsigned char stu_command[6] = {START_STOP, 0, 0, 0, 1, 0};
> 
>  	if (scmd->device->allow_restart) {
> -		int rtn;
> +		int i, rtn = NEEDS_RETRY;
> +
> +		for (i = 0; rtn == NEEDS_RETRY && i < 2; i++)
> +			rtn = scsi_send_eh_cmnd(scmd, stu_command, 6,
> +						START_UNIT_TIMEOUT, 0);
> 
> -		rtn = scsi_send_eh_cmnd(scmd, stu_command, 6,
> -					START_UNIT_TIMEOUT, 0);
>  		if (rtn == SUCCESS)
>  			return 0;
>  	}
> 
> 


-- 
Brian King
eServer Storage I/O
IBM Linux Technology Center

  reply	other threads:[~2007-04-02 13:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <11751999513070-patch-mail.ibm.com>
2007-03-29 22:02 ` [PATCH 1/1] scsi: Add EH Start Unit retry Douglas Gilbert
2007-04-02 18:57   ` Brian King
2007-04-03  3:09     ` James Bottomley
2007-04-03 13:20       ` Brian King
2007-04-01 16:36 ` James Bottomley
2007-04-02 13:38   ` Brian King [this message]
2007-03-29 20:25 Brian King

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=4611074A.30706@us.ibm.com \
    --to=brking@us.ibm.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=brking@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=thlin@linux.vnet.ibm.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 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.