linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomas Henzl <thenzl@redhat.com>
To: Don Brace <don.brace@pmcs.com>,
	scott.teel@pmcs.com, Kevin.Barnett@pmcs.com,
	scott.benesh@pmcs.com, james.bottomley@parallels.com,
	hch@infradead.org, Justin.Lindley@pmcs.com, elliott@hpe.com
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1 09/25] hpsa: fix physical target reset
Date: Thu, 29 Oct 2015 15:30:36 +0100	[thread overview]
Message-ID: <56322D8C.4030007@redhat.com> (raw)
In-Reply-To: <20151028220524.5323.29044.stgit@brunhilda>

On 28.10.2015 23:05, Don Brace wrote:
> From: Scott Teel <scott.teel@pmcs.com>
>
> Set reset type in device_reset_handler to do either
> logical unit reset for logical devices, or physical
> target reset, for physical devices.
>
> Reviewed-by: Scott Teel <scott.teel@pmcs.com>
> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com>
> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
> Signed-off-by: Don Brace <don.brace@pmcs.com>
> ---
>  drivers/scsi/hpsa.c |   34 ++++++++++++++++++++++++++++------
>  drivers/scsi/hpsa.h |    1 +
>  2 files changed, 29 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index 08a761c..67136fb 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -2746,9 +2746,8 @@ static int hpsa_send_reset(struct ctlr_info *h, unsigned char *scsi3addr,
>  
>  
>  	/* fill_cmd can't fail here, no data buffer to map. */
> -	(void) fill_cmd(c, HPSA_DEVICE_RESET_MSG, h, NULL, 0, 0,
> +	(void) fill_cmd(c, reset_type, h, NULL, 0, 0,
>  			scsi3addr, TYPE_MSG);
> -	c->Request.CDB[1] = reset_type; /* fill_cmd defaults to LUN reset */
>  	rc = hpsa_scsi_do_simple_cmd(h, c, reply_queue, NO_TIMEOUT);
>  	if (rc) {
>  		dev_warn(&h->pdev->dev, "Failed to send reset command\n");
> @@ -5216,6 +5215,7 @@ static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd)
>  	int rc;
>  	struct ctlr_info *h;
>  	struct hpsa_scsi_dev_t *dev;
> +	u8 reset_type;
>  	char msg[48];
>  
>  	/* find the controller to which the command to be aborted was sent */
> @@ -5254,15 +5254,23 @@ static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd)
>  	if (is_hba_lunid(dev->scsi3addr))
>  		return SUCCESS;
>  
> -	hpsa_show_dev_msg(KERN_WARNING, h, dev, "resetting");
> +	if (is_logical_dev_addr_mode(dev->scsi3addr))
> +		reset_type = HPSA_DEVICE_RESET_MSG;
> +	else
> +		reset_type = HPSA_PHYS_TARGET_RESET;
> +
> +	sprintf(msg, "resetting %s",
> +		reset_type == HPSA_DEVICE_RESET_MSG ? "logical " : "physical ");
> +	hpsa_show_dev_msg(KERN_WARNING, h, dev, msg);
>  
>  	h->reset_in_progress = 1;
>  
>  	/* send a reset to the SCSI LUN which the command was sent to */
> -	rc = hpsa_do_reset(h, dev, dev->scsi3addr, HPSA_RESET_TYPE_LUN,
> +	rc = hpsa_do_reset(h, dev, dev->scsi3addr, reset_type,
>  			   DEFAULT_REPLY_QUEUE);
> -	snprintf(msg, sizeof(msg), "reset %s",
> -		 rc == 0 ? "completed successfully" : "failed");
> +	sprintf(msg, "reset %s %s",
> +		reset_type == HPSA_DEVICE_RESET_MSG ? "logical " : "physical ",
> +		rc == 0 ? "completed successfully" : "failed");
>  	hpsa_show_dev_msg(KERN_WARNING, h, dev, msg);
>  	h->reset_in_progress = 0;
>  	return rc == 0 ? SUCCESS : FAILED;
> @@ -6379,6 +6387,20 @@ static int fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h,
>  	} else if (cmd_type == TYPE_MSG) {
>  		switch (cmd) {
>  
> +		case  HPSA_PHYS_TARGET_RESET:
> +			c->Request.CDBLen = 16;
> +			c->Request.type_attr_dir =
> +				TYPE_ATTR_DIR(cmd_type, ATTR_SIMPLE, XFER_NONE);
> +			c->Request.Timeout = 0; /* Don't time out */
> +			memset(&c->Request.CDB[0], 0, sizeof(c->Request.CDB));
> +			c->Request.CDB[0] = HPSA_RESET;
> +			c->Request.CDB[1] = HPSA_TARGET_RESET_TYPE;
> +			/* Physical target reset needs no control bytes 4-7*/
> +			c->Request.CDB[4] = 0x00;
> +			c->Request.CDB[5] = 0x00;
> +			c->Request.CDB[6] = 0x00;
> +			c->Request.CDB[7] = 0x00;
> +			break;
>  		case  HPSA_DEVICE_RESET_MSG:
>  			c->Request.CDBLen = 16;
>  			c->Request.type_attr_dir =
> diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
> index dc113c1a..04f98eb 100644
> --- a/drivers/scsi/hpsa.h
> +++ b/drivers/scsi/hpsa.h
> @@ -285,6 +285,7 @@ struct offline_device_entry {
>  #define HPSA_RESET_TYPE_BUS 0x01
>  #define HPSA_RESET_TYPE_TARGET 0x03
>  #define HPSA_RESET_TYPE_LUN 0x04
> +#define HPSA_PHYS_TARGET_RESET 0x99 /* not defined by cciss spec */

Will this new reset command work for the whole range of hpsa devices?
(and for the older cciss hw - hpsa_allow_any) ?

>  #define HPSA_MSG_SEND_RETRY_LIMIT 10
>  #define HPSA_MSG_SEND_RETRY_INTERVAL_MSECS (10000)
>  
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2015-10-29 14:30 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28 22:04 [PATCH 1 00/25] hpsa updates Don Brace
2015-10-28 22:04 ` [PATCH 1 01/25] hpsa: stop zeroing reset_cmds_out and ioaccel_cmds_out during rescan Don Brace
2015-10-29 13:25   ` Tomas Henzl
2015-10-30  7:45   ` Hannes Reinecke
2015-10-28 22:04 ` [PATCH 1 02/25] hpsa: remove unused hpsa_tag_discard_error_bits Don Brace
2015-10-29 13:26   ` Tomas Henzl
2015-10-29 14:37   ` Manoj Kumar
2015-10-29 14:49     ` Don Brace
2015-10-30  7:46   ` Hannes Reinecke
2015-10-28 22:04 ` [PATCH 1 03/25] hpsa: check for null arguments to dev_printk Don Brace
2015-10-29 13:41   ` Tomas Henzl
2015-10-29 14:41   ` Manoj Kumar
2015-10-30  7:47   ` Hannes Reinecke
2015-10-30 14:16     ` Don Brace
2015-10-28 22:04 ` [PATCH 1 04/25] hpsa: fix null device issues Don Brace
2015-10-29 14:06   ` Tomas Henzl
2015-10-30  7:49   ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 05/25] hpsa: allow driver requested rescans Don Brace
2015-10-30  7:51   ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 06/25] hpsa: abandon rescans on memory alloaction failures Don Brace
2015-10-30  7:53   ` Hannes Reinecke
2015-10-30 20:44     ` Don Brace
2015-10-28 22:05 ` [PATCH 1 07/25] hpsa: correct transfer length for 6 byte read/write commands Don Brace
2015-10-30  7:54   ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 08/25] hpsa: fix hpsa_adjust_hpsa_scsi_table Don Brace
2015-10-29 14:23   ` Tomas Henzl
2015-10-30  7:57   ` Hannes Reinecke
2015-10-30 20:46     ` Don Brace
2015-10-28 22:05 ` [PATCH 1 09/25] hpsa: fix physical target reset Don Brace
2015-10-29 14:30   ` Tomas Henzl [this message]
2015-10-29 15:29     ` Don Brace
2015-10-29 15:52       ` Tomas Henzl
2015-10-30  7:59   ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 10/25] hpsa: correct check for non-disk devices Don Brace
2015-10-29 14:37   ` Tomas Henzl
2015-10-30  8:01   ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 11/25] hpsa: correct ioaccel2 sg chain len Don Brace
2015-10-29 15:01   ` Tomas Henzl
2015-10-30  8:01   ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 12/25] hpsa: simplify check for device exposure Don Brace
2015-10-29 15:03   ` Tomas Henzl
2015-10-30  8:04   ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 13/25] hpsa: simplify update scsi devices Don Brace
2015-10-29 15:53   ` Tomas Henzl
2015-10-29 16:43   ` Matthew R. Ochs
2015-10-29 19:01     ` Don Brace
2015-10-29 20:28       ` Matthew R. Ochs
2015-10-30  8:05   ` Hannes Reinecke
2015-10-28 22:05 ` [PATCH 1 14/25] hpsa: add function is_logical_device Don Brace
2015-10-29 15:53   ` Tomas Henzl
2015-10-29 16:46   ` Matthew R. Ochs
2015-10-30  8:05   ` Hannes Reinecke
2015-10-28 22:06 ` [PATCH 1 15/25] hpsa: enhance hpsa_get_device_id Don Brace
2015-10-29 16:04   ` Tomas Henzl
2015-10-29 17:04   ` Matthew R. Ochs
2015-10-30  8:08   ` Hannes Reinecke
2015-10-30 20:59     ` Don Brace
2015-10-28 22:06 ` [PATCH 1 16/25] hpsa: refactor hpsa_figure_bus_target_lun Don Brace
2015-10-29 16:27   ` Tomas Henzl
2015-10-30  8:09   ` Hannes Reinecke
2015-10-28 22:06 ` [PATCH 1 17/25] hpsa: move scsi_add_device and scsi_remove_device calls to new function Don Brace
2015-10-29 16:37   ` Tomas Henzl
2015-10-29 17:21   ` Matthew R. Ochs
2015-10-29 20:30     ` Don Brace
2015-10-30 15:56       ` Matthew R. Ochs
2015-10-30  8:09   ` Hannes Reinecke
2015-10-28 22:06 ` [PATCH 1 18/25] External array LUNs must use target and lun numbers assigned by the Don Brace
2015-10-29 19:41   ` Matthew R. Ochs
2015-10-30  8:11   ` Hannes Reinecke
2015-10-30 14:11   ` Tomas Henzl
2015-10-28 22:06 ` [PATCH 1 19/25] hpsa: eliminate fake lun0 enclosures Don Brace
2015-10-29 20:05   ` Matthew R. Ochs
2015-10-30  8:12   ` Hannes Reinecke
2015-10-30 14:12   ` Tomas Henzl
2015-10-28 22:06 ` [PATCH 1 20/25] hpsa: add discovery polling for PT RAID devices Don Brace
2015-10-29 20:20   ` Matthew R. Ochs
     [not found]     ` <563286B7.8070200@pmcs.com>
2015-10-29 20:59       ` Matthew R. Ochs
2015-10-30 14:08         ` Don Brace
2015-10-30 15:58           ` Matthew R. Ochs
2015-10-30  8:15   ` Hannes Reinecke
2015-10-28 22:06 ` [PATCH 1 21/25] hpsa: disable report lun data caching Don Brace
2015-10-30  8:16   ` Hannes Reinecke
2015-10-30 14:25   ` Tomas Henzl
2015-10-30 21:18     ` Don Brace
2015-10-30 16:27   ` Matthew R. Ochs
2015-10-28 22:06 ` [PATCH 1 22/25] hpsa: enhance device messages Don Brace
2015-10-30  8:16   ` Hannes Reinecke
2015-10-30 14:32   ` Tomas Henzl
2015-11-02 16:54     ` Don Brace
2015-11-03 13:12       ` Tomas Henzl
2015-10-30 16:53   ` Matthew R. Ochs
2015-10-28 22:06 ` [PATCH 1 23/25] hpsa: fix multiple issues in path_info_show Don Brace
2015-10-30  8:18   ` Hannes Reinecke
2015-10-30 14:33   ` Tomas Henzl
2015-10-30 17:07   ` Matthew R. Ochs
2015-10-28 22:06 ` [PATCH 1 24/25] hpsa: add in sas transport class Don Brace
2015-10-30  8:21   ` Hannes Reinecke
2015-10-30 14:40   ` Tomas Henzl
2015-10-30 20:07   ` Matthew R. Ochs
2015-10-30 22:00     ` Don Brace
2015-10-30 23:23       ` Matthew R. Ochs
2015-11-03  0:40   ` kbuild test robot
2015-10-28 22:07 ` [PATCH 1 25/25] hpsa: bump the driver version Don Brace
2015-10-30  8:22   ` Hannes Reinecke
2015-10-30 14:44   ` Tomas Henzl
2015-10-30 20:08   ` Matthew R. Ochs
2015-11-03  4:49 ` [PATCH 1 00/25] hpsa updates Martin K. Petersen

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=56322D8C.4030007@redhat.com \
    --to=thenzl@redhat.com \
    --cc=Justin.Lindley@pmcs.com \
    --cc=Kevin.Barnett@pmcs.com \
    --cc=don.brace@pmcs.com \
    --cc=elliott@hpe.com \
    --cc=hch@infradead.org \
    --cc=james.bottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=scott.benesh@pmcs.com \
    --cc=scott.teel@pmcs.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).