public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
To: james.bottomley@hansenpartnership.com
Cc: dab@hp.com, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org, stephenmcameron@gmail.com,
	joseph.t.handzik@hp.com, thenzl@redhat.com,
	michael.miller@canonical.com, scott.teel@hp.com
Subject: [PATCH 23/35] hpsa: rescan devices on ioaccel2 error
Date: Tue, 18 Feb 2014 13:57:05 -0600	[thread overview]
Message-ID: <20140218195705.15787.87376.stgit@beardog.cce.hp.com> (raw)
In-Reply-To: <20140218195251.15787.55872.stgit@beardog.cce.hp.com>

From: Scott Teel <scott.teel@hp.com>

Allow driver to schedule a rescan whenever a request fails on the ioaccel2 path.
This eliminates the possibility of driver getting stuck in non-ioaccel mode.

IOaccel mode (HP SSD Smart Path) is disabled by driver upon error detection.
Driver relied on idea that request would be retried through normal path, and
a subsequent error would occur on that path, and be processed by controller firmware.
As part of that process, controller disables ioaccel mode and later reinstates it,
signalling driver to change modes.

In some error cases, the error will not duplicate on the standard path,
so the driver could get stuck in non-ioaccel mode.
To avoid that, we allow driver to request a rescan during the next run of the
rescan thread.

Signed-off-by: Scott Teel <scott.teel@hp.com>
Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
---
 drivers/scsi/hpsa.c |   12 ++++++++++--
 drivers/scsi/hpsa.h |    1 +
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 295c5da..76e7ae9 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1457,6 +1457,7 @@ static void process_ioaccel2_completion(struct ctlr_info *h,
 				"%s: Error 0x%02x, Retrying on standard path.\n",
 				"HP SSD Smart Path", c2->error_data.status);
 		dev->offload_enabled = 0;
+		h->drv_req_rescan = 1;	/* schedule controller for a rescan */
 		cmd->result = DID_SOFT_ERROR << 16;
 		cmd_free(h, c);
 		cmd->scsi_done(cmd);
@@ -6135,6 +6136,9 @@ static int hpsa_kickoff_rescan(struct ctlr_info *h)
 	int i;
 	char *event_type;
 
+	/* Clear the driver-requested rescan flag */
+	h->drv_req_rescan = 0;
+
 	/* Ask the controller to clear the events we're handling. */
 	if ((h->transMethod & (CFGTBL_Trans_io_accel1
 			| CFGTBL_Trans_io_accel2)) &&
@@ -6182,7 +6186,9 @@ static int hpsa_kickoff_rescan(struct ctlr_info *h)
 
 /* Check a register on the controller to see if there are configuration
  * changes (added/changed/removed logical drives, etc.) which mean that
- * we should rescan the controller for devices.  If so, add the controller
+ * we should rescan the controller for devices.
+ * Also check flag for driver-initiated rescan.
+ * If either flag or controller event indicate rescan, add the controller
  * to the list of controllers needing to be rescanned, and gets a
  * reference to the associated scsi_host.
  */
@@ -6192,7 +6198,7 @@ static void hpsa_ctlr_needs_rescan(struct ctlr_info *h)
 		return;
 
 	h->events = readl(&(h->cfgtable->event_notify));
-	if (!h->events)
+	if (!h->events && !h->drv_req_rescan)
 		return;
 
 	/*
@@ -6366,6 +6372,8 @@ reinit_after_soft_reset:
 	/* Enable Accelerated IO path at driver layer */
 	h->acciopath_status = 1;
 
+	h->drv_req_rescan = 0;
+
 	/* Turn the interrupts on so we can service requests */
 	h->access.set_intr_mask(h, HPSA_INTR_ON);
 
diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
index 1d3340d..2e7521f 100644
--- a/drivers/scsi/hpsa.h
+++ b/drivers/scsi/hpsa.h
@@ -182,6 +182,7 @@ struct ctlr_info {
 #define HPSATMF_LOG_QRY_ASYNC   (1 << 25)
 	u32 events;
 	int	acciopath_status;
+	int	drv_req_rescan;	/* flag for driver to request rescan event */
 };
 #define HPSA_ABORT_MSG 0
 #define HPSA_DEVICE_RESET_MSG 1


  parent reply	other threads:[~2014-02-18 19:58 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-18 19:55 [PATCH 00/35] hpsa February 2014 driver updates Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 01/35] hpsa: use extended report luns command for HP SSD SmartPath Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 02/35] hpsa: mark last scatter gather element as the last Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 03/35] hpsa: add support for 'fastpath' i/o Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 04/35] hpsa: only allow REQ_TYPE_FS to use fast path Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 05/35] hpsa: fix task management for mode-1 ioaccell path Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 06/35] hpsa: add ioaccell mode 1 RAID offload support Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 07/35] hpsa: update raid offload status on device rescan Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 08/35] hpsa: poll controller to detect device change event Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 09/35] hpsa: do not rescan controllers known to be locked up Stephen M. Cameron
