|
@@ -3714,7 +3714,7 @@ exit_failed:
|
|
|
* # (integer code indicating one of several NOT READY states
|
|
|
* describing why a volume is to be kept offline)
|
|
|
*/
|
|
|
-static int hpsa_volume_offline(struct ctlr_info *h,
|
|
|
+static unsigned char hpsa_volume_offline(struct ctlr_info *h,
|
|
|
unsigned char scsi3addr[])
|
|
|
{
|
|
|
struct CommandList *c;
|
|
@@ -3735,7 +3735,7 @@ static int hpsa_volume_offline(struct ctlr_info *h,
|
|
|
DEFAULT_TIMEOUT);
|
|
|
if (rc) {
|
|
|
cmd_free(h, c);
|
|
|
- return 0;
|
|
|
+ return HPSA_VPD_LV_STATUS_UNSUPPORTED;
|
|
|
}
|
|
|
sense = c->err_info->SenseInfo;
|
|
|
if (c->err_info->SenseLen > sizeof(c->err_info->SenseInfo))
|
|
@@ -3746,19 +3746,13 @@ static int hpsa_volume_offline(struct ctlr_info *h,
|
|
|
cmd_status = c->err_info->CommandStatus;
|
|
|
scsi_status = c->err_info->ScsiStatus;
|
|
|
cmd_free(h, c);
|
|
|
- /* Is the volume 'not ready'? */
|
|
|
- if (cmd_status != CMD_TARGET_STATUS ||
|
|
|
- scsi_status != SAM_STAT_CHECK_CONDITION ||
|
|
|
- sense_key != NOT_READY ||
|
|
|
- asc != ASC_LUN_NOT_READY) {
|
|
|
- return 0;
|
|
|
- }
|
|
|
|
|
|
/* Determine the reason for not ready state */
|
|
|
ldstat = hpsa_get_volume_status(h, scsi3addr);
|
|
|
|
|
|
/* Keep volume offline in certain cases: */
|
|
|
switch (ldstat) {
|
|
|
+ case HPSA_LV_FAILED:
|
|
|
case HPSA_LV_UNDERGOING_ERASE:
|
|
|
case HPSA_LV_NOT_AVAILABLE:
|
|
|
case HPSA_LV_UNDERGOING_RPI:
|
|
@@ -3780,7 +3774,7 @@ static int hpsa_volume_offline(struct ctlr_info *h,
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
- return 0;
|
|
|
+ return HPSA_LV_OK;
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -3853,10 +3847,10 @@ static int hpsa_update_device_info(struct ctlr_info *h,
|
|
|
/* Do an inquiry to the device to see what it is. */
|
|
|
if (hpsa_scsi_do_inquiry(h, scsi3addr, 0, inq_buff,
|
|
|
(unsigned char) OBDR_TAPE_INQ_SIZE) != 0) {
|
|
|
- /* Inquiry failed (msg printed already) */
|
|
|
dev_err(&h->pdev->dev,
|
|
|
- "hpsa_update_device_info: inquiry failed\n");
|
|
|
- rc = -EIO;
|
|
|
+ "%s: inquiry failed, device will be skipped.\n",
|
|
|
+ __func__);
|
|
|
+ rc = HPSA_INQUIRY_FAILED;
|
|
|
goto bail_out;
|
|
|
}
|
|
|
|
|
@@ -3885,15 +3879,19 @@ static int hpsa_update_device_info(struct ctlr_info *h,
|
|
|
if ((this_device->devtype == TYPE_DISK ||
|
|
|
this_device->devtype == TYPE_ZBC) &&
|
|
|
is_logical_dev_addr_mode(scsi3addr)) {
|
|
|
- int volume_offline;
|
|
|
+ unsigned char volume_offline;
|
|
|
|
|
|
hpsa_get_raid_level(h, scsi3addr, &this_device->raid_level);
|
|
|
if (h->fw_support & MISC_FW_RAID_OFFLOAD_BASIC)
|
|
|
hpsa_get_ioaccel_status(h, scsi3addr, this_device);
|
|
|
volume_offline = hpsa_volume_offline(h, scsi3addr);
|
|
|
- if (volume_offline < 0 || volume_offline > 0xff)
|
|
|
- volume_offline = HPSA_VPD_LV_STATUS_UNSUPPORTED;
|
|
|
- this_device->volume_offline = volume_offline & 0xff;
|
|
|
+ if (volume_offline == HPSA_LV_FAILED) {
|
|
|
+ rc = HPSA_LV_FAILED;
|
|
|
+ dev_err(&h->pdev->dev,
|
|
|
+ "%s: LV failed, device will be skipped.\n",
|
|
|
+ __func__);
|
|
|
+ goto bail_out;
|
|
|
+ }
|
|
|
} else {
|
|
|
this_device->raid_level = RAID_UNKNOWN;
|
|
|
this_device->offload_config = 0;
|
|
@@ -4379,8 +4377,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h)
|
|
|
goto out;
|
|
|
}
|
|
|
if (rc) {
|
|
|
- dev_warn(&h->pdev->dev,
|
|
|
- "Inquiry failed, skipping device.\n");
|
|
|
+ h->drv_req_rescan = 1;
|
|
|
continue;
|
|
|
}
|
|
|
|