]> git.karo-electronics.de Git - linux-beck.git/blobdiff - drivers/scsi/hpsa.c
tpm: Provide a generic means to override the chip returned timeouts
[linux-beck.git] / drivers / scsi / hpsa.c
index 5cef5a68fdbe4e8bf9ecb2720ad424603153c447..31184b35370fe472099f072cdd7979b428fd07fc 100644 (file)
@@ -1556,9 +1556,13 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h,
                        dev_warn(&h->pdev->dev,
                                "%s: task complete with check condition.\n",
                                "HP SSD Smart Path");
+                       cmd->result |= SAM_STAT_CHECK_CONDITION;
                        if (c2->error_data.data_present !=
-                                       IOACCEL2_SENSE_DATA_PRESENT)
+                                       IOACCEL2_SENSE_DATA_PRESENT) {
+                               memset(cmd->sense_buffer, 0,
+                                       SCSI_SENSE_BUFFERSIZE);
                                break;
+                       }
                        /* copy the sense data */
                        data_len = c2->error_data.sense_data_len;
                        if (data_len > SCSI_SENSE_BUFFERSIZE)
@@ -1568,7 +1572,6 @@ static int handle_ioaccel_mode2_error(struct ctlr_info *h,
                                        sizeof(c2->error_data.sense_data_buff);
                        memcpy(cmd->sense_buffer,
                                c2->error_data.sense_data_buff, data_len);
-                       cmd->result |= SAM_STAT_CHECK_CONDITION;
                        retry = 1;
                        break;
                case IOACCEL2_STATUS_SR_TASK_COMP_BUSY:
@@ -1653,16 +1656,6 @@ static void process_ioaccel2_completion(struct ctlr_info *h,
        if (is_logical_dev_addr_mode(dev->scsi3addr) &&
                c2->error_data.serv_response ==
                        IOACCEL2_SERV_RESPONSE_FAILURE) {
-               if (c2->error_data.status ==
-                       IOACCEL2_STATUS_SR_IOACCEL_DISABLED)
-                       dev_warn(&h->pdev->dev,
-                               "%s: Path is unavailable, retrying on standard path.\n",
-                               "HP SSD Smart Path");
-               else
-                       dev_warn(&h->pdev->dev,
-                               "%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;
@@ -2437,7 +2430,7 @@ static int hpsa_get_device_id(struct ctlr_info *h, unsigned char *scsi3addr,
                buflen = 16;
        buf = kzalloc(64, GFP_KERNEL);
        if (!buf)
-               return -1;
+               return -ENOMEM;
        rc = hpsa_scsi_do_inquiry(h, scsi3addr, VPD_PAGE | 0x83, buf, 64);
        if (rc == 0)
                memcpy(device_id, &buf[8], buflen);
@@ -2523,27 +2516,21 @@ static int hpsa_get_volume_status(struct ctlr_info *h,
                return HPSA_VPD_LV_STATUS_UNSUPPORTED;
 
        /* Does controller have VPD for logical volume status? */
-       if (!hpsa_vpd_page_supported(h, scsi3addr, HPSA_VPD_LV_STATUS)) {
-               dev_warn(&h->pdev->dev, "Logical volume status VPD page is unsupported.\n");
+       if (!hpsa_vpd_page_supported(h, scsi3addr, HPSA_VPD_LV_STATUS))
                goto exit_failed;
-       }
 
        /* Get the size of the VPD return buffer */
        rc = hpsa_scsi_do_inquiry(h, scsi3addr, VPD_PAGE | HPSA_VPD_LV_STATUS,
                                        buf, HPSA_VPD_HEADER_SZ);
-       if (rc != 0) {
-               dev_warn(&h->pdev->dev, "Logical volume status VPD inquiry failed.\n");
+       if (rc != 0)
                goto exit_failed;
-       }
        size = buf[3];
 
        /* Now get the whole VPD buffer */
        rc = hpsa_scsi_do_inquiry(h, scsi3addr, VPD_PAGE | HPSA_VPD_LV_STATUS,
                                        buf, size + HPSA_VPD_HEADER_SZ);
-       if (rc != 0) {
-               dev_warn(&h->pdev->dev, "Logical volume status VPD inquiry failed.\n");
+       if (rc != 0)
                goto exit_failed;
-       }
        status = buf[4]; /* status byte */
 
        kfree(buf);
@@ -2556,11 +2543,11 @@ exit_failed:
 /* Determine offline status of a volume.
  * Return either:
  *  0 (not offline)
- * -1 (offline for unknown reasons)
+ *  0xff (offline for unknown reasons)
  *  # (integer code indicating one of several NOT READY states
  *     describing why a volume is to be kept offline)
  */
-static unsigned char hpsa_volume_offline(struct ctlr_info *h,
+static int hpsa_volume_offline(struct ctlr_info *h,
                                        unsigned char scsi3addr[])
 {
        struct CommandList *c;
@@ -2659,11 +2646,15 @@ static int hpsa_update_device_info(struct ctlr_info *h,
 
        if (this_device->devtype == TYPE_DISK &&
                is_logical_dev_addr_mode(scsi3addr)) {
+               int 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);
-               this_device->volume_offline =
-                       hpsa_volume_offline(h, scsi3addr);
+               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;
        } else {
                this_device->raid_level = RAID_UNKNOWN;
                this_device->offload_config = 0;
@@ -3077,7 +3068,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno)
                ndev_allocated++;
        }
 
-       if (unlikely(is_scsi_rev_5(h)))
+       if (is_scsi_rev_5(h))
                raid_ctlr_position = 0;
        else
                raid_ctlr_position = nphysicals + nlogicals;