]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
scsi: remove ->change_queue_type method
authorChristoph Hellwig <hch@lst.de>
Mon, 24 Nov 2014 14:36:18 +0000 (15:36 +0100)
committerChristoph Hellwig <hch@lst.de>
Thu, 4 Dec 2014 08:55:45 +0000 (09:55 +0100)
Since we got rid of ordered tag support in 2010 the prime use case of
switching on and off ordered tags has been obsolete.  The other function
of enabling/disabling tagging entirely has only been correctly implemented
by the 53c700 driver and isn't generally useful.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
25 files changed:
drivers/infiniband/ulp/srp/ib_srp.c
drivers/scsi/53c700.c
drivers/scsi/aic94xx/aic94xx_init.c
drivers/scsi/bnx2fc/bnx2fc_fcoe.c
drivers/scsi/esas2r/esas2r_main.c
drivers/scsi/fcoe/fcoe.c
drivers/scsi/fnic/fnic_main.c
drivers/scsi/ibmvscsi/ibmvfc.c
drivers/scsi/ipr.c
drivers/scsi/isci/init.c
drivers/scsi/libsas/sas_scsi_host.c
drivers/scsi/lpfc/lpfc_scsi.c
drivers/scsi/mpt2sas/mpt2sas_scsih.c
drivers/scsi/mpt3sas/mpt3sas_scsih.c
drivers/scsi/mvsas/mv_init.c
drivers/scsi/pm8001/pm8001_init.c
drivers/scsi/pmcraid.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/scsi.c
drivers/scsi/scsi_debug.c
drivers/scsi/scsi_sysfs.c
drivers/target/loopback/tcm_loop.c
include/scsi/libsas.h
include/scsi/scsi_host.h
include/scsi/scsi_tcq.h

