提交 e863d68e 编写于 作者: S Scott Teel 提交者: James Bottomley

[SCSI] hpsa: rescan devices on ioaccel2 error

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: NScott Teel <scott.teel@hp.com>
Signed-off-by: NStephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 da0697bd
...@@ -1457,6 +1457,7 @@ static void process_ioaccel2_completion(struct ctlr_info *h, ...@@ -1457,6 +1457,7 @@ static void process_ioaccel2_completion(struct ctlr_info *h,
"%s: Error 0x%02x, Retrying on standard path.\n", "%s: Error 0x%02x, Retrying on standard path.\n",
"HP SSD Smart Path", c2->error_data.status); "HP SSD Smart Path", c2->error_data.status);
dev->offload_enabled = 0; dev->offload_enabled = 0;
h->drv_req_rescan = 1; /* schedule controller for a rescan */
cmd->result = DID_SOFT_ERROR << 16; cmd->result = DID_SOFT_ERROR << 16;
cmd_free(h, c); cmd_free(h, c);
cmd->scsi_done(cmd); cmd->scsi_done(cmd);
...@@ -6138,6 +6139,9 @@ static int hpsa_kickoff_rescan(struct ctlr_info *h) ...@@ -6138,6 +6139,9 @@ static int hpsa_kickoff_rescan(struct ctlr_info *h)
int i; int i;
char *event_type; char *event_type;
/* Clear the driver-requested rescan flag */
h->drv_req_rescan = 0;
/* Ask the controller to clear the events we're handling. */ /* Ask the controller to clear the events we're handling. */
if ((h->transMethod & (CFGTBL_Trans_io_accel1 if ((h->transMethod & (CFGTBL_Trans_io_accel1
| CFGTBL_Trans_io_accel2)) && | CFGTBL_Trans_io_accel2)) &&
...@@ -6185,7 +6189,9 @@ static int hpsa_kickoff_rescan(struct ctlr_info *h) ...@@ -6185,7 +6189,9 @@ static int hpsa_kickoff_rescan(struct ctlr_info *h)
/* Check a register on the controller to see if there are configuration /* Check a register on the controller to see if there are configuration
* changes (added/changed/removed logical drives, etc.) which mean that * 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 * to the list of controllers needing to be rescanned, and gets a
* reference to the associated scsi_host. * reference to the associated scsi_host.
*/ */
...@@ -6195,7 +6201,7 @@ static void hpsa_ctlr_needs_rescan(struct ctlr_info *h) ...@@ -6195,7 +6201,7 @@ static void hpsa_ctlr_needs_rescan(struct ctlr_info *h)
return; return;
h->events = readl(&(h->cfgtable->event_notify)); h->events = readl(&(h->cfgtable->event_notify));
if (!h->events) if (!h->events && !h->drv_req_rescan)
return; return;
/* /*
...@@ -6369,6 +6375,8 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -6369,6 +6375,8 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
/* Enable Accelerated IO path at driver layer */ /* Enable Accelerated IO path at driver layer */
h->acciopath_status = 1; h->acciopath_status = 1;
h->drv_req_rescan = 0;
/* Turn the interrupts on so we can service requests */ /* Turn the interrupts on so we can service requests */
h->access.set_intr_mask(h, HPSA_INTR_ON); h->access.set_intr_mask(h, HPSA_INTR_ON);
......
...@@ -182,6 +182,7 @@ struct ctlr_info { ...@@ -182,6 +182,7 @@ struct ctlr_info {
#define HPSATMF_LOG_QRY_ASYNC (1 << 25) #define HPSATMF_LOG_QRY_ASYNC (1 << 25)
u32 events; u32 events;
int acciopath_status; int acciopath_status;
int drv_req_rescan; /* flag for driver to request rescan event */
}; };
#define HPSA_ABORT_MSG 0 #define HPSA_ABORT_MSG 0
#define HPSA_DEVICE_RESET_MSG 1 #define HPSA_DEVICE_RESET_MSG 1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册