aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c24
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_fcoe.c2
-rw-r--r--drivers/scsi/esas2r/esas2r.h1
-rw-r--r--drivers/scsi/esas2r/esas2r_main.c20
-rw-r--r--drivers/scsi/fcoe/fcoe.c2
-rw-r--r--drivers/scsi/fnic/fnic_main.c2
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c25
-rw-r--r--drivers/scsi/ipr.c20
-rw-r--r--drivers/scsi/libfc/fc_fcp.c20
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c24
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c24
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_scsih.c25
-rw-r--r--drivers/scsi/pmcraid.c14
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c18
-rw-r--r--drivers/scsi/scsi.c20
-rw-r--r--drivers/scsi/scsi_debug.c9
-rw-r--r--drivers/target/loopback/tcm_loop.c17
-rw-r--r--include/scsi/libfc.h1
-rw-r--r--include/scsi/scsi_tcq.h2
19 files changed, 42 insertions, 228 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 62d2a18e1b41..51670d75ab78 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -2259,28 +2259,6 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event)
2259} 2259}
2260 2260
2261/** 2261/**
2262 * srp_change_queue_type - changing device queue tag type
2263 * @sdev: scsi device struct
2264 * @tag_type: requested tag type
2265 *
2266 * Returns queue tag type.
2267 */
2268static int
2269srp_change_queue_type(struct scsi_device *sdev, int tag_type)
2270{
2271 if (sdev->tagged_supported) {
2272 scsi_set_tag_type(sdev, tag_type);
2273 if (tag_type)
2274 scsi_activate_tcq(sdev, sdev->queue_depth);
2275 else
2276 scsi_deactivate_tcq(sdev, sdev->queue_depth);
2277 } else
2278 tag_type = 0;
2279
2280 return tag_type;
2281}
2282
2283/**
2284 * srp_change_queue_depth - setting device queue depth 2262 * srp_change_queue_depth - setting device queue depth
2285 * @sdev: scsi device struct 2263 * @sdev: scsi device struct
2286 * @qdepth: requested queue depth 2264 * @qdepth: requested queue depth
@@ -2600,7 +2578,7 @@ static struct scsi_host_template srp_template = {
2600 .info = srp_target_info, 2578 .info = srp_target_info,
2601 .queuecommand = srp_queuecommand, 2579 .queuecommand = srp_queuecommand,
2602 .change_queue_depth = srp_change_queue_depth, 2580 .change_queue_depth = srp_change_queue_depth,
2603 .change_queue_type = srp_change_queue_type, 2581 .change_queue_type = scsi_change_queue_type,
2604 .eh_abort_handler = srp_abort, 2582 .eh_abort_handler = srp_abort,
2605 .eh_device_reset_handler = srp_reset_device, 2583 .eh_device_reset_handler = srp_reset_device,
2606 .eh_host_reset_handler = srp_reset_host, 2584 .eh_host_reset_handler = srp_reset_host,
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 79e5c94107a9..3c6dc8abc776 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -2784,7 +2784,7 @@ static struct scsi_host_template bnx2fc_shost_template = {
2784 .eh_host_reset_handler = fc_eh_host_reset, 2784 .eh_host_reset_handler = fc_eh_host_reset,
2785 .slave_alloc = fc_slave_alloc, 2785 .slave_alloc = fc_slave_alloc,
2786 .change_queue_depth = fc_change_queue_depth, 2786 .change_queue_depth = fc_change_queue_depth,
2787 .change_queue_type = fc_change_queue_type, 2787 .change_queue_type = scsi_change_queue_type,
2788 .this_id = -1, 2788 .this_id = -1,
2789 .cmd_per_lun = 3, 2789 .cmd_per_lun = 3,
2790 .use_clustering = ENABLE_CLUSTERING, 2790 .use_clustering = ENABLE_CLUSTERING,
diff --git a/drivers/scsi/esas2r/esas2r.h b/drivers/scsi/esas2r/esas2r.h
index 3fd305d6b67d..20ab211983f2 100644
--- a/drivers/scsi/esas2r/esas2r.h
+++ b/drivers/scsi/esas2r/esas2r.h
@@ -976,7 +976,6 @@ int esas2r_slave_alloc(struct scsi_device *dev);
976int esas2r_slave_configure(struct scsi_device *dev); 976int esas2r_slave_configure(struct scsi_device *dev);
977void esas2r_slave_destroy(struct scsi_device *dev); 977void esas2r_slave_destroy(struct scsi_device *dev);
978int esas2r_change_queue_depth(struct scsi_device *dev, int depth, int reason); 978int esas2r_change_queue_depth(struct scsi_device *dev, int depth, int reason);
979int esas2r_change_queue_type(struct scsi_device *dev, int type);
980long esas2r_proc_ioctl(struct file *fp, unsigned int cmd, unsigned long arg); 979long esas2r_proc_ioctl(struct file *fp, unsigned int cmd, unsigned long arg);
981 980
982/* SCSI error handler (eh) functions */ 981/* SCSI error handler (eh) functions */
diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c
index 45aa684f8b74..be09c628d034 100644
--- a/drivers/scsi/esas2r/esas2r_main.c
+++ b/drivers/scsi/esas2r/esas2r_main.c
@@ -258,7 +258,7 @@ static struct scsi_host_template driver_template = {
258 .slave_alloc = esas2r_slave_alloc, 258 .slave_alloc = esas2r_slave_alloc,
259 .slave_destroy = esas2r_slave_destroy, 259 .slave_destroy = esas2r_slave_destroy,
260 .change_queue_depth = esas2r_change_queue_depth, 260 .change_queue_depth = esas2r_change_queue_depth,
261 .change_queue_type = esas2r_change_queue_type, 261 .change_queue_type = scsi_change_queue_type,
262 .max_sectors = 0xFFFF, 262 .max_sectors = 0xFFFF,
263}; 263};
264 264
@@ -1268,24 +1268,6 @@ int esas2r_change_queue_depth(struct scsi_device *dev, int depth, int reason)
1268 return dev->queue_depth; 1268 return dev->queue_depth;
1269} 1269}
1270 1270
1271int esas2r_change_queue_type(struct scsi_device *dev, int type)
1272{
1273 esas2r_log(ESAS2R_LOG_INFO, "change_queue_type %p, %d", dev, type);
1274
1275 if (dev->tagged_supported) {
1276 scsi_set_tag_type(dev, type);
1277
1278 if (type)
1279 scsi_activate_tcq(dev, dev->queue_depth);
1280 else
1281 scsi_deactivate_tcq(dev, dev->queue_depth);
1282 } else {
1283 type = 0;
1284 }
1285
1286 return type;
1287}
1288
1289int esas2r_slave_alloc(struct scsi_device *dev) 1271int esas2r_slave_alloc(struct scsi_device *dev)
1290{ 1272{
1291 return 0; 1273 return 0;
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 4a8ac7d8c76b..86956cc3448e 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -281,7 +281,7 @@ static struct scsi_host_template fcoe_shost_template = {
281 .eh_host_reset_handler = fc_eh_host_reset, 281 .eh_host_reset_handler = fc_eh_host_reset,
282 .slave_alloc = fc_slave_alloc, 282 .slave_alloc = fc_slave_alloc,
283 .change_queue_depth = fc_change_queue_depth, 283 .change_queue_depth = fc_change_queue_depth,
284 .change_queue_type = fc_change_queue_type, 284 .change_queue_type = scsi_change_queue_type,
285 .this_id = -1, 285 .this_id = -1,
286 .cmd_per_lun = 3, 286 .cmd_per_lun = 3,
287 .can_queue = FCOE_MAX_OUTSTANDING_COMMANDS, 287 .can_queue = FCOE_MAX_OUTSTANDING_COMMANDS,
diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
index 8c56fdc3a456..8581ce662cf0 100644
--- a/drivers/scsi/fnic/fnic_main.c
+++ b/drivers/scsi/fnic/fnic_main.c
@@ -113,7 +113,7 @@ static struct scsi_host_template fnic_host_template = {
113 .eh_host_reset_handler = fnic_host_reset, 113 .eh_host_reset_handler = fnic_host_reset,
114 .slave_alloc = fnic_slave_alloc, 114 .slave_alloc = fnic_slave_alloc,
115 .change_queue_depth = fc_change_queue_depth, 115 .change_queue_depth = fc_change_queue_depth,
116 .change_queue_type = fc_change_queue_type, 116 .change_queue_type = scsi_change_queue_type,
117 .this_id = -1, 117 .this_id = -1,
118 .cmd_per_lun = 3, 118 .cmd_per_lun = 3,
119 .can_queue = FNIC_DFLT_IO_REQ, 119 .can_queue = FNIC_DFLT_IO_REQ,
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 598c42cba5a8..48d19a3256ce 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -2929,29 +2929,6 @@ static int ibmvfc_change_queue_depth(struct scsi_device *sdev, int qdepth,
2929 return sdev->queue_depth; 2929 return sdev->queue_depth;
2930} 2930}
2931 2931
2932/**
2933 * ibmvfc_change_queue_type - Change the device's queue type
2934 * @sdev: scsi device struct
2935 * @tag_type: type of tags to use
2936 *
2937 * Return value:
2938 * actual queue type set
2939 **/
2940static int ibmvfc_change_queue_type(struct scsi_device *sdev, int tag_type)
2941{
2942 if (sdev->tagged_supported) {
2943 scsi_set_tag_type(sdev, tag_type);
2944
2945 if (tag_type)
2946 scsi_activate_tcq(sdev, sdev->queue_depth);
2947 else
2948 scsi_deactivate_tcq(sdev, sdev->queue_depth);
2949 } else
2950 tag_type = 0;
2951
2952 return tag_type;
2953}
2954
2955static ssize_t ibmvfc_show_host_partition_name(struct device *dev, 2932static ssize_t ibmvfc_show_host_partition_name(struct device *dev,
2956 struct device_attribute *attr, char *buf) 2933 struct device_attribute *attr, char *buf)
2957{ 2934{
@@ -3133,7 +3110,7 @@ static struct scsi_host_template driver_template = {
3133 .target_alloc = ibmvfc_target_alloc, 3110 .target_alloc = ibmvfc_target_alloc,
3134 .scan_finished = ibmvfc_scan_finished, 3111 .scan_finished = ibmvfc_scan_finished,
3135 .change_queue_depth = ibmvfc_change_queue_depth, 3112 .change_queue_depth = ibmvfc_change_queue_depth,
3136 .change_queue_type = ibmvfc_change_queue_type, 3113 .change_queue_type = scsi_change_queue_type,
3137 .cmd_per_lun = 16, 3114 .cmd_per_lun = 16,
3138 .can_queue = IBMVFC_MAX_REQUESTS_DEFAULT, 3115 .can_queue = IBMVFC_MAX_REQUESTS_DEFAULT,
3139 .this_id = -1, 3116 .this_id = -1,
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 2a9578c116b7..3d689f6023e9 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -4364,24 +4364,10 @@ static int ipr_change_queue_type(struct scsi_device *sdev, int tag_type)
4364 4364
4365 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); 4365 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
4366 res = (struct ipr_resource_entry *)sdev->hostdata; 4366 res = (struct ipr_resource_entry *)sdev->hostdata;
4367 4367 if (res && ipr_is_gscsi(res))
4368 if (res) { 4368 tag_type = scsi_change_queue_type(sdev, tag_type);
4369 if (ipr_is_gscsi(res) && sdev->tagged_supported) { 4369 else
4370 /*
4371 * We don't bother quiescing the device here since the
4372 * adapter firmware does it for us.
4373 */
4374 scsi_set_tag_type(sdev, tag_type);
4375
4376 if (tag_type)
4377 scsi_activate_tcq(sdev, sdev->queue_depth);
4378 else
4379 scsi_deactivate_tcq(sdev, sdev->queue_depth);
4380 } else
4381 tag_type = 0;
4382 } else
4383 tag_type = 0; 4370 tag_type = 0;
4384
4385 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 4371 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
4386 return tag_type; 4372 return tag_type;
4387} 4373}
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 1d7e76e8b447..f3043ad1f35d 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -2196,26 +2196,6 @@ int fc_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
2196EXPORT_SYMBOL(fc_change_queue_depth); 2196EXPORT_SYMBOL(fc_change_queue_depth);
2197 2197
2198/** 2198/**
2199 * fc_change_queue_type() - Change a device's queue type
2200 * @sdev: The SCSI device whose queue depth is to change
2201 * @tag_type: Identifier for queue type
2202 */
2203int fc_change_queue_type(struct scsi_device *sdev, int tag_type)
2204{
2205 if (sdev->tagged_supported) {
2206 scsi_set_tag_type(sdev, tag_type);
2207 if (tag_type)
2208 scsi_activate_tcq(sdev, sdev->queue_depth);
2209 else
2210 scsi_deactivate_tcq(sdev, sdev->queue_depth);
2211 } else
2212 tag_type = 0;
2213
2214 return tag_type;
2215}
2216EXPORT_SYMBOL(fc_change_queue_type);
2217
2218/**
2219 * fc_fcp_destory() - Tear down the FCP layer for a given local port 2199 * fc_fcp_destory() - Tear down the FCP layer for a given local port
2220 * @lport: The local port that no longer needs the FCP layer 2200 * @lport: The local port that no longer needs the FCP layer
2221 */ 2201 */
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index b99399fe2548..2896e52ac6cd 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -345,26 +345,6 @@ lpfc_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
345} 345}
346 346
347/** 347/**
348 * lpfc_change_queue_type() - Change a device's scsi tag queuing type
349 * @sdev: Pointer the scsi device whose queue depth is to change
350 * @tag_type: Identifier for queue tag type
351 */
352static int
353lpfc_change_queue_type(struct scsi_device *sdev, int tag_type)
354{
355 if (sdev->tagged_supported) {
356 scsi_set_tag_type(sdev, tag_type);
357 if (tag_type)
358 scsi_activate_tcq(sdev, sdev->queue_depth);
359 else
360 scsi_deactivate_tcq(sdev, sdev->queue_depth);
361 } else
362 tag_type = 0;
363
364 return tag_type;
365}
366
367/**
368 * lpfc_rampdown_queue_depth - Post RAMP_DOWN_QUEUE event to worker thread 348 * lpfc_rampdown_queue_depth - Post RAMP_DOWN_QUEUE event to worker thread
369 * @phba: The Hba for which this call is being executed. 349 * @phba: The Hba for which this call is being executed.
370 * 350 *
@@ -6019,7 +5999,7 @@ struct scsi_host_template lpfc_template = {
6019 .max_sectors = 0xFFFF, 5999 .max_sectors = 0xFFFF,
6020 .vendor_id = LPFC_NL_VENDOR_ID, 6000 .vendor_id = LPFC_NL_VENDOR_ID,
6021 .change_queue_depth = lpfc_change_queue_depth, 6001 .change_queue_depth = lpfc_change_queue_depth,
6022 .change_queue_type = lpfc_change_queue_type, 6002 .change_queue_type = scsi_change_queue_type,
6023}; 6003};
6024 6004
6025struct scsi_host_template lpfc_vport_template = { 6005struct scsi_host_template lpfc_vport_template = {
@@ -6042,5 +6022,5 @@ struct scsi_host_template lpfc_vport_template = {
6042 .shost_attrs = lpfc_vport_attrs, 6022 .shost_attrs = lpfc_vport_attrs,
6043 .max_sectors = 0xFFFF, 6023 .max_sectors = 0xFFFF,
6044 .change_queue_depth = lpfc_change_queue_depth, 6024 .change_queue_depth = lpfc_change_queue_depth,
6045 .change_queue_type = lpfc_change_queue_type, 6025 .change_queue_type = scsi_change_queue_type,
6046}; 6026};
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index c80ed0482649..ec36b91c880f 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -1255,28 +1255,6 @@ _scsih_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
1255} 1255}
1256 1256
1257/** 1257/**
1258 * _scsih_change_queue_type - changing device queue tag type
1259 * @sdev: scsi device struct
1260 * @tag_type: requested tag type
1261 *
1262 * Returns queue tag type.
1263 */
1264static int
1265_scsih_change_queue_type(struct scsi_device *sdev, int tag_type)
1266{
1267 if (sdev->tagged_supported) {
1268 scsi_set_tag_type(sdev, tag_type);
1269 if (tag_type)
1270 scsi_activate_tcq(sdev, sdev->queue_depth);
1271 else
1272 scsi_deactivate_tcq(sdev, sdev->queue_depth);
1273 } else
1274 tag_type = 0;
1275
1276 return tag_type;
1277}
1278
1279/**
1280 * _scsih_target_alloc - target add routine 1258 * _scsih_target_alloc - target add routine
1281 * @starget: scsi target struct 1259 * @starget: scsi target struct
1282 * 1260 *
@@ -7653,7 +7631,7 @@ static struct scsi_host_template scsih_driver_template = {
7653 .scan_finished = _scsih_scan_finished, 7631 .scan_finished = _scsih_scan_finished,
7654 .scan_start = _scsih_scan_start, 7632 .scan_start = _scsih_scan_start,
7655 .change_queue_depth = _scsih_change_queue_depth, 7633 .change_queue_depth = _scsih_change_queue_depth,
7656 .change_queue_type = _scsih_change_queue_type, 7634 .change_queue_type = scsi_change_queue_type,
7657 .eh_abort_handler = _scsih_abort, 7635 .eh_abort_handler = _scsih_abort,
7658 .eh_device_reset_handler = _scsih_dev_reset, 7636 .eh_device_reset_handler = _scsih_dev_reset,
7659 .eh_target_reset_handler = _scsih_target_reset, 7637 .eh_target_reset_handler = _scsih_target_reset,
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 857276b8880f..52464ace282b 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -1123,29 +1123,6 @@ _scsih_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
1123} 1123}
1124 1124
1125/** 1125/**
1126 * _scsih_change_queue_type - changing device queue tag type
1127 * @sdev: scsi device struct
1128 * @tag_type: requested tag type
1129 *
1130 * Returns queue tag type.
1131 */
1132static int
1133_scsih_change_queue_type(struct scsi_device *sdev, int tag_type)
1134{
1135 if (sdev->tagged_supported) {
1136 scsi_set_tag_type(sdev, tag_type);
1137 if (tag_type)
1138 scsi_activate_tcq(sdev, sdev->queue_depth);
1139 else
1140 scsi_deactivate_tcq(sdev, sdev->queue_depth);
1141 } else
1142 tag_type = 0;
1143
1144 return tag_type;
1145}
1146
1147
1148/**
1149 * _scsih_target_alloc - target add routine 1126 * _scsih_target_alloc - target add routine
1150 * @starget: scsi target struct 1127 * @starget: scsi target struct
1151 * 1128 *
@@ -7284,7 +7261,7 @@ static struct scsi_host_template scsih_driver_template = {
7284 .scan_finished = _scsih_scan_finished, 7261 .scan_finished = _scsih_scan_finished,
7285 .scan_start = _scsih_scan_start, 7262 .scan_start = _scsih_scan_start,
7286 .change_queue_depth = _scsih_change_queue_depth, 7263 .change_queue_depth = _scsih_change_queue_depth,
7287 .change_queue_type = _scsih_change_queue_type, 7264 .change_queue_type = scsi_change_queue_type,
7288 .eh_abort_handler = _scsih_abort, 7265 .eh_abort_handler = _scsih_abort,
7289 .eh_device_reset_handler = _scsih_dev_reset, 7266 .eh_device_reset_handler = _scsih_dev_reset,
7290 .eh_target_reset_handler = _scsih_target_reset, 7267 .eh_target_reset_handler = _scsih_target_reset,
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index bcb64eb1387f..2233ed6b89e3 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -321,16 +321,10 @@ static int pmcraid_change_queue_type(struct scsi_device *scsi_dev, int tag)
321 struct pmcraid_resource_entry *res; 321 struct pmcraid_resource_entry *res;
322 322
323 res = (struct pmcraid_resource_entry *)scsi_dev->hostdata; 323 res = (struct pmcraid_resource_entry *)scsi_dev->hostdata;
324 324 if (res && scsi_dev->tagged_supported &&
325 if ((res) && scsi_dev->tagged_supported && 325 (RES_IS_GSCSI(res->cfg_entry) || RES_IS_VSET(res->cfg_entry)))
326 (RES_IS_GSCSI(res->cfg_entry) || RES_IS_VSET(res->cfg_entry))) { 326 tag = scsi_change_queue_type(scsi_dev, tag);
327 scsi_set_tag_type(scsi_dev, tag); 327 else
328
329 if (tag)
330 scsi_activate_tcq(scsi_dev, scsi_dev->queue_depth);
331 else
332 scsi_deactivate_tcq(scsi_dev, scsi_dev->queue_depth);
333 } else
334 tag = 0; 328 tag = 0;
335 329
336 return tag; 330 return tag;
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index db3dbd999cb6..5e755747e073 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -237,7 +237,6 @@ static int qla2xxx_eh_bus_reset(struct scsi_cmnd *);
237static int qla2xxx_eh_host_reset(struct scsi_cmnd *); 237static int qla2xxx_eh_host_reset(struct scsi_cmnd *);
238 238
239static int qla2x00_change_queue_depth(struct scsi_device *, int, int); 239static int qla2x00_change_queue_depth(struct scsi_device *, int, int);
240static int qla2x00_change_queue_type(struct scsi_device *, int);
241static void qla2x00_clear_drv_active(struct qla_hw_data *); 240static void qla2x00_clear_drv_active(struct qla_hw_data *);
242static void qla2x00_free_device(scsi_qla_host_t *); 241static void qla2x00_free_device(scsi_qla_host_t *);
243static void qla83xx_disable_laser(scsi_qla_host_t *vha); 242static void qla83xx_disable_laser(scsi_qla_host_t *vha);
@@ -260,7 +259,7 @@ struct scsi_host_template qla2xxx_driver_template = {
260 .scan_finished = qla2xxx_scan_finished, 259 .scan_finished = qla2xxx_scan_finished,
261 .scan_start = qla2xxx_scan_start, 260 .scan_start = qla2xxx_scan_start,
262 .change_queue_depth = qla2x00_change_queue_depth, 261 .change_queue_depth = qla2x00_change_queue_depth,
263 .change_queue_type = qla2x00_change_queue_type, 262 .change_queue_type = scsi_change_queue_type,
264 .this_id = -1, 263 .this_id = -1,
265 .cmd_per_lun = 3, 264 .cmd_per_lun = 3,
266 .use_clustering = ENABLE_CLUSTERING, 265 .use_clustering = ENABLE_CLUSTERING,
@@ -1473,21 +1472,6 @@ qla2x00_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
1473 return sdev->queue_depth; 1472 return sdev->queue_depth;
1474} 1473}
1475 1474
1476static int
1477qla2x00_change_queue_type(struct scsi_device *sdev, int tag_type)
1478{
1479 if (sdev->tagged_supported) {
1480 scsi_set_tag_type(sdev, tag_type);
1481 if (tag_type)
1482 scsi_activate_tcq(sdev, sdev->queue_depth);
1483 else
1484 scsi_deactivate_tcq(sdev, sdev->queue_depth);
1485 } else
1486 tag_type = 0;
1487
1488 return tag_type;
1489}
1490
1491/** 1475/**
1492 * qla2x00_config_dma_addressing() - Configure OS DMA addressing method. 1476 * qla2x00_config_dma_addressing() - Configure OS DMA addressing method.
1493 * @ha: HA context 1477 * @ha: HA context
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index bc52bbd97381..9baeff03dd9b 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -867,6 +867,26 @@ int scsi_track_queue_full(struct scsi_device *sdev, int depth)
867EXPORT_SYMBOL(scsi_track_queue_full); 867EXPORT_SYMBOL(scsi_track_queue_full);
868 868
869/** 869/**
870 * scsi_change_queue_type() - Change a device's queue type
871 * @sdev: The SCSI device whose queue depth is to change
872 * @tag_type: Identifier for queue type
873 */
874int scsi_change_queue_type(struct scsi_device *sdev, int tag_type)
875{
876 if (sdev->tagged_supported) {
877 scsi_set_tag_type(sdev, tag_type);
878 if (tag_type)
879 scsi_activate_tcq(sdev, sdev->queue_depth);
880 else
881 scsi_deactivate_tcq(sdev, sdev->queue_depth);
882 } else
883 tag_type = 0;
884
885 return tag_type;
886}
887EXPORT_SYMBOL(scsi_change_queue_type);
888
889/**
870 * scsi_vpd_inquiry - Request a device provide us with a VPD page 890 * scsi_vpd_inquiry - Request a device provide us with a VPD page
871 * @sdev: The device to ask 891 * @sdev: The device to ask
872 * @buffer: Where to put the result 892 * @buffer: Where to put the result
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 238e06f13b8a..7bcace2cdd53 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -4532,14 +4532,7 @@ sdebug_change_qdepth(struct scsi_device *sdev, int qdepth, int reason)
4532static int 4532static int
4533sdebug_change_qtype(struct scsi_device *sdev, int qtype) 4533sdebug_change_qtype(struct scsi_device *sdev, int qtype)
4534{ 4534{
4535 if (sdev->tagged_supported) { 4535 qtype = scsi_change_queue_type(sdev, qtype);
4536 scsi_set_tag_type(sdev, qtype);
4537 if (qtype)
4538 scsi_activate_tcq(sdev, sdev->queue_depth);
4539 else
4540 scsi_deactivate_tcq(sdev, sdev->queue_depth);
4541 } else
4542 qtype = 0;
4543 if (SCSI_DEBUG_OPT_Q_NOISE & scsi_debug_opts) { 4536 if (SCSI_DEBUG_OPT_Q_NOISE & scsi_debug_opts) {
4544 const char *cp; 4537 const char *cp;
4545 4538
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index ab3ab27d49b7..3b9c76835b45 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -135,21 +135,6 @@ static int tcm_loop_change_queue_depth(
135 return sdev->queue_depth; 135 return sdev->queue_depth;
136} 136}
137 137
138static int tcm_loop_change_queue_type(struct scsi_device *sdev, int tag)
139{
140 if (sdev->tagged_supported) {
141 scsi_set_tag_type(sdev, tag);
142
143 if (tag)
144 scsi_activate_tcq(sdev, sdev->queue_depth);
145 else
146 scsi_deactivate_tcq(sdev, sdev->queue_depth);
147 } else
148 tag = 0;
149
150 return tag;
151}
152
153/* 138/*
154 * Locate the SAM Task Attr from struct scsi_cmnd * 139 * Locate the SAM Task Attr from struct scsi_cmnd *
155 */ 140 */
@@ -451,7 +436,7 @@ static struct scsi_host_template tcm_loop_driver_template = {
451 .name = "TCM_Loopback", 436 .name = "TCM_Loopback",
452 .queuecommand = tcm_loop_queuecommand, 437 .queuecommand = tcm_loop_queuecommand,
453 .change_queue_depth = tcm_loop_change_queue_depth, 438 .change_queue_depth = tcm_loop_change_queue_depth,
454 .change_queue_type = tcm_loop_change_queue_type, 439 .change_queue_type = scsi_change_queue_type,
455 .eh_abort_handler = tcm_loop_abort_task, 440 .eh_abort_handler = tcm_loop_abort_task,
456 .eh_device_reset_handler = tcm_loop_device_reset, 441 .eh_device_reset_handler = tcm_loop_device_reset,
457 .eh_target_reset_handler = tcm_loop_target_reset, 442 .eh_target_reset_handler = tcm_loop_target_reset,
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 52beadf9a29b..2e0cf568a9c1 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -1106,7 +1106,6 @@ int fc_eh_device_reset(struct scsi_cmnd *);
1106int fc_eh_host_reset(struct scsi_cmnd *); 1106int fc_eh_host_reset(struct scsi_cmnd *);
1107int fc_slave_alloc(struct scsi_device *); 1107int fc_slave_alloc(struct scsi_device *);
1108int fc_change_queue_depth(struct scsi_device *, int qdepth, int reason); 1108int fc_change_queue_depth(struct scsi_device *, int qdepth, int reason);
1109int fc_change_queue_type(struct scsi_device *, int tag_type);
1110 1109
1111/* 1110/*
1112 * ELS/CT interface 1111 * ELS/CT interface
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h
index 7529c6acc231..1712dab6e00e 100644
--- a/include/scsi/scsi_tcq.h
+++ b/include/scsi/scsi_tcq.h
@@ -16,6 +16,8 @@
16 16
17#ifdef CONFIG_BLOCK 17#ifdef CONFIG_BLOCK
18 18
19int scsi_change_queue_type(struct scsi_device *sdev, int tag_type);
20
19/** 21/**
20 * scsi_get_tag_type - get the type of tag the device supports 22 * scsi_get_tag_type - get the type of tag the device supports
21 * @sdev: the scsi device 23 * @sdev: the scsi device