index 5461924c9f10ef9311a8f11a5091170c4597281a..a1640364144b81ee88b2f65d949ab8bfd13b9ead 100644 (file)
@@ -2740,7 +2740,6 @@ static struct scsi_host_template srp_template = {
        .info                           = srp_target_info,
        .queuecommand                   = srp_queuecommand,
        .change_queue_depth             = srp_change_queue_depth,
-       .change_queue_type              = scsi_change_queue_type,
        .eh_abort_handler               = srp_abort,
        .eh_device_reset_handler        = srp_reset_device,
        .eh_host_reset_handler          = srp_reset_host,
index aa915da2a5e53c6a094b591e9effce404e813b21..e7229114b52da805a33ebe1350d0366295849248 100644 (file)
@@ -176,7 +176,6 @@ STATIC int NCR_700_slave_alloc(struct scsi_device *SDpnt);
 STATIC int NCR_700_slave_configure(struct scsi_device *SDpnt);
 STATIC void NCR_700_slave_destroy(struct scsi_device *SDpnt);
 static int NCR_700_change_queue_depth(struct scsi_device *SDpnt, int depth);
-static int NCR_700_change_queue_type(struct scsi_device *SDpnt, int depth);
 
 STATIC struct device_attribute *NCR_700_dev_attrs[];
 
@@ -326,7 +325,6 @@ NCR_700_detect(struct scsi_host_template *tpnt,
        tpnt->slave_destroy = NCR_700_slave_destroy;
        tpnt->slave_alloc = NCR_700_slave_alloc;
        tpnt->change_queue_depth = NCR_700_change_queue_depth;
-       tpnt->change_queue_type = NCR_700_change_queue_type;
        tpnt->use_blk_tags = 1;
 
        if(tpnt->name == NULL)
@@ -2082,39 +2080,6 @@ NCR_700_change_queue_depth(struct scsi_device *SDp, int depth)
        return scsi_change_queue_depth(SDp, depth);
 }
 
-static int NCR_700_change_queue_type(struct scsi_device *SDp, int tag_type)
-{
-       int change_tag = ((tag_type ==0 &&  scsi_get_tag_type(SDp) != 0)
-                         || (tag_type != 0 && scsi_get_tag_type(SDp) == 0));
-       struct NCR_700_Host_Parameters *hostdata = 
-               (struct NCR_700_Host_Parameters *)SDp->host->hostdata[0];
-
-       /* We have a global (per target) flag to track whether TCQ is
-        * enabled, so we'll be turning it off for the entire target here.
-        * our tag algorithm will fail if we mix tagged and untagged commands,
-        * so quiesce the device before doing this */
-       if (change_tag)
-               scsi_target_quiesce(SDp->sdev_target);
-
-       scsi_set_tag_type(SDp, tag_type);
-       if (!tag_type) {
-               /* shift back to the default unqueued number of commands
-                * (the user can still raise this) */
-               scsi_change_queue_depth(SDp, SDp->host->cmd_per_lun);
-               hostdata->tag_negotiated &= ~(1 << sdev_id(SDp));
-       } else {
-               /* Here, we cleared the negotiation flag above, so this
-                * will force the driver to renegotiate */
-               scsi_change_queue_depth(SDp, SDp->queue_depth);
-               if (change_tag)
-                       NCR_700_set_tag_neg_state(SDp, NCR_700_START_TAG_NEGOTIATION);
-       }
-       if (change_tag)
-               scsi_target_resume(SDp->sdev_target);
-
-       return tag_type;
-}
-
 static ssize_t
 NCR_700_show_active_tags(struct device *dev, struct device_attribute *attr, char *buf)
 {
index 14fc018436c235cc3d2267fb889d4831f4dc60ce..02a2512b76a8ee540e0454f5384f37afbcf20dde 100644 (file)
@@ -63,7 +63,6 @@ static struct scsi_host_template aic94xx_sht = {
        .scan_finished          = asd_scan_finished,
        .scan_start             = asd_scan_start,
        .change_queue_depth     = sas_change_queue_depth,
-       .change_queue_type      = sas_change_queue_type,
        .bios_param             = sas_bios_param,
        .can_queue              = 1,
        .cmd_per_lun            = 1,
index 386c2cfad3061a33d005267cf85f3a8ad88ce24a..17a29e97ca033c437db04bb739c3bb58c0800e63 100644 (file)
@@ -2785,7 +2785,6 @@ static struct scsi_host_template bnx2fc_shost_template = {
        .eh_host_reset_handler  = fc_eh_host_reset,
        .slave_alloc            = fc_slave_alloc,
        .change_queue_depth     = scsi_change_queue_depth,
-       .change_queue_type      = scsi_change_queue_type,
        .this_id                = -1,
        .cmd_per_lun            = 3,
        .use_clustering         = ENABLE_CLUSTERING,
index 593ff8a63c706a85e8ca61df243160244cccf991..7e1c21e6736b7aef9a2ba5cebc308298b7100e2b 100644 (file)
@@ -255,7 +255,6 @@ static struct scsi_host_template driver_template = {
        .emulated                       = 0,
        .proc_name                      = ESAS2R_DRVR_NAME,
        .change_queue_depth             = scsi_change_queue_depth,
-       .change_queue_type              = scsi_change_queue_type,
        .max_sectors                    = 0xFFFF,
        .use_blk_tags                   = 1,
 };
index 308a016fdaeafd99c984788465a23983a1c71425..49df2130bd093354c2222c3e1935dc25a0fa8780 100644 (file)
@@ -281,7 +281,6 @@ static struct scsi_host_template fcoe_shost_template = {
        .eh_host_reset_handler = fc_eh_host_reset,
        .slave_alloc = fc_slave_alloc,
        .change_queue_depth = scsi_change_queue_depth,
-       .change_queue_type = scsi_change_queue_type,
        .this_id = -1,
        .cmd_per_lun = 3,
        .can_queue = FCOE_MAX_OUTSTANDING_COMMANDS,
index 0c1f8177b5b72abf8f0c4d3d0b587dbb85a85226..8a0d4d7b3254d715c32cfcc41bb0fc66dd221221 100644 (file)
@@ -111,7 +111,6 @@ static struct scsi_host_template fnic_host_template = {
        .eh_host_reset_handler = fnic_host_reset,
        .slave_alloc = fnic_slave_alloc,
        .change_queue_depth = scsi_change_queue_depth,
-       .change_queue_type = scsi_change_queue_type,
        .this_id = -1,
        .cmd_per_lun = 3,
        .can_queue = FNIC_DFLT_IO_REQ,
index f58c6d8e02644fcae6d2b82d0e6858c24faa3664..6e3596471caa42425f26a233e6c3a15e2b7c1f7a 100644 (file)
@@ -3089,7 +3089,6 @@ static struct scsi_host_template driver_template = {
        .target_alloc = ibmvfc_target_alloc,
        .scan_finished = ibmvfc_scan_finished,
        .change_queue_depth = ibmvfc_change_queue_depth,
-       .change_queue_type = scsi_change_queue_type,
        .cmd_per_lun = 16,
        .can_queue = IBMVFC_MAX_REQUESTS_DEFAULT,
        .this_id = -1,
index 5402943893559cb47d3f16a33ebf7db294ee2b74..c35ef5f01e925ed88a5586070564d7931958cc4f 100644 (file)
@@ -4345,30 +4345,6 @@ static int ipr_change_queue_depth(struct scsi_device *sdev, int qdepth)
        return sdev->queue_depth;
 }
 
-/**
- * ipr_change_queue_type - Change the device's queue type
- * @dsev:              scsi device struct
- * @tag_type:  type of tags to use
- *
- * Return value:
- *     actual queue type set
- **/
-static int ipr_change_queue_type(struct scsi_device *sdev, int tag_type)
-{
-       struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)sdev->host->hostdata;
-       struct ipr_resource_entry *res;
-       unsigned long lock_flags = 0;
-
-       spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
-       res = (struct ipr_resource_entry *)sdev->hostdata;
-       if (res && ipr_is_gscsi(res))
-               tag_type = scsi_change_queue_type(sdev, tag_type);
-       else
-               tag_type = 0;
-       spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
-       return tag_type;
-}
-
 /**
  * ipr_show_adapter_handle - Show the adapter's resource handle for this device
  * @dev:       device struct
@@ -6302,7 +6278,6 @@ static struct scsi_host_template driver_template = {
        .target_alloc = ipr_target_alloc,
        .target_destroy = ipr_target_destroy,
        .change_queue_depth = ipr_change_queue_depth,
-       .change_queue_type = ipr_change_queue_type,
        .bios_param = ipr_biosparam,
        .can_queue = IPR_MAX_COMMANDS,
        .this_id = -1,
index 724c6265b667a559c762c5b930caa60c6558f962..cd41b63a2f10f3c943b3463efd9e633999708501 100644 (file)
@@ -158,7 +158,6 @@ static struct scsi_host_template isci_sht = {
        .scan_finished                  = isci_host_scan_finished,
        .scan_start                     = isci_host_start,
        .change_queue_depth             = sas_change_queue_depth,
-       .change_queue_type              = sas_change_queue_type,
        .bios_param                     = sas_bios_param,
        .can_queue                      = ISCI_CAN_QUEUE_VAL,
        .cmd_per_lun                    = 1,
index 72918d227ead30811a0b43f95d6942f7b7d191fe..519dac4e341e3d05af47d35fd2580a8a8ecc2c67 100644 (file)
@@ -906,13 +906,6 @@ int sas_change_queue_depth(struct scsi_device *sdev, int depth)
        return scsi_change_queue_depth(sdev, depth);
 }
 
-int sas_change_queue_type(struct scsi_device *scsi_dev, int type)
-{
-       if (dev_is_sata(sdev_to_domain_dev(scsi_dev)))
-               return -EINVAL;
-       return scsi_change_queue_type(scsi_dev, type);
-}
-
 int sas_bios_param(struct scsi_device *scsi_dev,
                          struct block_device *bdev,
                          sector_t capacity, int *hsc)
@@ -1011,7 +1004,6 @@ EXPORT_SYMBOL_GPL(sas_queuecommand);
 EXPORT_SYMBOL_GPL(sas_target_alloc);
 EXPORT_SYMBOL_GPL(sas_slave_configure);
 EXPORT_SYMBOL_GPL(sas_change_queue_depth);
-EXPORT_SYMBOL_GPL(sas_change_queue_type);
 EXPORT_SYMBOL_GPL(sas_bios_param);
 EXPORT_SYMBOL_GPL(sas_task_abort);
 EXPORT_SYMBOL_GPL(sas_phy_reset);
index fd85952b621d6e76d8db7d00682671d1458a2c78..4f9222eb22669b6a84f0e5cad891958e6e8c6e22 100644 (file)
@@ -5879,7 +5879,6 @@ struct scsi_host_template lpfc_template = {
        .max_sectors            = 0xFFFF,
        .vendor_id              = LPFC_NL_VENDOR_ID,
        .change_queue_depth     = scsi_change_queue_depth,
-       .change_queue_type      = scsi_change_queue_type,
        .use_blk_tags           = 1,
        .track_queue_depth      = 1,
 };
@@ -5904,7 +5903,6 @@ struct scsi_host_template lpfc_vport_template = {
        .shost_attrs            = lpfc_vport_attrs,
        .max_sectors            = 0xFFFF,
        .change_queue_depth     = scsi_change_queue_depth,
-       .change_queue_type      = scsi_change_queue_type,
        .use_blk_tags           = 1,
        .track_queue_depth      = 1,
 };
index 8431eb10bbb1fa4f89bdbfbbdb2e5a74b3c10086..6a1c036a6f3f085cabd6ad69838b64d59290507d 100644 (file)
@@ -7592,7 +7592,6 @@ static struct scsi_host_template scsih_driver_template = {
        .scan_finished                  = _scsih_scan_finished,
        .scan_start                     = _scsih_scan_start,
        .change_queue_depth             = _scsih_change_queue_depth,
-       .change_queue_type              = scsi_change_queue_type,
        .eh_abort_handler               = _scsih_abort,
        .eh_device_reset_handler        = _scsih_dev_reset,
        .eh_target_reset_handler        = _scsih_target_reset,
index a2b60991efd4f5651f0eab185156c08e3db1a26c..94261ee9e72dcc5896ed4807e1f86c32670126e3 100644 (file)
@@ -7229,7 +7229,6 @@ static struct scsi_host_template scsih_driver_template = {
        .scan_finished                  = _scsih_scan_finished,
        .scan_start                     = _scsih_scan_start,
        .change_queue_depth             = _scsih_change_queue_depth,
-       .change_queue_type              = scsi_change_queue_type,
        .eh_abort_handler               = _scsih_abort,
        .eh_device_reset_handler        = _scsih_dev_reset,
        .eh_target_reset_handler        = _scsih_target_reset,
index f15df3de6790eeea406dd5593f3e87e74c83957f..53030b0e8015d833719b276adad1d8898cb89780 100644 (file)
@@ -54,7 +54,6 @@ static struct scsi_host_template mvs_sht = {
        .scan_finished          = mvs_scan_finished,
        .scan_start             = mvs_scan_start,
        .change_queue_depth     = sas_change_queue_depth,
-       .change_queue_type      = sas_change_queue_type,
        .bios_param             = sas_bios_param,
        .can_queue              = 1,
        .cmd_per_lun            = 1,
index 329aba0083aba7f3556610a7d924241c218ae812..65555916d3b84e89fefa34817375276f0831342e 100644 (file)
@@ -76,7 +76,6 @@ static struct scsi_host_template pm8001_sht = {
        .scan_finished          = pm8001_scan_finished,
        .scan_start             = pm8001_scan_start,
        .change_queue_depth     = sas_change_queue_depth,
-       .change_queue_type      = sas_change_queue_type,
        .bios_param             = sas_bios_param,
        .can_queue              = 1,
        .cmd_per_lun            = 1,
index b1b1f66b1ab7817f739da1308f1cd92932c164dc..8c27b6a77ec4b1ae9c914cfe15eb05d7dd0b371a 100644 (file)
@@ -4251,7 +4251,6 @@ static struct scsi_host_template pmcraid_host_template = {
        .slave_configure = pmcraid_slave_configure,
        .slave_destroy = pmcraid_slave_destroy,
        .change_queue_depth = pmcraid_change_queue_depth,
-       .change_queue_type  = scsi_change_queue_type,
        .can_queue = PMCRAID_MAX_IO_CMD,
        .this_id = -1,
        .sg_tablesize = PMCRAID_MAX_IOADLS,
index 6b4d9235368a716b596b7af112312cdcaf7b494d..12ca291c1380845e45a40b0b4f5f4dd3356ab429 100644 (file)
@@ -258,7 +258,6 @@ struct scsi_host_template qla2xxx_driver_template = {
        .scan_finished          = qla2xxx_scan_finished,
        .scan_start             = qla2xxx_scan_start,
        .change_queue_depth     = scsi_change_queue_depth,
-       .change_queue_type      = scsi_change_queue_type,
        .this_id                = -1,
        .cmd_per_lun            = 3,
        .use_clustering         = ENABLE_CLUSTERING,
index 5ea15fc7d2fb91f9e4663e4946a15897a1b48e27..72282ae3009d35dc5b9212d6ff69f1325325ed0d 100644 (file)
@@ -831,22 +831,6 @@ int scsi_track_queue_full(struct scsi_device *sdev, int depth)
 }
 EXPORT_SYMBOL(scsi_track_queue_full);
 
-/**
- * scsi_change_queue_type() - Change a device's queue type
- * @sdev:     The SCSI device whose queue depth is to change
- * @tag_type: Identifier for queue type
- */
-int scsi_change_queue_type(struct scsi_device *sdev, int tag_type)
-{
-       if (!sdev->tagged_supported)
-               return 0;
-
-       scsi_set_tag_type(sdev, tag_type);
-       return tag_type;
-
-}
-EXPORT_SYMBOL(scsi_change_queue_type);
-
 /**
  * scsi_vpd_inquiry - Request a device provide us with a VPD page
  * @sdev: The device to ask
index aa4b6b80aadee31c85d9678d82160472e518a907..87b5361d893ba356b7dbbea66d5a6415eb9b536b 100644 (file)
@@ -4987,32 +4987,6 @@ sdebug_change_qdepth(struct scsi_device *sdev, int qdepth)
        return sdev->queue_depth;
 }
 
-static int
-sdebug_change_qtype(struct scsi_device *sdev, int qtype)
-{
-       qtype = scsi_change_queue_type(sdev, qtype);
-       if (SCSI_DEBUG_OPT_Q_NOISE & scsi_debug_opts) {
-               const char *cp;
-
-               switch (qtype) {
-               case 0:
-                       cp = "untagged";
-                       break;
-               case MSG_SIMPLE_TAG:
-                       cp = "simple tags";
-                       break;
-               case MSG_ORDERED_TAG:
-                       cp = "ordered tags";
-                       break;
-               default:
-                       cp = "unknown";
-                       break;
-               }
-               sdev_printk(KERN_INFO, sdev, "%s: to %s\n", __func__, cp);
-       }
-       return qtype;
-}
-
 static int
 check_inject(struct scsi_cmnd *scp)
 {
@@ -5212,7 +5186,6 @@ static struct scsi_host_template sdebug_driver_template = {
        .ioctl =                scsi_debug_ioctl,
        .queuecommand =         sdebug_queuecommand_lock_or_not,
        .change_queue_depth =   sdebug_change_qdepth,
-       .change_queue_type =    sdebug_change_qtype,
        .eh_abort_handler =     scsi_debug_abort,
        .eh_device_reset_handler = scsi_debug_device_reset,
        .eh_target_reset_handler = scsi_debug_target_reset,
index 1cb64a8e18c91475d7f0bda12246fe7862782c03..1ac38e73df7eec896cf2835fd8588a1db5278a46 100644 (file)
@@ -738,30 +738,12 @@ store_queue_type_field(struct device *dev, struct device_attribute *attr,
                       const char *buf, size_t count)
 {
        struct scsi_device *sdev = to_scsi_device(dev);
-       struct scsi_host_template *sht = sdev->host->hostt;
-       int tag_type = 0, retval;
-       int prev_tag_type = scsi_get_tag_type(sdev);
-
-       if (!sdev->tagged_supported || !sht->change_queue_type)
-               return -EINVAL;
 
-       /*
-        * We're never issueing order tags these days, but allow the value
-        * for backwards compatibility.
-        */
-       if (strncmp(buf, "ordered", 7) == 0 ||
-           strncmp(buf, "simple", 6) == 0)
-               tag_type = MSG_SIMPLE_TAG;
-       else if (strncmp(buf, "none", 4) != 0)
+       if (!sdev->tagged_supported)
                return -EINVAL;
-
-       if (tag_type == prev_tag_type)
-               return count;
-
-       retval = sht->change_queue_type(sdev, tag_type);
-       if (retval < 0)
-               return retval;
-
+               
+       sdev_printk(KERN_INFO, sdev,
+                   "ignoring write to deprecated queue_type attribute");
        return count;
 }
 
@@ -938,10 +920,6 @@ static umode_t scsi_sdev_attr_is_visible(struct kobject *kobj,
            !sdev->host->hostt->change_queue_depth)
                return 0;
 
-       if (attr == &dev_attr_queue_type.attr &&
-           !sdev->host->hostt->change_queue_type)
-               return S_IRUGO;
-
        return attr->mode;
 }
 
index 4d1b7224a7f2559d200ec11aaced60a8d67c4a6c..24e2c94e429b2fb7d665fe8988cc4f0b561dade3 100644 (file)
@@ -385,7 +385,6 @@ static struct scsi_host_template tcm_loop_driver_template = {
        .name                   = "TCM_Loopback",
        .queuecommand           = tcm_loop_queuecommand,
        .change_queue_depth     = scsi_change_queue_depth,
-       .change_queue_type      = scsi_change_queue_type,
        .eh_abort_handler = tcm_loop_abort_task,
        .eh_device_reset_handler = tcm_loop_device_reset,
        .eh_target_reset_handler = tcm_loop_target_reset,
index 832dcc9f86ec9d7e2eef96a42de942a6d30cc679..8280234fba90d89fea5f74c9e4be090e89da51a1 100644 (file)
@@ -693,7 +693,6 @@ extern int sas_queuecommand(struct Scsi_Host * ,struct scsi_cmnd *);
 extern int sas_target_alloc(struct scsi_target *);
 extern int sas_slave_configure(struct scsi_device *);
 extern int sas_change_queue_depth(struct scsi_device *, int new_depth);
-extern int sas_change_queue_type(struct scsi_device *, int qt);
 extern int sas_bios_param(struct scsi_device *,
                          struct block_device *,
                          sector_t capacity, int *hsc);
index c8a462ef9a4ee2896914e3f14bfa29e979d13c27..c2fa8b49cb2e0946a17f1cc2043a4b16a07c2a57 100644 (file)
@@ -277,19 +277,6 @@ struct scsi_host_template {
         */
        int (* change_queue_depth)(struct scsi_device *, int);
 
-       /*
-        * Fill in this function to allow the changing of tag types
-        * (this also allows the enabling/disabling of tag command
-        * queueing).  An error should only be returned if something
-        * went wrong in the driver while trying to set the tag type.
-        * If the driver doesn't support the requested tag type, then
-        * it should set the closest type it does support without
-        * returning an error.  Returns the actual tag type set.
-        *
-        * Status: OPTIONAL
-        */
-       int (* change_queue_type)(struct scsi_device *, int);
-
        /*
         * This function determines the BIOS parameters for a given
         * harddisk.  These tend to be numbers that are made up by
index fe4a70299419cedc7160b08942bce7367517f3ab..59578beac053015085b4015485ece200b65b4c6c 100644 (file)
@@ -15,9 +15,6 @@
 
 
 #ifdef CONFIG_BLOCK
-
-int scsi_change_queue_type(struct scsi_device *sdev, int tag_type);
-
 /**
  * scsi_get_tag_type - get the type of tag the device supports
  * @sdev:      the scsi device