2014-02-18 19:55 ` [PATCH 10/35] hpsa: add hp_ssd_smart_path_enabled sysfs attribute Stephen M. Cameron
2014-03-13 11:28   ` James Bottomley
2014-02-18 19:55 ` [PATCH 11/35] hpsa: complain if physical or logical aborts are not supported Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 12/35] hpsa: add ioaccel mode 2 structure definitions Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 13/35] hpsa: Acknowledge controller events in ioaccell mode 2 as well as mode 1 Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 14/35] hpsa: do ioaccel mode 2 resource allocations Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 15/35] hpsa: get physical device handles for io accel mode 2 as well as mode 1 Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 16/35] hpsa: initialize controller to perform io accelerator mode 2 Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 17/35] hpsa: get ioaccel mode 2 i/o working Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 18/35] hpsa: teach hpsa_device_reset to do either target or lun reset Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 19/35] hpsa: add task management for ioaccel mode 2 Stephen M. Cameron
2014-03-26 16:09   ` Tomas Henzl
2014-02-18 19:56 ` [PATCH 20/35] hpsa: make device update copy the raid map also Stephen M. Cameron
2014-02-18 19:56 ` [PATCH 21/35] hpsa: complete the ioaccel raidmap code Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 22/35] hpsa: allow user to disable accelerated i/o path Stephen M. Cameron
2014-02-18 19:57 ` Stephen M. Cameron [this message]
2014-02-18 19:57 ` [PATCH 24/35] hpsa: allow VPD page zero to be queried Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 25/35] hpsa: do not inquire for unsupported ioaccel status vpd page Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 26/35] hpsa: retry certain ioaccel error cases on the RAID path Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 27/35] hpsa: update source file copyrights Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 28/35] hpsa: add controller base data-at-rest encryption compatibility ioaccel2 Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 29/35] hpsa: when switching out of accel mode await only accel command completions Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 30/35] hpsa: only do device rescan for certain events Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 31/35] hpsa: improve error messages for driver initiated commands Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 32/35] hpsa add sysfs debug switch for raid map debugging messages Stephen M. Cameron
2014-02-18 19:57 ` [PATCH 33/35] pci: add HP/3PAR vendor id to pci_ids.h Stephen M. Cameron
2014-02-18 19:58 ` [PATCH 34/35] hpsa: Add support for a few HP Storage controllers Stephen M. Cameron
2014-02-18 19:58 ` [PATCH 35/35] hpsa: fixup MSI-X registration Stephen M. Cameron

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=20140218195705.15787.87376.stgit@beardog.cce.hp.com \
    --to=scameron@beardog.cce.hp.com \
    --cc=dab@hp.com \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=joseph.t.handzik@hp.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michael.miller@canonical.com \
    --cc=scott.teel@hp.com \
    --cc=stephenmcameron@gmail.com \
    --cc=thenzl@redhat.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