]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
hpsa: correct queue depth for externals
authorDon Brace <don.brace@microsemi.com>
Sat, 25 Feb 2017 00:03:04 +0000 (16:03 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 20:17:56 +0000 (12:17 -0800)
queue depth setting not in correct place, had no effect.

Signed-off-by: Don Brace <don.brace@microsemi.com>
Orabug: 25605941
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
drivers/scsi/hpsa.c
drivers/scsi/hpsa.h

index da3426029381767713ed9d682efd90014421b794..59729fe7d70a165dbaee133ed391a0001b8d8b22 100644 (file)
@@ -2025,7 +2025,6 @@ static int hpsa_slave_alloc(struct scsi_device *sdev)
        struct hpsa_scsi_dev_t *sd = NULL;
        unsigned long flags;
        struct ctlr_info *h;
-       int queue_depth;
 
        h = sdev_to_hba(sdev);
        spin_lock_irqsave(&h->devlock, flags);
@@ -2052,12 +2051,6 @@ static int hpsa_slave_alloc(struct scsi_device *sdev)
                sdev->hostdata = NULL;
        }
 
-       if (sd)
-               queue_depth = sd->queue_depth != 0 ?
-                       sd->queue_depth : sdev->host->can_queue;
-       else
-               queue_depth = sdev->host->can_queue;
-
        spin_unlock_irqrestore(&h->devlock, flags);
 
        return 0;
@@ -2072,11 +2065,16 @@ static int hpsa_slave_configure(struct scsi_device *sdev)
        sd = sdev->hostdata;
        sdev->no_uld_attach = !sd || !sd->expose_device;
 
-       if (sd)
-               queue_depth = sd->queue_depth != 0 ?
-                       sd->queue_depth : sdev->host->can_queue;
-       else
+       if (sd) {
+               if (sd->external) {
+                       sd->queue_depth = EXTERNAL_QD;
+               } else {
+                       queue_depth = sd->queue_depth != 0 ?
+                                       sd->queue_depth : sdev->host->can_queue;
+               }
+       } else {
                queue_depth = sdev->host->can_queue;
+       }
 
        scsi_change_queue_depth(sdev, queue_depth);
 
@@ -3926,6 +3924,9 @@ static int hpsa_update_device_info(struct ctlr_info *h,
                this_device->queue_depth = h->nr_cmds;
        }
 
+       if (this_device->external)
+               this_device->queue_depth = EXTERNAL_QD;
+
        if (is_OBDR_device) {
                /* See if this is a One-Button-Disaster-Recovery device
                 * by looking for "$DR-10" at offset 43 in inquiry data.
@@ -4134,14 +4135,6 @@ static void hpsa_get_ioaccel_drive_info(struct ctlr_info *h,
        int rc;
        struct ext_report_lun_entry *rle;
 
-       /*
-        * external targets don't support BMIC
-        */
-       if (dev->external) {
-               dev->queue_depth = 7;
-               return;
-       }
-
        rle = &rlep->LUN[rle_index];
 
        dev->ioaccel_handle = rle->ioaccel_handle;
index 20c1b2298050cbb6882fe2bf67cd7d5827ef579b..1858fa2b129ecda137e889b718c57660deb252de 100644 (file)
@@ -57,6 +57,7 @@ struct hpsa_sas_phy {
        bool added_to_port;
 };
 
+#define EXTERNAL_QD 7
 struct hpsa_scsi_dev_t {
        unsigned int devtype;
        int bus, target, lun;           /* as presented to the OS */