All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Ravi Anand <ravi.anand@qlogic.com>
Cc: James Bottomley <james.bottomley@suse.de>,
	Linux-SCSI Mailing List <linux-scsi@vger.kernel.org>,
	Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Subject: Re: [PATCH 01/12] qla4xxx: wait for device to come online in reset_lun
Date: Tue, 06 Apr 2010 22:35:41 -0500	[thread overview]
Message-ID: <4BBBFD8D.2000003@cs.wisc.edu> (raw)
In-Reply-To: <20100406101333.GH22922@linux-qf4p>

On 04/06/2010 05:13 AM, Ravi Anand wrote:
>
> From: Vikas Chaudhary<vikas.chaudhary@qlogic.com>
>
> wait upto 10s for device to come online otherwise indicating
> an error condition.
>
> Signed-off-by: Vikas Chaudhary<vikas.chaudhary@qlogic.com>
> Signed-off-by: Ravi Anand<ravi.anand@qlogic.com>
> ---
>   drivers/scsi/qla4xxx/ql4_def.h |    1 +
>   drivers/scsi/qla4xxx/ql4_mbx.c |   22 ++++++++++++++++++++++
>   2 files changed, 23 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
> index 81b5f29..38e261d 100644
> --- a/drivers/scsi/qla4xxx/ql4_def.h
> +++ b/drivers/scsi/qla4xxx/ql4_def.h
> @@ -146,6 +146,7 @@
>   #define ISNS_DEREG_TOV			5
>
>   #define MAX_RESET_HA_RETRIES		2
> +#define DEVICE_ONLINE_TOV		10
>
>   /*
>    * SCSI Request Block structure	 (srb)	that is placed
> diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
> index 09d6d4b..4d8b3cb 100644
> --- a/drivers/scsi/qla4xxx/ql4_mbx.c
> +++ b/drivers/scsi/qla4xxx/ql4_mbx.c
> @@ -679,11 +679,33 @@ int qla4xxx_reset_lun(struct scsi_qla_host * ha, struct ddb_entry * ddb_entry,
>   	uint32_t mbox_cmd[MBOX_REG_COUNT];
>   	uint32_t mbox_sts[MBOX_REG_COUNT];
>   	int status = QLA_SUCCESS;
> +	unsigned long wait_online;
>
>   	DEBUG2(printk("scsi%ld:%d:%d: lun reset issued\n", ha->host_no,
>   		      ddb_entry->os_target_id, lun));
>
>   	/*
> +	 * If device is not online wait for 10 sec for device to come online.
> +	 * else return error
> +	 */
> +	if (atomic_read(&ddb_entry->state) != DDB_STATE_ONLINE) {
> +		wait_online = jiffies + (DEVICE_ONLINE_TOV * HZ);
> +		while (time_before(jiffies, wait_online)) {
> +			set_current_state(TASK_INTERRUPTIBLE);
> +			schedule_timeout(HZ);
> +			if (atomic_read(&ddb_entry->state) == DDB_STATE_ONLINE)
> +				break;
> +		}
> +
> +		if (atomic_read(&ddb_entry->state) != DDB_STATE_ONLINE) {
> +			DEBUG2(printk(KERN_WARNING "scsi%ld: %s: Unable to "
> +					"reset lun. Device is not online.\n",
> +					ha->host_no, __func__));
> +			return QLA_ERROR;
> +		}
> +	}
> +


This looks similar to what you sent back in Feb. I said to wait in the 
target reset handler for the session to come back or for 
qla4xxx_recovery_timedout to be called

      reply	other threads:[~2010-04-07  3:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-06 10:13 [PATCH 01/12] qla4xxx: wait for device to come online in reset_lun Ravi Anand
2010-04-07  3:35 ` Mike Christie [this message]

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=4BBBFD8D.2000003@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=james.bottomley@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ravi.anand@qlogic.com \
    --cc=vikas.chaudhary@qlogic.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.