aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2014-02-21 17:25:00 -0500
committerJames Bottomley <JBottomley@Parallels.com>2014-03-15 13:19:23 -0400
commit9846590edadb3c961fed095d6b3c0af947230e69 (patch)
treeab3da4e269970b09b1eb0a55d61dc0c599491b37
parent9f02e5bc60d699017bc1f5e5cc95c4fedc7b29ba (diff)
[SCSI] hpsa: bring format-in-progress drives online when ready
Do not expose drives that are undergoing a format immediately to the OS, instead wait until they are ready before bringing them online. This is so that logical drives created with "rapid parity initialization" do not get immediately kicked off the system for being unresponsive. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/hpsa.c311
-rw-r--r--drivers/scsi/hpsa.h9
-rw-r--r--drivers/scsi/hpsa_cmd.h15
3 files changed, 311 insertions, 24 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index f604a4ad406e..6e5e6939ce39 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1133,6 +1133,9 @@ static int hpsa_scsi_find_entry(struct hpsa_scsi_dev_t *needle,
1133 return DEVICE_UPDATED; 1133 return DEVICE_UPDATED;
1134 return DEVICE_SAME; 1134 return DEVICE_SAME;
1135 } else { 1135 } else {
1136 /* Keep offline devices offline */
1137 if (needle->volume_offline)
1138 return DEVICE_NOT_FOUND;
1136 return DEVICE_CHANGED; 1139 return DEVICE_CHANGED;
1137 } 1140 }
1138 } 1141 }
@@ -1141,6 +1144,110 @@ static int hpsa_scsi_find_entry(struct hpsa_scsi_dev_t *needle,
1141 return DEVICE_NOT_FOUND; 1144 return DEVICE_NOT_FOUND;
1142} 1145}
1143 1146
1147static void hpsa_monitor_offline_device(struct ctlr_info *h,
1148 unsigned char scsi3addr[])
1149{
1150 struct offline_device_entry *device;
1151 unsigned long flags;
1152
1153 /* Check to see if device is already on the list */
1154 spin_lock_irqsave(&h->offline_device_lock, flags);
1155 list_for_each_entry(device, &h->offline_device_list, offline_list) {
1156 if (memcmp(device->scsi3addr, scsi3addr,
1157 sizeof(device->scsi3addr)) == 0) {
1158 spin_unlock_irqrestore(&h->offline_device_lock, flags);
1159 return;
1160 }
1161 }
1162 spin_unlock_irqrestore(&h->offline_device_lock, flags);
1163
1164 /* Device is not on the list, add it. */
1165 device = kmalloc(sizeof(*device), GFP_KERNEL);
1166 if (!device) {
1167 dev_warn(&h->pdev->dev, "out of memory in %s\n", __func__);
1168 return;
1169 }
1170 memcpy(device->scsi3addr, scsi3addr, sizeof(device->scsi3addr));
1171 spin_lock_irqsave(&h->offline_device_lock, flags);
1172 list_add_tail(&device->offline_list, &h->offline_device_list);
1173 spin_unlock_irqrestore(&h->offline_device_lock, flags);
1174}
1175
1176/* Print a message explaining various offline volume states */
1177static void hpsa_show_volume_status(struct ctlr_info *h,
1178 struct hpsa_scsi_dev_t *sd)
1179{
1180 if (sd->volume_offline == HPSA_VPD_LV_STATUS_UNSUPPORTED)
1181 dev_info(&h->pdev->dev,
1182 "C%d:B%d:T%d:L%d Volume status is not available through vital product data pages.\n",
1183 h->scsi_host->host_no,
1184 sd->bus, sd->target, sd->lun);
1185 switch (sd->volume_offline) {
1186 case HPSA_LV_OK:
1187 break;
1188 case HPSA_LV_UNDERGOING_ERASE:
1189 dev_info(&h->pdev->dev,
1190 "C%d:B%d:T%d:L%d Volume is undergoing background erase process.\n",
1191 h->scsi_host->host_no,
1192 sd->bus, sd->target, sd->lun);
1193 break;
1194 case HPSA_LV_UNDERGOING_RPI:
1195 dev_info(&h->pdev->dev,
1196 "C%d:B%d:T%d:L%d Volume is undergoing rapid parity initialization process.\n",
1197 h->scsi_host->host_no,
1198 sd->bus, sd->target, sd->lun);
1199 break;
1200 case HPSA_LV_PENDING_RPI:
1201 dev_info(&h->pdev->dev,
1202 "C%d:B%d:T%d:L%d Volume is queued for rapid parity initialization process.\n",
1203 h->scsi_host->host_no,
1204 sd->bus, sd->target, sd->lun);
1205 break;
1206 case HPSA_LV_ENCRYPTED_NO_KEY:
1207 dev_info(&h->pdev->dev,
1208 "C%d:B%d:T%d:L%d Volume is encrypted and cannot be accessed because key is not present.\n",
1209 h->scsi_host->host_no,
1210 sd->bus, sd->target, sd->lun);
1211 break;
1212 case HPSA_LV_PLAINTEXT_IN_ENCRYPT_ONLY_CONTROLLER:
1213 dev_info(&h->pdev->dev,
1214 "C%d:B%d:T%d:L%d Volume is not encrypted and cannot be accessed because controller is in encryption-only mode.\n",
1215 h->scsi_host->host_no,
1216 sd->bus, sd->target, sd->lun);
1217 break;
1218 case HPSA_LV_UNDERGOING_ENCRYPTION:
1219 dev_info(&h->pdev->dev,
1220 "C%d:B%d:T%d:L%d Volume is undergoing encryption process.\n",
1221 h->scsi_host->host_no,
1222 sd->bus, sd->target, sd->lun);
1223 break;
1224 case HPSA_LV_UNDERGOING_ENCRYPTION_REKEYING:
1225 dev_info(&h->pdev->dev,
1226 "C%d:B%d:T%d:L%d Volume is undergoing encryption re-keying process.\n",
1227 h->scsi_host->host_no,
1228 sd->bus, sd->target, sd->lun);
1229 break;
1230 case HPSA_LV_ENCRYPTED_IN_NON_ENCRYPTED_CONTROLLER:
1231 dev_info(&h->pdev->dev,
1232 "C%d:B%d:T%d:L%d Volume is encrypted and cannot be accessed because controller does not have encryption enabled.\n",
1233 h->scsi_host->host_no,
1234 sd->bus, sd->target, sd->lun);
1235 break;
1236 case HPSA_LV_PENDING_ENCRYPTION:
1237 dev_info(&h->pdev->dev,
1238 "C%d:B%d:T%d:L%d Volume is pending migration to encrypted state, but process has not started.\n",
1239 h->scsi_host->host_no,
1240 sd->bus, sd->target, sd->lun);
1241 break;
1242 case HPSA_LV_PENDING_ENCRYPTION_REKEYING:
1243 dev_info(&h->pdev->dev,
1244 "C%d:B%d:T%d:L%d Volume is encrypted and is pending encryption rekeying.\n",
1245 h->scsi_host->host_no,
1246 sd->bus, sd->target, sd->lun);
1247 break;
1248 }
1249}
1250
1144static void adjust_hpsa_scsi_table(struct ctlr_info *h, int hostno, 1251static void adjust_hpsa_scsi_table(struct ctlr_info *h, int hostno,
1145 struct hpsa_scsi_dev_t *sd[], int nsds) 1252 struct hpsa_scsi_dev_t *sd[], int nsds)
1146{ 1253{
@@ -1205,6 +1312,20 @@ static void adjust_hpsa_scsi_table(struct ctlr_info *h, int hostno,
1205 for (i = 0; i < nsds; i++) { 1312 for (i = 0; i < nsds; i++) {
1206 if (!sd[i]) /* if already added above. */ 1313 if (!sd[i]) /* if already added above. */
1207 continue; 1314 continue;
1315
1316 /* Don't add devices which are NOT READY, FORMAT IN PROGRESS
1317 * as the SCSI mid-layer does not handle such devices well.
1318 * It relentlessly loops sending TUR at 3Hz, then READ(10)
1319 * at 160Hz, and prevents the system from coming up.
1320 */
1321 if (sd[i]->volume_offline) {
1322 hpsa_show_volume_status(h, sd[i]);
1323 dev_info(&h->pdev->dev, "c%db%dt%dl%d: temporarily offline\n",
1324 h->scsi_host->host_no,
1325 sd[i]->bus, sd[i]->target, sd[i]->lun);
1326 continue;
1327 }
1328
1208 device_change = hpsa_scsi_find_entry(sd[i], h->dev, 1329 device_change = hpsa_scsi_find_entry(sd[i], h->dev,
1209 h->ndevices, &entry); 1330 h->ndevices, &entry);
1210 if (device_change == DEVICE_NOT_FOUND) { 1331 if (device_change == DEVICE_NOT_FOUND) {
@@ -1223,6 +1344,17 @@ static void adjust_hpsa_scsi_table(struct ctlr_info *h, int hostno,
1223 } 1344 }
1224 spin_unlock_irqrestore(&h->devlock, flags); 1345 spin_unlock_irqrestore(&h->devlock, flags);
1225 1346
1347 /* Monitor devices which are in one of several NOT READY states to be
1348 * brought online later. This must be done without holding h->devlock,
1349 * so don't touch h->dev[]
1350 */
1351 for (i = 0; i < nsds; i++) {
1352 if (!sd[i]) /* if already added above. */
1353 continue;
1354 if (sd[i]->volume_offline)
1355 hpsa_monitor_offline_device(h, sd[i]->scsi3addr);
1356 }
1357
1226 /* Don't notify scsi mid layer of any changes the first time through 1358 /* Don't notify scsi mid layer of any changes the first time through
1227 * (or if there are no changes) scsi_scan_host will do it later the 1359 * (or if there are no changes) scsi_scan_host will do it later the
1228 * first time through. 1360 * first time through.
@@ -2326,6 +2458,117 @@ static inline void hpsa_set_bus_target_lun(struct hpsa_scsi_dev_t *device,
2326 device->lun = lun; 2458 device->lun = lun;
2327} 2459}
2328 2460
2461/* Use VPD inquiry to get details of volume status */
2462static int hpsa_get_volume_status(struct ctlr_info *h,
2463 unsigned char scsi3addr[])
2464{
2465 int rc;
2466 int status;
2467 int size;
2468 unsigned char *buf;
2469
2470 buf = kzalloc(64, GFP_KERNEL);
2471 if (!buf)
2472 return HPSA_VPD_LV_STATUS_UNSUPPORTED;
2473
2474 /* Does controller have VPD for logical volume status? */
2475 if (!hpsa_vpd_page_supported(h, scsi3addr, HPSA_VPD_LV_STATUS)) {
2476 dev_warn(&h->pdev->dev, "Logical volume status VPD page is unsupported.\n");
2477 goto exit_failed;
2478 }
2479
2480 /* Get the size of the VPD return buffer */
2481 rc = hpsa_scsi_do_inquiry(h, scsi3addr, VPD_PAGE | HPSA_VPD_LV_STATUS,
2482 buf, HPSA_VPD_HEADER_SZ);
2483 if (rc != 0) {
2484 dev_warn(&h->pdev->dev, "Logical volume status VPD inquiry failed.\n");
2485 goto exit_failed;
2486 }
2487 size = buf[3];
2488
2489 /* Now get the whole VPD buffer */
2490 rc = hpsa_scsi_do_inquiry(h, scsi3addr, VPD_PAGE | HPSA_VPD_LV_STATUS,
2491 buf, size + HPSA_VPD_HEADER_SZ);
2492 if (rc != 0) {
2493 dev_warn(&h->pdev->dev, "Logical volume status VPD inquiry failed.\n");
2494 goto exit_failed;
2495 }
2496 status = buf[4]; /* status byte */
2497
2498 kfree(buf);
2499 return status;
2500exit_failed:
2501 kfree(buf);
2502 return HPSA_VPD_LV_STATUS_UNSUPPORTED;
2503}
2504
2505/* Determine offline status of a volume.
2506 * Return either:
2507 * 0 (not offline)
2508 * -1 (offline for unknown reasons)
2509 * # (integer code indicating one of several NOT READY states
2510 * describing why a volume is to be kept offline)
2511 */
2512static unsigned char hpsa_volume_offline(struct ctlr_info *h,
2513 unsigned char scsi3addr[])
2514{
2515 struct CommandList *c;
2516 unsigned char *sense, sense_key, asc, ascq;
2517 int ldstat = 0;
2518 u16 cmd_status;
2519 u8 scsi_status;
2520#define ASC_LUN_NOT_READY 0x04
2521#define ASCQ_LUN_NOT_READY_FORMAT_IN_PROGRESS 0x04
2522#define ASCQ_LUN_NOT_READY_INITIALIZING_CMD_REQ 0x02
2523
2524 c = cmd_alloc(h);
2525 if (!c)
2526 return 0;
2527 (void) fill_cmd(c, TEST_UNIT_READY, h, NULL, 0, 0, scsi3addr, TYPE_CMD);
2528 hpsa_scsi_do_simple_cmd_core(h, c);
2529 sense = c->err_info->SenseInfo;
2530 sense_key = sense[2];
2531 asc = sense[12];
2532 ascq = sense[13];
2533 cmd_status = c->err_info->CommandStatus;
2534 scsi_status = c->err_info->ScsiStatus;
2535 cmd_free(h, c);
2536 /* Is the volume 'not ready'? */
2537 if (cmd_status != CMD_TARGET_STATUS ||
2538 scsi_status != SAM_STAT_CHECK_CONDITION ||
2539 sense_key != NOT_READY ||
2540 asc != ASC_LUN_NOT_READY) {
2541 return 0;
2542 }
2543
2544 /* Determine the reason for not ready state */
2545 ldstat = hpsa_get_volume_status(h, scsi3addr);
2546
2547 /* Keep volume offline in certain cases: */
2548 switch (ldstat) {
2549 case HPSA_LV_UNDERGOING_ERASE:
2550 case HPSA_LV_UNDERGOING_RPI:
2551 case HPSA_LV_PENDING_RPI:
2552 case HPSA_LV_ENCRYPTED_NO_KEY:
2553 case HPSA_LV_PLAINTEXT_IN_ENCRYPT_ONLY_CONTROLLER:
2554 case HPSA_LV_UNDERGOING_ENCRYPTION:
2555 case HPSA_LV_UNDERGOING_ENCRYPTION_REKEYING:
2556 case HPSA_LV_ENCRYPTED_IN_NON_ENCRYPTED_CONTROLLER:
2557 return ldstat;
2558 case HPSA_VPD_LV_STATUS_UNSUPPORTED:
2559 /* If VPD status page isn't available,
2560 * use ASC/ASCQ to determine state
2561 */
2562 if ((ascq == ASCQ_LUN_NOT_READY_FORMAT_IN_PROGRESS) ||
2563 (ascq == ASCQ_LUN_NOT_READY_INITIALIZING_CMD_REQ))
2564 return ldstat;
2565 break;
2566 default:
2567 break;
2568 }
2569 return 0;
2570}
2571
2329static int hpsa_update_device_info(struct ctlr_info *h, 2572static int hpsa_update_device_info(struct ctlr_info *h,
2330 unsigned char scsi3addr[], struct hpsa_scsi_dev_t *this_device, 2573 unsigned char scsi3addr[], struct hpsa_scsi_dev_t *this_device,
2331 unsigned char *is_OBDR_device) 2574 unsigned char *is_OBDR_device)
@@ -2368,10 +2611,13 @@ static int hpsa_update_device_info(struct ctlr_info *h,
2368 hpsa_get_raid_level(h, scsi3addr, &this_device->raid_level); 2611 hpsa_get_raid_level(h, scsi3addr, &this_device->raid_level);
2369 if (h->fw_support & MISC_FW_RAID_OFFLOAD_BASIC) 2612 if (h->fw_support & MISC_FW_RAID_OFFLOAD_BASIC)
2370 hpsa_get_ioaccel_status(h, scsi3addr, this_device); 2613 hpsa_get_ioaccel_status(h, scsi3addr, this_device);
2614 this_device->volume_offline =
2615 hpsa_volume_offline(h, scsi3addr);
2371 } else { 2616 } else {
2372 this_device->raid_level = RAID_UNKNOWN; 2617 this_device->raid_level = RAID_UNKNOWN;
2373 this_device->offload_config = 0; 2618 this_device->offload_config = 0;
2374 this_device->offload_enabled = 0; 2619 this_device->offload_enabled = 0;
2620 this_device->volume_offline = 0;
2375 } 2621 }
2376 2622
2377 if (is_OBDR_device) { 2623 if (is_OBDR_device) {
@@ -6442,7 +6688,7 @@ static void detect_controller_lockup(struct ctlr_info *h)
6442 h->last_heartbeat_timestamp = now; 6688 h->last_heartbeat_timestamp = now;
6443} 6689}
6444 6690
6445static int hpsa_kickoff_rescan(struct ctlr_info *h) 6691static void hpsa_ack_ctlr_events(struct ctlr_info *h)
6446{ 6692{
6447 int i; 6693 int i;
6448 char *event_type; 6694 char *event_type;
@@ -6485,42 +6731,49 @@ static int hpsa_kickoff_rescan(struct ctlr_info *h)
6485 hpsa_wait_for_mode_change_ack(h); 6731 hpsa_wait_for_mode_change_ack(h);
6486#endif 6732#endif
6487 } 6733 }
6488 6734 return;
6489 /* Something in the device list may have changed to trigger
6490 * the event, so do a rescan.
6491 */
6492 hpsa_scan_start(h->scsi_host);
6493 /* release reference taken on scsi host in check_controller_events */
6494 scsi_host_put(h->scsi_host);
6495 return 0;
6496} 6735}
6497 6736
6498/* Check a register on the controller to see if there are configuration 6737/* Check a register on the controller to see if there are configuration
6499 * changes (added/changed/removed logical drives, etc.) which mean that 6738 * changes (added/changed/removed logical drives, etc.) which mean that
6500 * we should rescan the controller for devices. 6739 * we should rescan the controller for devices.
6501 * Also check flag for driver-initiated rescan. 6740 * Also check flag for driver-initiated rescan.
6502 * If either flag or controller event indicate rescan, add the controller
6503 * to the list of controllers needing to be rescanned, and gets a
6504 * reference to the associated scsi_host.
6505 */ 6741 */
6506static void hpsa_ctlr_needs_rescan(struct ctlr_info *h) 6742static int hpsa_ctlr_needs_rescan(struct ctlr_info *h)
6507{ 6743{
6744 if (h->drv_req_rescan)
6745 return 1;
6746
6508 if (!(h->fw_support & MISC_FW_EVENT_NOTIFY)) 6747 if (!(h->fw_support & MISC_FW_EVENT_NOTIFY))
6509 return; 6748 return 0;
6510 6749
6511 h->events = readl(&(h->cfgtable->event_notify)); 6750 h->events = readl(&(h->cfgtable->event_notify));
6512 if (!(h->events & RESCAN_REQUIRED_EVENT_BITS) && !h->drv_req_rescan) 6751 return h->events & RESCAN_REQUIRED_EVENT_BITS;
6513 return; 6752}
6514 6753
6515 /* 6754/*
6516 * Take a reference on scsi host for the duration of the scan 6755 * Check if any of the offline devices have become ready
6517 * Release in hpsa_kickoff_rescan(). No lock needed for scan_list 6756 */
6518 * as only a single thread accesses this list. 6757static int hpsa_offline_devices_ready(struct ctlr_info *h)
6519 */ 6758{
6520 scsi_host_get(h->scsi_host); 6759 unsigned long flags;
6521 hpsa_kickoff_rescan(h); 6760 struct offline_device_entry *d;
6761 struct list_head *this, *tmp;
6762
6763 spin_lock_irqsave(&h->offline_device_lock, flags);
6764 list_for_each_safe(this, tmp, &h->offline_device_list) {
6765 d = list_entry(this, struct offline_device_entry,
6766 offline_list);
6767 spin_unlock_irqrestore(&h->offline_device_lock, flags);
6768 if (!hpsa_volume_offline(h, d->scsi3addr))
6769 return 1;
6770 spin_lock_irqsave(&h->offline_device_lock, flags);
6771 }
6772 spin_unlock_irqrestore(&h->offline_device_lock, flags);
6773 return 0;
6522} 6774}
6523 6775
6776
6524static void hpsa_monitor_ctlr_worker(struct work_struct *work) 6777static void hpsa_monitor_ctlr_worker(struct work_struct *work)
6525{ 6778{
6526 unsigned long flags; 6779 unsigned long flags;
@@ -6529,7 +6782,15 @@ static void hpsa_monitor_ctlr_worker(struct work_struct *work)
6529 detect_controller_lockup(h); 6782 detect_controller_lockup(h);
6530 if (h->lockup_detected) 6783 if (h->lockup_detected)
6531 return; 6784 return;
6532 hpsa_ctlr_needs_rescan(h); 6785
6786 if (hpsa_ctlr_needs_rescan(h) || hpsa_offline_devices_ready(h)) {
6787 scsi_host_get(h->scsi_host);
6788 h->drv_req_rescan = 0;
6789 hpsa_ack_ctlr_events(h);
6790 hpsa_scan_start(h->scsi_host);
6791 scsi_host_put(h->scsi_host);
6792 }
6793
6533 spin_lock_irqsave(&h->lock, flags); 6794 spin_lock_irqsave(&h->lock, flags);
6534 if (h->remove_in_progress) { 6795 if (h->remove_in_progress) {
6535 spin_unlock_irqrestore(&h->lock, flags); 6796 spin_unlock_irqrestore(&h->lock, flags);
@@ -6579,7 +6840,9 @@ reinit_after_soft_reset:
6579 h->intr_mode = hpsa_simple_mode ? SIMPLE_MODE_INT : PERF_MODE_INT; 6840 h->intr_mode = hpsa_simple_mode ? SIMPLE_MODE_INT : PERF_MODE_INT;
6580 INIT_LIST_HEAD(&h->cmpQ); 6841 INIT_LIST_HEAD(&h->cmpQ);
6581 INIT_LIST_HEAD(&h->reqQ); 6842 INIT_LIST_HEAD(&h->reqQ);
6843 INIT_LIST_HEAD(&h->offline_device_list);
6582 spin_lock_init(&h->lock); 6844 spin_lock_init(&h->lock);
6845 spin_lock_init(&h->offline_device_lock);
6583 spin_lock_init(&h->scan_lock); 6846 spin_lock_init(&h->scan_lock);
6584 spin_lock_init(&h->passthru_count_lock); 6847 spin_lock_init(&h->passthru_count_lock);
6585 rc = hpsa_pci_init(h); 6848 rc = hpsa_pci_init(h);
diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h
index c4a81f095e27..ae8c592df8d3 100644
--- a/drivers/scsi/hpsa.h
+++ b/drivers/scsi/hpsa.h
@@ -46,6 +46,7 @@ struct hpsa_scsi_dev_t {
46 unsigned char vendor[8]; /* bytes 8-15 of inquiry data */ 46 unsigned char vendor[8]; /* bytes 8-15 of inquiry data */
47 unsigned char model[16]; /* bytes 16-31 of inquiry data */ 47 unsigned char model[16]; /* bytes 16-31 of inquiry data */
48 unsigned char raid_level; /* from inquiry page 0xC1 */ 48 unsigned char raid_level; /* from inquiry page 0xC1 */
49 unsigned char volume_offline; /* discovered via TUR or VPD */
49 u32 ioaccel_handle; 50 u32 ioaccel_handle;
50 int offload_config; /* I/O accel RAID offload configured */ 51 int offload_config; /* I/O accel RAID offload configured */
51 int offload_enabled; /* I/O accel RAID offload enabled */ 52 int offload_enabled; /* I/O accel RAID offload enabled */
@@ -197,10 +198,18 @@ struct ctlr_info {
197 CTLR_STATE_CHANGE_EVENT_REDUNDANT_CNTRL | \ 198 CTLR_STATE_CHANGE_EVENT_REDUNDANT_CNTRL | \
198 CTLR_STATE_CHANGE_EVENT_AIO_ENABLED_DISABLED | \ 199 CTLR_STATE_CHANGE_EVENT_AIO_ENABLED_DISABLED | \
199 CTLR_STATE_CHANGE_EVENT_AIO_CONFIG_CHANGE) 200 CTLR_STATE_CHANGE_EVENT_AIO_CONFIG_CHANGE)
201 spinlock_t offline_device_lock;
202 struct list_head offline_device_list;
200 int acciopath_status; 203 int acciopath_status;
201 int drv_req_rescan; /* flag for driver to request rescan event */ 204 int drv_req_rescan; /* flag for driver to request rescan event */
202 int raid_offload_debug; 205 int raid_offload_debug;
203}; 206};
207
208struct offline_device_entry {
209 unsigned char scsi3addr[8];
210 struct list_head offline_list;
211};
212
204#define HPSA_ABORT_MSG 0 213#define HPSA_ABORT_MSG 0
205#define HPSA_DEVICE_RESET_MSG 1 214#define HPSA_DEVICE_RESET_MSG 1
206#define HPSA_RESET_TYPE_CONTROLLER 0x00 215#define HPSA_RESET_TYPE_CONTROLLER 0x00
diff --git a/drivers/scsi/hpsa_cmd.h b/drivers/scsi/hpsa_cmd.h
index eaa7fdaa2e9d..8026d2e8154d 100644
--- a/drivers/scsi/hpsa_cmd.h
+++ b/drivers/scsi/hpsa_cmd.h
@@ -147,8 +147,23 @@
147#define HPSA_VPD_SUPPORTED_PAGES 0x00 147#define HPSA_VPD_SUPPORTED_PAGES 0x00
148#define HPSA_VPD_LV_DEVICE_GEOMETRY 0xC1 148#define HPSA_VPD_LV_DEVICE_GEOMETRY 0xC1
149#define HPSA_VPD_LV_IOACCEL_STATUS 0xC2 149#define HPSA_VPD_LV_IOACCEL_STATUS 0xC2
150#define HPSA_VPD_LV_STATUS 0xC3
150#define HPSA_VPD_HEADER_SZ 4 151#define HPSA_VPD_HEADER_SZ 4
151 152
153/* Logical volume states */
154#define HPSA_VPD_LV_STATUS_UNSUPPORTED -1
155#define HPSA_LV_OK 0x0
156#define HPSA_LV_UNDERGOING_ERASE 0x0F
157#define HPSA_LV_UNDERGOING_RPI 0x12
158#define HPSA_LV_PENDING_RPI 0x13
159#define HPSA_LV_ENCRYPTED_NO_KEY 0x14
160#define HPSA_LV_PLAINTEXT_IN_ENCRYPT_ONLY_CONTROLLER 0x15
161#define HPSA_LV_UNDERGOING_ENCRYPTION 0x16
162#define HPSA_LV_UNDERGOING_ENCRYPTION_REKEYING 0x17
163#define HPSA_LV_ENCRYPTED_IN_NON_ENCRYPTED_CONTROLLER 0x18
164#define HPSA_LV_PENDING_ENCRYPTION 0x19
165#define HPSA_LV_PENDING_ENCRYPTION_REKEYING 0x1A
166
152struct vals32 { 167struct vals32 {
153 u32 lower; 168 u32 lower;
154 u32 upper; 169 u32 upper;