Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: remove ->change_queue_type method

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>

+4 -171
-1
drivers/infiniband/ulp/srp/ib_srp.c
··· 2740 2740 .info = srp_target_info, 2741 2741 .queuecommand = srp_queuecommand, 2742 2742 .change_queue_depth = srp_change_queue_depth, 2743 - .change_queue_type = scsi_change_queue_type, 2744 2743 .eh_abort_handler = srp_abort, 2745 2744 .eh_device_reset_handler = srp_reset_device, 2746 2745 .eh_host_reset_handler = srp_reset_host,
-35
drivers/scsi/53c700.c
··· 176 176 STATIC int NCR_700_slave_configure(struct scsi_device *SDpnt); 177 177 STATIC void NCR_700_slave_destroy(struct scsi_device *SDpnt); 178 178 static int NCR_700_change_queue_depth(struct scsi_device *SDpnt, int depth); 179 - static int NCR_700_change_queue_type(struct scsi_device *SDpnt, int depth); 180 179 181 180 STATIC struct device_attribute *NCR_700_dev_attrs[]; 182 181 ··· 325 326 tpnt->slave_destroy = NCR_700_slave_destroy; 326 327 tpnt->slave_alloc = NCR_700_slave_alloc; 327 328 tpnt->change_queue_depth = NCR_700_change_queue_depth; 328 - tpnt->change_queue_type = NCR_700_change_queue_type; 329 329 tpnt->use_blk_tags = 1; 330 330 331 331 if(tpnt->name == NULL) ··· 2078 2080 if (depth > NCR_700_MAX_TAGS) 2079 2081 depth = NCR_700_MAX_TAGS; 2080 2082 return scsi_change_queue_depth(SDp, depth); 2081 - } 2082 - 2083 - static int NCR_700_change_queue_type(struct scsi_device *SDp, int tag_type) 2084 - { 2085 - int change_tag = ((tag_type ==0 && scsi_get_tag_type(SDp) != 0) 2086 - || (tag_type != 0 && scsi_get_tag_type(SDp) == 0)); 2087 - struct NCR_700_Host_Parameters *hostdata = 2088 - (struct NCR_700_Host_Parameters *)SDp->host->hostdata[0]; 2089 - 2090 - /* We have a global (per target) flag to track whether TCQ is 2091 - * enabled, so we'll be turning it off for the entire target here. 2092 - * our tag algorithm will fail if we mix tagged and untagged commands, 2093 - * so quiesce the device before doing this */ 2094 - if (change_tag) 2095 - scsi_target_quiesce(SDp->sdev_target); 2096 - 2097 - scsi_set_tag_type(SDp, tag_type); 2098 - if (!tag_type) { 2099 - /* shift back to the default unqueued number of commands 2100 - * (the user can still raise this) */ 2101 - scsi_change_queue_depth(SDp, SDp->host->cmd_per_lun); 2102 - hostdata->tag_negotiated &= ~(1 << sdev_id(SDp)); 2103 - } else { 2104 - /* Here, we cleared the negotiation flag above, so this 2105 - * will force the driver to renegotiate */ 2106 - scsi_change_queue_depth(SDp, SDp->queue_depth); 2107 - if (change_tag) 2108 - NCR_700_set_tag_neg_state(SDp, NCR_700_START_TAG_NEGOTIATION); 2109 - } 2110 - if (change_tag) 2111 - scsi_target_resume(SDp->sdev_target); 2112 - 2113 - return tag_type; 2114 2083 } 2115 2084 2116 2085 static ssize_t
-1
drivers/scsi/aic94xx/aic94xx_init.c
··· 63 63 .scan_finished = asd_scan_finished, 64 64 .scan_start = asd_scan_start, 65 65 .change_queue_depth = sas_change_queue_depth, 66 - .change_queue_type = sas_change_queue_type, 67 66 .bios_param = sas_bios_param, 68 67 .can_queue = 1, 69 68 .cmd_per_lun = 1,
-1
drivers/scsi/bnx2fc/bnx2fc_fcoe.c
··· 2785 2785 .eh_host_reset_handler = fc_eh_host_reset, 2786 2786 .slave_alloc = fc_slave_alloc, 2787 2787 .change_queue_depth = scsi_change_queue_depth, 2788 - .change_queue_type = scsi_change_queue_type, 2789 2788 .this_id = -1, 2790 2789 .cmd_per_lun = 3, 2791 2790 .use_clustering = ENABLE_CLUSTERING,
-1
drivers/scsi/esas2r/esas2r_main.c
··· 255 255 .emulated = 0, 256 256 .proc_name = ESAS2R_DRVR_NAME, 257 257 .change_queue_depth = scsi_change_queue_depth, 258 - .change_queue_type = scsi_change_queue_type, 259 258 .max_sectors = 0xFFFF, 260 259 .use_blk_tags = 1, 261 260 };
-1
drivers/scsi/fcoe/fcoe.c
··· 281 281 .eh_host_reset_handler = fc_eh_host_reset, 282 282 .slave_alloc = fc_slave_alloc, 283 283 .change_queue_depth = scsi_change_queue_depth, 284 - .change_queue_type = scsi_change_queue_type, 285 284 .this_id = -1, 286 285 .cmd_per_lun = 3, 287 286 .can_queue = FCOE_MAX_OUTSTANDING_COMMANDS,
-1
drivers/scsi/fnic/fnic_main.c
··· 111 111 .eh_host_reset_handler = fnic_host_reset, 112 112 .slave_alloc = fnic_slave_alloc, 113 113 .change_queue_depth = scsi_change_queue_depth, 114 - .change_queue_type = scsi_change_queue_type, 115 114 .this_id = -1, 116 115 .cmd_per_lun = 3, 117 116 .can_queue = FNIC_DFLT_IO_REQ,
-1
drivers/scsi/ibmvscsi/ibmvfc.c
··· 3089 3089 .target_alloc = ibmvfc_target_alloc, 3090 3090 .scan_finished = ibmvfc_scan_finished, 3091 3091 .change_queue_depth = ibmvfc_change_queue_depth, 3092 - .change_queue_type = scsi_change_queue_type, 3093 3092 .cmd_per_lun = 16, 3094 3093 .can_queue = IBMVFC_MAX_REQUESTS_DEFAULT, 3095 3094 .this_id = -1,
-25
drivers/scsi/ipr.c
··· 4346 4346 } 4347 4347 4348 4348 /** 4349 - * ipr_change_queue_type - Change the device's queue type 4350 - * @dsev: scsi device struct 4351 - * @tag_type: type of tags to use 4352 - * 4353 - * Return value: 4354 - * actual queue type set 4355 - **/ 4356 - static int ipr_change_queue_type(struct scsi_device *sdev, int tag_type) 4357 - { 4358 - struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)sdev->host->hostdata; 4359 - struct ipr_resource_entry *res; 4360 - unsigned long lock_flags = 0; 4361 - 4362 - spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); 4363 - res = (struct ipr_resource_entry *)sdev->hostdata; 4364 - if (res && ipr_is_gscsi(res)) 4365 - tag_type = scsi_change_queue_type(sdev, tag_type); 4366 - else 4367 - tag_type = 0; 4368 - spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 4369 - return tag_type; 4370 - } 4371 - 4372 - /** 4373 4349 * ipr_show_adapter_handle - Show the adapter's resource handle for this device 4374 4350 * @dev: device struct 4375 4351 * @attr: device attribute structure ··· 6278 6302 .target_alloc = ipr_target_alloc, 6279 6303 .target_destroy = ipr_target_destroy, 6280 6304 .change_queue_depth = ipr_change_queue_depth, 6281 - .change_queue_type = ipr_change_queue_type, 6282 6305 .bios_param = ipr_biosparam, 6283 6306 .can_queue = IPR_MAX_COMMANDS, 6284 6307 .this_id = -1,
-1
drivers/scsi/isci/init.c
··· 158 158 .scan_finished = isci_host_scan_finished, 159 159 .scan_start = isci_host_start, 160 160 .change_queue_depth = sas_change_queue_depth, 161 - .change_queue_type = sas_change_queue_type, 162 161 .bios_param = sas_bios_param, 163 162 .can_queue = ISCI_CAN_QUEUE_VAL, 164 163 .cmd_per_lun = 1,
-8
drivers/scsi/libsas/sas_scsi_host.c
··· 906 906 return scsi_change_queue_depth(sdev, depth); 907 907 } 908 908 909 - int sas_change_queue_type(struct scsi_device *scsi_dev, int type) 910 - { 911 - if (dev_is_sata(sdev_to_domain_dev(scsi_dev))) 912 - return -EINVAL; 913 - return scsi_change_queue_type(scsi_dev, type); 914 - } 915 - 916 909 int sas_bios_param(struct scsi_device *scsi_dev, 917 910 struct block_device *bdev, 918 911 sector_t capacity, int *hsc) ··· 1004 1011 EXPORT_SYMBOL_GPL(sas_target_alloc); 1005 1012 EXPORT_SYMBOL_GPL(sas_slave_configure); 1006 1013 EXPORT_SYMBOL_GPL(sas_change_queue_depth); 1007 - EXPORT_SYMBOL_GPL(sas_change_queue_type); 1008 1014 EXPORT_SYMBOL_GPL(sas_bios_param); 1009 1015 EXPORT_SYMBOL_GPL(sas_task_abort); 1010 1016 EXPORT_SYMBOL_GPL(sas_phy_reset);
-2
drivers/scsi/lpfc/lpfc_scsi.c
··· 5879 5879 .max_sectors = 0xFFFF, 5880 5880 .vendor_id = LPFC_NL_VENDOR_ID, 5881 5881 .change_queue_depth = scsi_change_queue_depth, 5882 - .change_queue_type = scsi_change_queue_type, 5883 5882 .use_blk_tags = 1, 5884 5883 .track_queue_depth = 1, 5885 5884 }; ··· 5903 5904 .shost_attrs = lpfc_vport_attrs, 5904 5905 .max_sectors = 0xFFFF, 5905 5906 .change_queue_depth = scsi_change_queue_depth, 5906 - .change_queue_type = scsi_change_queue_type, 5907 5907 .use_blk_tags = 1, 5908 5908 .track_queue_depth = 1, 5909 5909 };
-1
drivers/scsi/mpt2sas/mpt2sas_scsih.c
··· 7592 7592 .scan_finished = _scsih_scan_finished, 7593 7593 .scan_start = _scsih_scan_start, 7594 7594 .change_queue_depth = _scsih_change_queue_depth, 7595 - .change_queue_type = scsi_change_queue_type, 7596 7595 .eh_abort_handler = _scsih_abort, 7597 7596 .eh_device_reset_handler = _scsih_dev_reset, 7598 7597 .eh_target_reset_handler = _scsih_target_reset,
-1
drivers/scsi/mpt3sas/mpt3sas_scsih.c
··· 7229 7229 .scan_finished = _scsih_scan_finished, 7230 7230 .scan_start = _scsih_scan_start, 7231 7231 .change_queue_depth = _scsih_change_queue_depth, 7232 - .change_queue_type = scsi_change_queue_type, 7233 7232 .eh_abort_handler = _scsih_abort, 7234 7233 .eh_device_reset_handler = _scsih_dev_reset, 7235 7234 .eh_target_reset_handler = _scsih_target_reset,
-1
drivers/scsi/mvsas/mv_init.c
··· 54 54 .scan_finished = mvs_scan_finished, 55 55 .scan_start = mvs_scan_start, 56 56 .change_queue_depth = sas_change_queue_depth, 57 - .change_queue_type = sas_change_queue_type, 58 57 .bios_param = sas_bios_param, 59 58 .can_queue = 1, 60 59 .cmd_per_lun = 1,
-1
drivers/scsi/pm8001/pm8001_init.c
··· 76 76 .scan_finished = pm8001_scan_finished, 77 77 .scan_start = pm8001_scan_start, 78 78 .change_queue_depth = sas_change_queue_depth, 79 - .change_queue_type = sas_change_queue_type, 80 79 .bios_param = sas_bios_param, 81 80 .can_queue = 1, 82 81 .cmd_per_lun = 1,
-1
drivers/scsi/pmcraid.c
··· 4251 4251 .slave_configure = pmcraid_slave_configure, 4252 4252 .slave_destroy = pmcraid_slave_destroy, 4253 4253 .change_queue_depth = pmcraid_change_queue_depth, 4254 - .change_queue_type = scsi_change_queue_type, 4255 4254 .can_queue = PMCRAID_MAX_IO_CMD, 4256 4255 .this_id = -1, 4257 4256 .sg_tablesize = PMCRAID_MAX_IOADLS,
-1
drivers/scsi/qla2xxx/qla_os.c
··· 258 258 .scan_finished = qla2xxx_scan_finished, 259 259 .scan_start = qla2xxx_scan_start, 260 260 .change_queue_depth = scsi_change_queue_depth, 261 - .change_queue_type = scsi_change_queue_type, 262 261 .this_id = -1, 263 262 .cmd_per_lun = 3, 264 263 .use_clustering = ENABLE_CLUSTERING,
-16
drivers/scsi/scsi.c
··· 832 832 EXPORT_SYMBOL(scsi_track_queue_full); 833 833 834 834 /** 835 - * scsi_change_queue_type() - Change a device's queue type 836 - * @sdev: The SCSI device whose queue depth is to change 837 - * @tag_type: Identifier for queue type 838 - */ 839 - int scsi_change_queue_type(struct scsi_device *sdev, int tag_type) 840 - { 841 - if (!sdev->tagged_supported) 842 - return 0; 843 - 844 - scsi_set_tag_type(sdev, tag_type); 845 - return tag_type; 846 - 847 - } 848 - EXPORT_SYMBOL(scsi_change_queue_type); 849 - 850 - /** 851 835 * scsi_vpd_inquiry - Request a device provide us with a VPD page 852 836 * @sdev: The device to ask 853 837 * @buffer: Where to put the result
-27
drivers/scsi/scsi_debug.c
··· 4988 4988 } 4989 4989 4990 4990 static int 4991 - sdebug_change_qtype(struct scsi_device *sdev, int qtype) 4992 - { 4993 - qtype = scsi_change_queue_type(sdev, qtype); 4994 - if (SCSI_DEBUG_OPT_Q_NOISE & scsi_debug_opts) { 4995 - const char *cp; 4996 - 4997 - switch (qtype) { 4998 - case 0: 4999 - cp = "untagged"; 5000 - break; 5001 - case MSG_SIMPLE_TAG: 5002 - cp = "simple tags"; 5003 - break; 5004 - case MSG_ORDERED_TAG: 5005 - cp = "ordered tags"; 5006 - break; 5007 - default: 5008 - cp = "unknown"; 5009 - break; 5010 - } 5011 - sdev_printk(KERN_INFO, sdev, "%s: to %s\n", __func__, cp); 5012 - } 5013 - return qtype; 5014 - } 5015 - 5016 - static int 5017 4991 check_inject(struct scsi_cmnd *scp) 5018 4992 { 5019 4993 struct sdebug_scmd_extra_t *ep = scsi_cmd_priv(scp); ··· 5186 5212 .ioctl = scsi_debug_ioctl, 5187 5213 .queuecommand = sdebug_queuecommand_lock_or_not, 5188 5214 .change_queue_depth = sdebug_change_qdepth, 5189 - .change_queue_type = sdebug_change_qtype, 5190 5215 .eh_abort_handler = scsi_debug_abort, 5191 5216 .eh_device_reset_handler = scsi_debug_device_reset, 5192 5217 .eh_target_reset_handler = scsi_debug_target_reset,
+4 -26
drivers/scsi/scsi_sysfs.c
··· 738 738 const char *buf, size_t count) 739 739 { 740 740 struct scsi_device *sdev = to_scsi_device(dev); 741 - struct scsi_host_template *sht = sdev->host->hostt; 742 - int tag_type = 0, retval; 743 - int prev_tag_type = scsi_get_tag_type(sdev); 744 741 745 - if (!sdev->tagged_supported || !sht->change_queue_type) 742 + if (!sdev->tagged_supported) 746 743 return -EINVAL; 747 - 748 - /* 749 - * We're never issueing order tags these days, but allow the value 750 - * for backwards compatibility. 751 - */ 752 - if (strncmp(buf, "ordered", 7) == 0 || 753 - strncmp(buf, "simple", 6) == 0) 754 - tag_type = MSG_SIMPLE_TAG; 755 - else if (strncmp(buf, "none", 4) != 0) 756 - return -EINVAL; 757 - 758 - if (tag_type == prev_tag_type) 759 - return count; 760 - 761 - retval = sht->change_queue_type(sdev, tag_type); 762 - if (retval < 0) 763 - return retval; 764 - 744 + 745 + sdev_printk(KERN_INFO, sdev, 746 + "ignoring write to deprecated queue_type attribute"); 765 747 return count; 766 748 } 767 749 ··· 919 937 if (attr == &dev_attr_queue_ramp_up_period.attr && 920 938 !sdev->host->hostt->change_queue_depth) 921 939 return 0; 922 - 923 - if (attr == &dev_attr_queue_type.attr && 924 - !sdev->host->hostt->change_queue_type) 925 - return S_IRUGO; 926 940 927 941 return attr->mode; 928 942 }
-1
drivers/target/loopback/tcm_loop.c
··· 385 385 .name = "TCM_Loopback", 386 386 .queuecommand = tcm_loop_queuecommand, 387 387 .change_queue_depth = scsi_change_queue_depth, 388 - .change_queue_type = scsi_change_queue_type, 389 388 .eh_abort_handler = tcm_loop_abort_task, 390 389 .eh_device_reset_handler = tcm_loop_device_reset, 391 390 .eh_target_reset_handler = tcm_loop_target_reset,
-1
include/scsi/libsas.h
··· 693 693 extern int sas_target_alloc(struct scsi_target *); 694 694 extern int sas_slave_configure(struct scsi_device *); 695 695 extern int sas_change_queue_depth(struct scsi_device *, int new_depth); 696 - extern int sas_change_queue_type(struct scsi_device *, int qt); 697 696 extern int sas_bios_param(struct scsi_device *, 698 697 struct block_device *, 699 698 sector_t capacity, int *hsc);
-13
include/scsi/scsi_host.h
··· 278 278 int (* change_queue_depth)(struct scsi_device *, int); 279 279 280 280 /* 281 - * Fill in this function to allow the changing of tag types 282 - * (this also allows the enabling/disabling of tag command 283 - * queueing). An error should only be returned if something 284 - * went wrong in the driver while trying to set the tag type. 285 - * If the driver doesn't support the requested tag type, then 286 - * it should set the closest type it does support without 287 - * returning an error. Returns the actual tag type set. 288 - * 289 - * Status: OPTIONAL 290 - */ 291 - int (* change_queue_type)(struct scsi_device *, int); 292 - 293 - /* 294 281 * This function determines the BIOS parameters for a given 295 282 * harddisk. These tend to be numbers that are made up by 296 283 * the host adapter. Parameters:
-3
include/scsi/scsi_tcq.h
··· 15 15 16 16 17 17 #ifdef CONFIG_BLOCK 18 - 19 - int scsi_change_queue_type(struct scsi_device *sdev, int tag_type); 20 - 21 18 /** 22 19 * scsi_get_tag_type - get the type of tag the device supports 23 20 * @sdev: the scsi device