]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Change how controllers in mixed mode are handled.
authorKevin Barnett <kevin.barnett@pmcs.com>
Fri, 6 May 2016 19:02:14 +0000 (12:02 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 22 May 2016 21:48:49 +0000 (14:48 -0700)
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Orabug: 23064595
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
drivers/scsi/hpsa.c
drivers/scsi/hpsa.h

index 40df01c6fee7a1e82e36de1b60284c24e10bf1f6..be9036ac131c00adffcc3fb5bc946d9014571159 100644 (file)
@@ -791,7 +791,8 @@ static ssize_t path_info_show(struct device *dev,
                                PATH_STRING_LEN,
                                "PORT: %.2s ",
                                phys_connector);
-               if (hdev->devtype == TYPE_DISK && h->hba_mode_enabled) {
+               if (hdev->devtype == TYPE_DISK &&
+                       hdev->expose_state != HPSA_DO_NOT_EXPOSE) {
                        if (box == 0 || box == 0xFF) {
                                output_len += snprintf(path[i] + output_len,
                                        PATH_STRING_LEN,
@@ -2697,34 +2698,6 @@ out:
        return rc;
 }
 
-static int hpsa_bmic_ctrl_mode_sense(struct ctlr_info *h,
-               unsigned char *scsi3addr, unsigned char page,
-               struct bmic_controller_parameters *buf, size_t bufsize)
-{
-       int rc = IO_OK;
-       struct CommandList *c;
-       struct ErrorInfo *ei;
-
-       c = cmd_alloc(h);
-       if (fill_cmd(c, BMIC_SENSE_CONTROLLER_PARAMETERS, h, buf, bufsize,
-                       page, scsi3addr, TYPE_CMD)) {
-               rc = -1;
-               goto out;
-       }
-       rc = hpsa_scsi_do_simple_cmd_with_retry(h, c,
-                       PCI_DMA_FROMDEVICE, NO_TIMEOUT);
-       if (rc)
-               goto out;
-       ei = c->err_info;
-       if (ei->CommandStatus != 0 && ei->CommandStatus != CMD_DATA_UNDERRUN) {
-               hpsa_scsi_interpret_error(h, c);
-               rc = -1;
-       }
-out:
-       cmd_free(h, c);
-       return rc;
-}
-
 static int hpsa_send_reset(struct ctlr_info *h, unsigned char *scsi3addr,
        u8 reset_type, int reply_queue)
 {
@@ -3674,29 +3647,6 @@ static u8 *figure_lunaddrbytes(struct ctlr_info *h, int raid_ctlr_position,
        return NULL;
 }
 
-static int hpsa_hba_mode_enabled(struct ctlr_info *h)
-{
-       int rc;
-       int hba_mode_enabled;
-       struct bmic_controller_parameters *ctlr_params;
-       ctlr_params = kzalloc(sizeof(struct bmic_controller_parameters),
-               GFP_KERNEL);
-
-       if (!ctlr_params)
-               return -ENOMEM;
-       rc = hpsa_bmic_ctrl_mode_sense(h, RAID_CTLR_LUNID, 0, ctlr_params,
-               sizeof(struct bmic_controller_parameters));
-       if (rc) {
-               kfree(ctlr_params);
-               return rc;
-       }
-
-       hba_mode_enabled =
-               ((ctlr_params->nvram_flags & HBA_MODE_ENABLED_FLAG) != 0);
-       kfree(ctlr_params);
-       return hba_mode_enabled;
-}
-
 /* get physical drive ioaccel handle and queue depth */
 static void hpsa_get_ioaccel_drive_info(struct ctlr_info *h,
                struct hpsa_scsi_dev_t *dev,
@@ -3774,7 +3724,6 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno)
        int ncurrent = 0;
        int i, n_ext_target_devs, ndevs_to_allocate;
        int raid_ctlr_position;
-       int rescan_hba_mode;
        DECLARE_BITMAP(lunzerobits, MAX_EXT_TARGETS);
 
        currentsd = kzalloc(sizeof(*currentsd) * HPSA_MAX_DEVICES, GFP_KERNEL);
@@ -3790,17 +3739,6 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno)
        }
        memset(lunzerobits, 0, sizeof(lunzerobits));
 
-       rescan_hba_mode = hpsa_hba_mode_enabled(h);
-       if (rescan_hba_mode < 0)
-               goto out;
-
-       if (!h->hba_mode_enabled && rescan_hba_mode)
-               dev_warn(&h->pdev->dev, "HBA mode enabled\n");
-       else if (h->hba_mode_enabled && !rescan_hba_mode)
-               dev_warn(&h->pdev->dev, "HBA mode disabled\n");
-
-       h->hba_mode_enabled = rescan_hba_mode;
-
        if (hpsa_gather_lun_info(h, physdev_list, &nphysicals,
                        logdev_list, &nlogicals))
                goto out;
@@ -3876,9 +3814,6 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno)
                /* do not expose masked devices */
                if (MASKED_DEVICE(lunaddrbytes) &&
                        i < nphysicals + (raid_ctlr_position == 0)) {
-                       if (h->hba_mode_enabled)
-                               dev_warn(&h->pdev->dev,
-                                       "Masked physical device detected\n");
                        this_device->expose_state = HPSA_DO_NOT_EXPOSE;
                } else {
                        this_device->expose_state =
@@ -3898,30 +3833,21 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno)
                                ncurrent++;
                        break;
                case TYPE_DISK:
-                       if (i >= nphysicals) {
-                               ncurrent++;
-                               break;
-                       }
-
-                       if (h->hba_mode_enabled)
-                               /* never use raid mapper in HBA mode */
+                       if (i < nphysicals + (raid_ctlr_position == 0)) {
+                               /* The disk is in HBA mode. */
+                               /* Never use RAID mapper in HBA mode. */
                                this_device->offload_enabled = 0;
-                       else if (!(h->transMethod & CFGTBL_Trans_io_accel1 ||
-                               h->transMethod & CFGTBL_Trans_io_accel2))
-                               break;
-                       hpsa_get_ioaccel_drive_info(h, this_device,
-                                               lunaddrbytes, id_phys);
-                       hpsa_get_path_info(this_device, lunaddrbytes, id_phys);
-                       atomic_set(&this_device->ioaccel_cmds_out, 0);
+                               hpsa_get_ioaccel_drive_info(h, this_device,
+                                       lunaddrbytes, id_phys);
+                               hpsa_get_path_info(this_device, lunaddrbytes,
+                                                       id_phys);
+                       }
                        ncurrent++;
                        break;
                case TYPE_TAPE:
                case TYPE_MEDIUM_CHANGER:
-                       ncurrent++;
-                       break;
                case TYPE_ENCLOSURE:
-                       if (h->hba_mode_enabled)
-                               ncurrent++;
+                       ncurrent++;
                        break;
                case TYPE_RAID:
                        /* Only present the Smartarray HBA as a RAID controller.
@@ -8129,7 +8055,6 @@ reinit_after_soft_reset:
 
        pci_set_drvdata(pdev, h);
        h->ndevices = 0;
-       h->hba_mode_enabled = 0;
 
        spin_lock_init(&h->devlock);
        rc = hpsa_put_ctlr_into_performant_mode(h);
index ab014d3f3656a30c9c1fae1f70bf08d1b0c9bb61..27debb363529ec88cbac6f364a3538b64d32b7a7 100644 (file)
@@ -116,7 +116,6 @@ struct bmic_controller_parameters {
        u8   automatic_drive_slamming;
        u8   reserved1;
        u8   nvram_flags;
-#define HBA_MODE_ENABLED_FLAG (1 << 3)
        u8   cache_nvram_flags;
        u8   drive_config_flags;
        u16  reserved2;
@@ -155,7 +154,6 @@ struct ctlr_info {
        unsigned int msi_vector;
        int intr_mode; /* either PERF_MODE_INT or SIMPLE_MODE_INT */
        struct access_method access;
-       char hba_mode_enabled;
 
        /* queue and queue Info */
        unsigned int Qdepth;