aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-20 16:42:57 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-20 16:42:57 -0500
commitcdce6ac277a4a1aa5316cd0cdf30fff927433917 (patch)
treea345a1a6639a368433fa915be96554d7a0f456ea /drivers/scsi
parent5d6a54688632f640abda71164fea5d171ff07db8 (diff)
parente61745769125a3c788e7aceb2a5fb680ebb461e6 (diff)
Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI update from James Bottomley: "This is a much shorter set of patches that were on the go but didn't make it in to the early pull request for the merge window. It's really a set of bug fixes plus some final cleanup work on the new tag queue API" * tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: storvsc: ring buffer failures may result in I/O freeze ipr: set scsi_level correctly for disk arrays ipr: add support for async scanning to speed up boot scsi_debug: fix missing "break;" in SDEBUG_UA_CAPACITY_CHANGED case scsi_debug: take sdebug_host_list_lock when changing capacity scsi_debug: improve driver description in Kconfig scsi_debug: fix compare and write errors qla2xxx: fix race in handling rport deletion during recovery causes panic scsi: blacklist RSOC for Microsoft iSCSI target devices scsi: fix random memory corruption with scsi-mq + T10 PI Revert "[SCSI] mpt3sas: Remove phys on topology change" Revert "[SCSI] mpt2sas: Remove phys on topology change." esas2r: Correct typos of "validate" in a comment fc: FCP_PTA_SIMPLE is 0 ibmvfc: remove unused tag variable scsi: remove MSG_*_TAG defines scsi: remove scsi_set_tag_type scsi: remove scsi_get_tag_type scsi: never drop to untagged mode during queue ramp down scsi: remove ->change_queue_type method
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/53c700.c41
-rw-r--r--drivers/scsi/Kconfig17
-rw-r--r--drivers/scsi/advansys.c8
-rw-r--r--drivers/scsi/aic94xx/aic94xx_init.c1
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_fcoe.c1
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_io.c6
-rw-r--r--drivers/scsi/csiostor/csio_scsi.c5
-rw-r--r--drivers/scsi/esas2r/esas2r_flash.c4
-rw-r--r--drivers/scsi/esas2r/esas2r_main.c1
-rw-r--r--drivers/scsi/fcoe/fcoe.c1
-rw-r--r--drivers/scsi/fnic/fnic_main.c1
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c2
-rw-r--r--drivers/scsi/ipr.c116
-rw-r--r--drivers/scsi/ipr.h4
-rw-r--r--drivers/scsi/isci/init.c1
-rw-r--r--drivers/scsi/libsas/sas_scsi_host.c8
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c2
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c1
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_transport.c5
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_scsih.c1
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_transport.c5
-rw-r--r--drivers/scsi/mvsas/mv_init.c1
-rw-r--r--drivers/scsi/pm8001/pm8001_init.c1
-rw-r--r--drivers/scsi/pmcraid.c1
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c1
-rw-r--r--drivers/scsi/qla2xxx/qla_target.c12
-rw-r--r--drivers/scsi/scsi.c22
-rw-r--r--drivers/scsi/scsi_debug.c62
-rw-r--r--drivers/scsi/scsi_devinfo.c1
-rw-r--r--drivers/scsi/scsi_lib.c4
-rw-r--r--drivers/scsi/scsi_sysfs.c30
-rw-r--r--drivers/scsi/scsi_transport_spi.c2
-rw-r--r--drivers/scsi/storvsc_drv.c7
34 files changed, 104 insertions, 273 deletions
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index aa915da2a5e5..82abfce1cb42 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -176,7 +176,6 @@ STATIC int NCR_700_slave_alloc(struct scsi_device *SDpnt);
176STATIC int NCR_700_slave_configure(struct scsi_device *SDpnt); 176STATIC int NCR_700_slave_configure(struct scsi_device *SDpnt);
177STATIC void NCR_700_slave_destroy(struct scsi_device *SDpnt); 177STATIC void NCR_700_slave_destroy(struct scsi_device *SDpnt);
178static int NCR_700_change_queue_depth(struct scsi_device *SDpnt, int depth); 178static int NCR_700_change_queue_depth(struct scsi_device *SDpnt, int depth);
179static int NCR_700_change_queue_type(struct scsi_device *SDpnt, int depth);
180 179
181STATIC struct device_attribute *NCR_700_dev_attrs[]; 180STATIC struct device_attribute *NCR_700_dev_attrs[];
182 181
@@ -326,7 +325,6 @@ NCR_700_detect(struct scsi_host_template *tpnt,
326 tpnt->slave_destroy = NCR_700_slave_destroy; 325 tpnt->slave_destroy = NCR_700_slave_destroy;
327 tpnt->slave_alloc = NCR_700_slave_alloc; 326 tpnt->slave_alloc = NCR_700_slave_alloc;
328 tpnt->change_queue_depth = NCR_700_change_queue_depth; 327 tpnt->change_queue_depth = NCR_700_change_queue_depth;
329 tpnt->change_queue_type = NCR_700_change_queue_type;
330 tpnt->use_blk_tags = 1; 328 tpnt->use_blk_tags = 1;
331 329
332 if(tpnt->name == NULL) 330 if(tpnt->name == NULL)
@@ -904,8 +902,8 @@ process_message(struct Scsi_Host *host, struct NCR_700_Host_Parameters *hostdata
904 hostdata->tag_negotiated &= ~(1<<scmd_id(SCp)); 902 hostdata->tag_negotiated &= ~(1<<scmd_id(SCp));
905 903
906 SCp->device->tagged_supported = 0; 904 SCp->device->tagged_supported = 0;
905 SCp->device->simple_tags = 0;
907 scsi_change_queue_depth(SCp->device, host->cmd_per_lun); 906 scsi_change_queue_depth(SCp->device, host->cmd_per_lun);
908 scsi_set_tag_type(SCp->device, 0);
909 } else { 907 } else {
910 shost_printk(KERN_WARNING, host, 908 shost_printk(KERN_WARNING, host,
911 "(%d:%d) Unexpected REJECT Message %s\n", 909 "(%d:%d) Unexpected REJECT Message %s\n",
@@ -1818,8 +1816,8 @@ NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)
1818 hostdata->tag_negotiated &= ~(1<<scmd_id(SCp)); 1816 hostdata->tag_negotiated &= ~(1<<scmd_id(SCp));
1819 } 1817 }
1820 1818
1821 if((hostdata->tag_negotiated &(1<<scmd_id(SCp))) 1819 if ((hostdata->tag_negotiated & (1<<scmd_id(SCp))) &&
1822 && scsi_get_tag_type(SCp->device)) { 1820 SCp->device->simple_tags) {
1823 slot->tag = SCp->request->tag; 1821 slot->tag = SCp->request->tag;
1824 CDEBUG(KERN_DEBUG, SCp, "sending out tag %d, slot %p\n", 1822 CDEBUG(KERN_DEBUG, SCp, "sending out tag %d, slot %p\n",
1825 slot->tag, slot); 1823 slot->tag, slot);
@@ -2082,39 +2080,6 @@ NCR_700_change_queue_depth(struct scsi_device *SDp, int depth)
2082 return scsi_change_queue_depth(SDp, depth); 2080 return scsi_change_queue_depth(SDp, depth);
2083} 2081}
2084 2082
2085static int NCR_700_change_queue_type(struct scsi_device *SDp, int tag_type)
2086{
2087 int change_tag = ((tag_type ==0 && scsi_get_tag_type(SDp) != 0)
2088 || (tag_type != 0 && scsi_get_tag_type(SDp) == 0));
2089 struct NCR_700_Host_Parameters *hostdata =
2090 (struct NCR_700_Host_Parameters *)SDp->host->hostdata[0];
2091
2092 /* We have a global (per target) flag to track whether TCQ is
2093 * enabled, so we'll be turning it off for the entire target here.
2094 * our tag algorithm will fail if we mix tagged and untagged commands,
2095 * so quiesce the device before doing this */
2096 if (change_tag)
2097 scsi_target_quiesce(SDp->sdev_target);
2098
2099 scsi_set_tag_type(SDp, tag_type);
2100 if (!tag_type) {
2101 /* shift back to the default unqueued number of commands
2102 * (the user can still raise this) */
2103 scsi_change_queue_depth(SDp, SDp->host->cmd_per_lun);
2104 hostdata->tag_negotiated &= ~(1 << sdev_id(SDp));
2105 } else {
2106 /* Here, we cleared the negotiation flag above, so this
2107 * will force the driver to renegotiate */
2108 scsi_change_queue_depth(SDp, SDp->queue_depth);
2109 if (change_tag)
2110 NCR_700_set_tag_neg_state(SDp, NCR_700_START_TAG_NEGOTIATION);
2111 }
2112 if (change_tag)
2113 scsi_target_resume(SDp->sdev_target);
2114
2115 return tag_type;
2116}
2117
2118static ssize_t 2083static ssize_t
2119NCR_700_show_active_tags(struct device *dev, struct device_attribute *attr, char *buf) 2084NCR_700_show_active_tags(struct device *dev, struct device_attribute *attr, char *buf)
2120{ 2085{
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 86cf3d671eb9..9c92f415229f 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1462,18 +1462,17 @@ config SCSI_WD719X
1462 SCSI controllers (based on WD33C296A chip). 1462 SCSI controllers (based on WD33C296A chip).
1463 1463
1464config SCSI_DEBUG 1464config SCSI_DEBUG
1465 tristate "SCSI debugging host simulator" 1465 tristate "SCSI debugging host and device simulator"
1466 depends on SCSI 1466 depends on SCSI
1467 select CRC_T10DIF 1467 select CRC_T10DIF
1468 help 1468 help
1469 This is a host adapter simulator that can simulate multiple hosts 1469 This pseudo driver simulates one or more hosts (SCSI initiators),
1470 each with multiple dummy SCSI devices (disks). It defaults to one 1470 each with one or more targets, each with one or more logical units.
1471 host adapter with one dummy SCSI disk. Each dummy disk uses kernel 1471 Defaults to one of each, creating a small RAM disk device. Many
1472 RAM as storage (i.e. it is a ramdisk). To save space when multiple 1472 parameters found in the /sys/bus/pseudo/drivers/scsi_debug
1473 dummy disks are simulated, they share the same kernel RAM for 1473 directory can be tweaked at run time.
1474 their storage. See <http://sg.danny.cz/sg/sdebug26.html> for more 1474 See <http://sg.danny.cz/sg/sdebug26.html> for more information.
1475 information. This driver is primarily of use to those testing the 1475 Mainly used for testing and best as a module. If unsure, say N.
1476 SCSI and block subsystems. If unsure, say N.
1477 1476
1478config SCSI_MESH 1477config SCSI_MESH
1479 tristate "MESH (Power Mac internal SCSI) support" 1478 tristate "MESH (Power Mac internal SCSI) support"
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 6719a3390ebd..2c5ce48c8f95 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -7921,9 +7921,9 @@ static int asc_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,
7921 */ 7921 */
7922 if ((asc_dvc->cur_dvc_qng[scp->device->id] > 0) && 7922 if ((asc_dvc->cur_dvc_qng[scp->device->id] > 0) &&
7923 (boardp->reqcnt[scp->device->id] % 255) == 0) { 7923 (boardp->reqcnt[scp->device->id] % 255) == 0) {
7924 asc_scsi_q->q2.tag_code = MSG_ORDERED_TAG; 7924 asc_scsi_q->q2.tag_code = ORDERED_QUEUE_TAG;
7925 } else { 7925 } else {
7926 asc_scsi_q->q2.tag_code = MSG_SIMPLE_TAG; 7926 asc_scsi_q->q2.tag_code = SIMPLE_QUEUE_TAG;
7927 } 7927 }
7928 7928
7929 /* Build ASC_SCSI_Q */ 7929 /* Build ASC_SCSI_Q */
@@ -8351,7 +8351,7 @@ static int AscPutReadyQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq, uchar q_no)
8351 } 8351 }
8352 q_addr = ASC_QNO_TO_QADDR(q_no); 8352 q_addr = ASC_QNO_TO_QADDR(q_no);
8353 if ((scsiq->q1.target_id & asc_dvc->use_tagged_qng) == 0) { 8353 if ((scsiq->q1.target_id & asc_dvc->use_tagged_qng) == 0) {
8354 scsiq->q2.tag_code &= ~MSG_SIMPLE_TAG; 8354 scsiq->q2.tag_code &= ~SIMPLE_QUEUE_TAG;
8355 } 8355 }
8356 scsiq->q1.status = QS_FREE; 8356 scsiq->q1.status = QS_FREE;
8357 AscMemWordCopyPtrToLram(iop_base, 8357 AscMemWordCopyPtrToLram(iop_base,
@@ -8669,7 +8669,7 @@ static int AscExeScsiQueue(ASC_DVC_VAR *asc_dvc, ASC_SCSI_Q *scsiq)
8669 } 8669 }
8670 } 8670 }
8671 if (disable_syn_offset_one_fix) { 8671 if (disable_syn_offset_one_fix) {
8672 scsiq->q2.tag_code &= ~MSG_SIMPLE_TAG; 8672 scsiq->q2.tag_code &= ~SIMPLE_QUEUE_TAG;
8673 scsiq->q2.tag_code |= (ASC_TAG_FLAG_DISABLE_ASYN_USE_SYN_FIX | 8673 scsiq->q2.tag_code |= (ASC_TAG_FLAG_DISABLE_ASYN_USE_SYN_FIX |
8674 ASC_TAG_FLAG_DISABLE_DISCONNECT); 8674 ASC_TAG_FLAG_DISABLE_DISCONNECT);
8675 } else { 8675 } else {
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 14fc018436c2..02a2512b76a8 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -63,7 +63,6 @@ static struct scsi_host_template aic94xx_sht = {
63 .scan_finished = asd_scan_finished, 63 .scan_finished = asd_scan_finished,
64 .scan_start = asd_scan_start, 64 .scan_start = asd_scan_start,
65 .change_queue_depth = sas_change_queue_depth, 65 .change_queue_depth = sas_change_queue_depth,
66 .change_queue_type = sas_change_queue_type,
67 .bios_param = sas_bios_param, 66 .bios_param = sas_bios_param,
68 .can_queue = 1, 67 .can_queue = 1,
69 .cmd_per_lun = 1, 68 .cmd_per_lun = 1,
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index e861f286b42e..98d06d151958 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -2792,7 +2792,6 @@ static struct scsi_host_template bnx2fc_shost_template = {
2792 .eh_host_reset_handler = fc_eh_host_reset, 2792 .eh_host_reset_handler = fc_eh_host_reset,
2793 .slave_alloc = fc_slave_alloc, 2793 .slave_alloc = fc_slave_alloc,
2794 .change_queue_depth = scsi_change_queue_depth, 2794 .change_queue_depth = scsi_change_queue_depth,
2795 .change_queue_type = scsi_change_queue_type,
2796 .this_id = -1, 2795 .this_id = -1,
2797 .cmd_per_lun = 3, 2796 .cmd_per_lun = 3,
2798 .use_clustering = ENABLE_CLUSTERING, 2797 .use_clustering = ENABLE_CLUSTERING,
diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 4b56858c1df2..9ecca8504f60 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -1737,11 +1737,7 @@ void bnx2fc_build_fcp_cmnd(struct bnx2fc_cmd *io_req,
1737 fcp_cmnd->fc_pri_ta = 0; 1737 fcp_cmnd->fc_pri_ta = 0;
1738 fcp_cmnd->fc_tm_flags = io_req->mp_req.tm_flags; 1738 fcp_cmnd->fc_tm_flags = io_req->mp_req.tm_flags;
1739 fcp_cmnd->fc_flags = io_req->io_req_flags; 1739 fcp_cmnd->fc_flags = io_req->io_req_flags;
1740 1740 fcp_cmnd->fc_pri_ta = FCP_PTA_SIMPLE;
1741 if (sc_cmd->flags & SCMD_TAGGED)
1742 fcp_cmnd->fc_pri_ta = FCP_PTA_SIMPLE;
1743 else
1744 fcp_cmnd->fc_pri_ta = 0;
1745} 1741}
1746 1742
1747static void bnx2fc_parse_fcp_rsp(struct bnx2fc_cmd *io_req, 1743static void bnx2fc_parse_fcp_rsp(struct bnx2fc_cmd *io_req,
diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c
index 51ea5dc5f084..3987284e0d2a 100644
--- a/drivers/scsi/csiostor/csio_scsi.c
+++ b/drivers/scsi/csiostor/csio_scsi.c
@@ -172,10 +172,7 @@ csio_scsi_fcp_cmnd(struct csio_ioreq *req, void *addr)
172 fcp_cmnd->fc_cmdref = 0; 172 fcp_cmnd->fc_cmdref = 0;
173 173
174 memcpy(fcp_cmnd->fc_cdb, scmnd->cmnd, 16); 174 memcpy(fcp_cmnd->fc_cdb, scmnd->cmnd, 16);
175 if (scmnd->flags & SCMD_TAGGED) 175 fcp_cmnd->fc_pri_ta = FCP_PTA_SIMPLE;
176 fcp_cmnd->fc_pri_ta = FCP_PTA_SIMPLE;
177 else
178 fcp_cmnd->fc_pri_ta = 0;
179 fcp_cmnd->fc_dl = cpu_to_be32(scsi_bufflen(scmnd)); 176 fcp_cmnd->fc_dl = cpu_to_be32(scsi_bufflen(scmnd));
180 177
181 if (req->nsge) 178 if (req->nsge)
diff --git a/drivers/scsi/esas2r/esas2r_flash.c b/drivers/scsi/esas2r/esas2r_flash.c
index b7dc59fca7a6..7bd376d95ed5 100644
--- a/drivers/scsi/esas2r/esas2r_flash.c
+++ b/drivers/scsi/esas2r/esas2r_flash.c
@@ -684,9 +684,9 @@ static u16 calc_fi_checksum(struct esas2r_flash_context *fc)
684 * 1) verify the fi_version is correct 684 * 1) verify the fi_version is correct
685 * 2) verify the checksum of the entire image. 685 * 2) verify the checksum of the entire image.
686 * 3) validate the adap_typ, action and length fields. 686 * 3) validate the adap_typ, action and length fields.
687 * 4) valdiate each component header. check the img_type and 687 * 4) validate each component header. check the img_type and
688 * length fields 688 * length fields
689 * 5) valdiate each component image. validate signatures and 689 * 5) validate each component image. validate signatures and
690 * local checksums 690 * local checksums
691 */ 691 */
692static bool verify_fi(struct esas2r_adapter *a, 692static bool verify_fi(struct esas2r_adapter *a,
diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c
index 593ff8a63c70..7e1c21e6736b 100644
--- a/drivers/scsi/esas2r/esas2r_main.c
+++ b/drivers/scsi/esas2r/esas2r_main.c
@@ -255,7 +255,6 @@ static struct scsi_host_template driver_template = {
255 .emulated = 0, 255 .emulated = 0,
256 .proc_name = ESAS2R_DRVR_NAME, 256 .proc_name = ESAS2R_DRVR_NAME,
257 .change_queue_depth = scsi_change_queue_depth, 257 .change_queue_depth = scsi_change_queue_depth,
258 .change_queue_type = scsi_change_queue_type,
259 .max_sectors = 0xFFFF, 258 .max_sectors = 0xFFFF,
260 .use_blk_tags = 1, 259 .use_blk_tags = 1,
261}; 260};
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index cd00a6cdf55b..ec193a8357d7 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -281,7 +281,6 @@ 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 = scsi_change_queue_depth, 283 .change_queue_depth = scsi_change_queue_depth,
284 .change_queue_type = scsi_change_queue_type,
285 .this_id = -1, 284 .this_id = -1,
286 .cmd_per_lun = 3, 285 .cmd_per_lun = 3,
287 .can_queue = FCOE_MAX_OUTSTANDING_COMMANDS, 286 .can_queue = FCOE_MAX_OUTSTANDING_COMMANDS,
diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
index 0c1f8177b5b7..8a0d4d7b3254 100644
--- a/drivers/scsi/fnic/fnic_main.c
+++ b/drivers/scsi/fnic/fnic_main.c
@@ -111,7 +111,6 @@ static struct scsi_host_template fnic_host_template = {
111 .eh_host_reset_handler = fnic_host_reset, 111 .eh_host_reset_handler = fnic_host_reset,
112 .slave_alloc = fnic_slave_alloc, 112 .slave_alloc = fnic_slave_alloc,
113 .change_queue_depth = scsi_change_queue_depth, 113 .change_queue_depth = scsi_change_queue_depth,
114 .change_queue_type = scsi_change_queue_type,
115 .this_id = -1, 114 .this_id = -1,
116 .cmd_per_lun = 3, 115 .cmd_per_lun = 3,
117 .can_queue = FNIC_DFLT_IO_REQ, 116 .can_queue = FNIC_DFLT_IO_REQ,
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index f58c6d8e0264..057d27721d5b 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -1615,7 +1615,6 @@ static int ibmvfc_queuecommand_lck(struct scsi_cmnd *cmnd,
1615 struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device)); 1615 struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device));
1616 struct ibmvfc_cmd *vfc_cmd; 1616 struct ibmvfc_cmd *vfc_cmd;
1617 struct ibmvfc_event *evt; 1617 struct ibmvfc_event *evt;
1618 u8 tag[2];
1619 int rc; 1618 int rc;
1620 1619
1621 if (unlikely((rc = fc_remote_port_chkready(rport))) || 1620 if (unlikely((rc = fc_remote_port_chkready(rport))) ||
@@ -3089,7 +3088,6 @@ static struct scsi_host_template driver_template = {
3089 .target_alloc = ibmvfc_target_alloc, 3088 .target_alloc = ibmvfc_target_alloc,
3090 .scan_finished = ibmvfc_scan_finished, 3089 .scan_finished = ibmvfc_scan_finished,
3091 .change_queue_depth = ibmvfc_change_queue_depth, 3090 .change_queue_depth = ibmvfc_change_queue_depth,
3092 .change_queue_type = scsi_change_queue_type,
3093 .cmd_per_lun = 16, 3091 .cmd_per_lun = 16,
3094 .can_queue = IBMVFC_MAX_REQUESTS_DEFAULT, 3092 .can_queue = IBMVFC_MAX_REQUESTS_DEFAULT,
3095 .this_id = -1, 3093 .this_id = -1,
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 540294389355..df4e27cd996a 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -1426,16 +1426,14 @@ static void ipr_handle_config_change(struct ipr_ioa_cfg *ioa_cfg,
1426 if (res->sdev) { 1426 if (res->sdev) {
1427 res->del_from_ml = 1; 1427 res->del_from_ml = 1;
1428 res->res_handle = IPR_INVALID_RES_HANDLE; 1428 res->res_handle = IPR_INVALID_RES_HANDLE;
1429 if (ioa_cfg->allow_ml_add_del) 1429 schedule_work(&ioa_cfg->work_q);
1430 schedule_work(&ioa_cfg->work_q);
1431 } else { 1430 } else {
1432 ipr_clear_res_target(res); 1431 ipr_clear_res_target(res);
1433 list_move_tail(&res->queue, &ioa_cfg->free_res_q); 1432 list_move_tail(&res->queue, &ioa_cfg->free_res_q);
1434 } 1433 }
1435 } else if (!res->sdev || res->del_from_ml) { 1434 } else if (!res->sdev || res->del_from_ml) {
1436 res->add_to_ml = 1; 1435 res->add_to_ml = 1;
1437 if (ioa_cfg->allow_ml_add_del) 1436 schedule_work(&ioa_cfg->work_q);
1438 schedule_work(&ioa_cfg->work_q);
1439 } 1437 }
1440 1438
1441 ipr_send_hcam(ioa_cfg, IPR_HCAM_CDB_OP_CODE_CONFIG_CHANGE, hostrcb); 1439 ipr_send_hcam(ioa_cfg, IPR_HCAM_CDB_OP_CODE_CONFIG_CHANGE, hostrcb);
@@ -3273,8 +3271,7 @@ static void ipr_worker_thread(struct work_struct *work)
3273restart: 3271restart:
3274 do { 3272 do {
3275 did_work = 0; 3273 did_work = 0;
3276 if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].allow_cmds || 3274 if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].allow_cmds) {
3277 !ioa_cfg->allow_ml_add_del) {
3278 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 3275 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
3279 return; 3276 return;
3280 } 3277 }
@@ -3311,6 +3308,7 @@ restart:
3311 } 3308 }
3312 } 3309 }
3313 3310
3311 ioa_cfg->scan_done = 1;
3314 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 3312 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
3315 kobject_uevent(&ioa_cfg->host->shost_dev.kobj, KOBJ_CHANGE); 3313 kobject_uevent(&ioa_cfg->host->shost_dev.kobj, KOBJ_CHANGE);
3316 LEAVE; 3314 LEAVE;
@@ -4346,30 +4344,6 @@ static int ipr_change_queue_depth(struct scsi_device *sdev, int qdepth)
4346} 4344}
4347 4345
4348/** 4346/**
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 **/
4356static 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 * ipr_show_adapter_handle - Show the adapter's resource handle for this device 4347 * ipr_show_adapter_handle - Show the adapter's resource handle for this device
4374 * @dev: device struct 4348 * @dev: device struct
4375 * @attr: device attribute structure 4349 * @attr: device attribute structure
@@ -4739,6 +4713,7 @@ static int ipr_slave_configure(struct scsi_device *sdev)
4739 sdev->no_uld_attach = 1; 4713 sdev->no_uld_attach = 1;
4740 } 4714 }
4741 if (ipr_is_vset_device(res)) { 4715 if (ipr_is_vset_device(res)) {
4716 sdev->scsi_level = SCSI_SPC_3;
4742 blk_queue_rq_timeout(sdev->request_queue, 4717 blk_queue_rq_timeout(sdev->request_queue,
4743 IPR_VSET_RW_TIMEOUT); 4718 IPR_VSET_RW_TIMEOUT);
4744 blk_queue_max_hw_sectors(sdev->request_queue, IPR_VSET_MAX_SECTORS); 4719 blk_queue_max_hw_sectors(sdev->request_queue, IPR_VSET_MAX_SECTORS);
@@ -5231,6 +5206,28 @@ static int ipr_cancel_op(struct scsi_cmnd *scsi_cmd)
5231 * @scsi_cmd: scsi command struct 5206 * @scsi_cmd: scsi command struct
5232 * 5207 *
5233 * Return value: 5208 * Return value:
5209 * 0 if scan in progress / 1 if scan is complete
5210 **/
5211static int ipr_scan_finished(struct Scsi_Host *shost, unsigned long elapsed_time)
5212{
5213 unsigned long lock_flags;
5214 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) shost->hostdata;
5215 int rc = 0;
5216
5217 spin_lock_irqsave(shost->host_lock, lock_flags);
5218 if (ioa_cfg->hrrq[IPR_INIT_HRRQ].ioa_is_dead || ioa_cfg->scan_done)
5219 rc = 1;
5220 if ((elapsed_time/HZ) > (ioa_cfg->transop_timeout * 2))
5221 rc = 1;
5222 spin_unlock_irqrestore(shost->host_lock, lock_flags);
5223 return rc;
5224}
5225
5226/**
5227 * ipr_eh_host_reset - Reset the host adapter
5228 * @scsi_cmd: scsi command struct
5229 *
5230 * Return value:
5234 * SUCCESS / FAILED 5231 * SUCCESS / FAILED
5235 **/ 5232 **/
5236static int ipr_eh_abort(struct scsi_cmnd *scsi_cmd) 5233static int ipr_eh_abort(struct scsi_cmnd *scsi_cmd)
@@ -5779,7 +5776,7 @@ static void ipr_erp_cancel_all(struct ipr_cmnd *ipr_cmd)
5779 5776
5780 ipr_reinit_ipr_cmnd_for_erp(ipr_cmd); 5777 ipr_reinit_ipr_cmnd_for_erp(ipr_cmd);
5781 5778
5782 if (!scsi_get_tag_type(scsi_cmd->device)) { 5779 if (!scsi_cmd->device->simple_tags) {
5783 ipr_erp_request_sense(ipr_cmd); 5780 ipr_erp_request_sense(ipr_cmd);
5784 return; 5781 return;
5785 } 5782 }
@@ -6299,10 +6296,10 @@ static struct scsi_host_template driver_template = {
6299 .slave_alloc = ipr_slave_alloc, 6296 .slave_alloc = ipr_slave_alloc,
6300 .slave_configure = ipr_slave_configure, 6297 .slave_configure = ipr_slave_configure,
6301 .slave_destroy = ipr_slave_destroy, 6298 .slave_destroy = ipr_slave_destroy,
6299 .scan_finished = ipr_scan_finished,
6302 .target_alloc = ipr_target_alloc, 6300 .target_alloc = ipr_target_alloc,
6303 .target_destroy = ipr_target_destroy, 6301 .target_destroy = ipr_target_destroy,
6304 .change_queue_depth = ipr_change_queue_depth, 6302 .change_queue_depth = ipr_change_queue_depth,
6305 .change_queue_type = ipr_change_queue_type,
6306 .bios_param = ipr_biosparam, 6303 .bios_param = ipr_biosparam,
6307 .can_queue = IPR_MAX_COMMANDS, 6304 .can_queue = IPR_MAX_COMMANDS,
6308 .this_id = -1, 6305 .this_id = -1,
@@ -6841,7 +6838,7 @@ static int ipr_ioa_reset_done(struct ipr_cmnd *ipr_cmd)
6841 ioa_cfg->doorbell |= IPR_RUNTIME_RESET; 6838 ioa_cfg->doorbell |= IPR_RUNTIME_RESET;
6842 6839
6843 list_for_each_entry(res, &ioa_cfg->used_res_q, queue) { 6840 list_for_each_entry(res, &ioa_cfg->used_res_q, queue) {
6844 if (ioa_cfg->allow_ml_add_del && (res->add_to_ml || res->del_from_ml)) { 6841 if (res->add_to_ml || res->del_from_ml) {
6845 ipr_trace; 6842 ipr_trace;
6846 break; 6843 break;
6847 } 6844 }
@@ -6870,6 +6867,7 @@ static int ipr_ioa_reset_done(struct ipr_cmnd *ipr_cmd)
6870 if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].allow_cmds) 6867 if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].allow_cmds)
6871 scsi_block_requests(ioa_cfg->host); 6868 scsi_block_requests(ioa_cfg->host);
6872 6869
6870 schedule_work(&ioa_cfg->work_q);
6873 LEAVE; 6871 LEAVE;
6874 return IPR_RC_JOB_RETURN; 6872 return IPR_RC_JOB_RETURN;
6875} 6873}
@@ -7610,6 +7608,19 @@ static int ipr_ioafp_page0_inquiry(struct ipr_cmnd *ipr_cmd)
7610 type[4] = '\0'; 7608 type[4] = '\0';
7611 ioa_cfg->type = simple_strtoul((char *)type, NULL, 16); 7609 ioa_cfg->type = simple_strtoul((char *)type, NULL, 16);
7612 7610
7611 if (ipr_invalid_adapter(ioa_cfg)) {
7612 dev_err(&ioa_cfg->pdev->dev,
7613 "Adapter not supported in this hardware configuration.\n");
7614
7615 if (!ipr_testmode) {
7616 ioa_cfg->reset_retries += IPR_NUM_RESET_RELOAD_RETRIES;
7617 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NONE);
7618 list_add_tail(&ipr_cmd->queue,
7619 &ioa_cfg->hrrq->hrrq_free_q);
7620 return IPR_RC_JOB_RETURN;
7621 }
7622 }
7623
7613 ipr_cmd->job_step = ipr_ioafp_page3_inquiry; 7624 ipr_cmd->job_step = ipr_ioafp_page3_inquiry;
7614 7625
7615 ipr_ioafp_inquiry(ipr_cmd, 1, 0, 7626 ipr_ioafp_inquiry(ipr_cmd, 1, 0,
@@ -8797,20 +8808,6 @@ static int ipr_probe_ioa_part2(struct ipr_ioa_cfg *ioa_cfg)
8797 _ipr_initiate_ioa_reset(ioa_cfg, ipr_reset_enable_ioa, 8808 _ipr_initiate_ioa_reset(ioa_cfg, ipr_reset_enable_ioa,
8798 IPR_SHUTDOWN_NONE); 8809 IPR_SHUTDOWN_NONE);
8799 spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags); 8810 spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags);
8800 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
8801 spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags);
8802
8803 if (ioa_cfg->hrrq[IPR_INIT_HRRQ].ioa_is_dead) {
8804 rc = -EIO;
8805 } else if (ipr_invalid_adapter(ioa_cfg)) {
8806 if (!ipr_testmode)
8807 rc = -EIO;
8808
8809 dev_err(&ioa_cfg->pdev->dev,
8810 "Adapter not supported in this hardware configuration.\n");
8811 }
8812
8813 spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags);
8814 8811
8815 LEAVE; 8812 LEAVE;
8816 return rc; 8813 return rc;
@@ -9264,7 +9261,7 @@ static void ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg,
9264 * ioa_cfg->max_devs_supported))); 9261 * ioa_cfg->max_devs_supported)));
9265 } 9262 }
9266 9263
9267 host->max_channel = IPR_MAX_BUS_TO_SCAN; 9264 host->max_channel = IPR_VSET_BUS;
9268 host->unique_id = host->host_no; 9265 host->unique_id = host->host_no;
9269 host->max_cmd_len = IPR_MAX_CDB_LEN; 9266 host->max_cmd_len = IPR_MAX_CDB_LEN;
9270 host->can_queue = ioa_cfg->max_cmds; 9267 host->can_queue = ioa_cfg->max_cmds;
@@ -9764,25 +9761,6 @@ out_scsi_host_put:
9764} 9761}
9765 9762
9766/** 9763/**
9767 * ipr_scan_vsets - Scans for VSET devices
9768 * @ioa_cfg: ioa config struct
9769 *
9770 * Description: Since the VSET resources do not follow SAM in that we can have
9771 * sparse LUNs with no LUN 0, we have to scan for these ourselves.
9772 *
9773 * Return value:
9774 * none
9775 **/
9776static void ipr_scan_vsets(struct ipr_ioa_cfg *ioa_cfg)
9777{
9778 int target, lun;
9779
9780 for (target = 0; target < IPR_MAX_NUM_TARGETS_PER_BUS; target++)
9781 for (lun = 0; lun < IPR_MAX_NUM_VSET_LUNS_PER_TARGET; lun++)
9782 scsi_add_device(ioa_cfg->host, IPR_VSET_BUS, target, lun);
9783}
9784
9785/**
9786 * ipr_initiate_ioa_bringdown - Bring down an adapter 9764 * ipr_initiate_ioa_bringdown - Bring down an adapter
9787 * @ioa_cfg: ioa config struct 9765 * @ioa_cfg: ioa config struct
9788 * @shutdown_type: shutdown type 9766 * @shutdown_type: shutdown type
@@ -9937,10 +9915,6 @@ static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
9937 } 9915 }
9938 9916
9939 scsi_scan_host(ioa_cfg->host); 9917 scsi_scan_host(ioa_cfg->host);
9940 ipr_scan_vsets(ioa_cfg);
9941 scsi_add_device(ioa_cfg->host, IPR_IOA_BUS, IPR_IOA_TARGET, IPR_IOA_LUN);
9942 ioa_cfg->allow_ml_add_del = 1;
9943 ioa_cfg->host->max_channel = IPR_VSET_BUS;
9944 ioa_cfg->iopoll_weight = ioa_cfg->chip_cfg->iopoll_weight; 9918 ioa_cfg->iopoll_weight = ioa_cfg->chip_cfg->iopoll_weight;
9945 9919
9946 if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { 9920 if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) {
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 9ebdebd944e7..b4f3eec51bc9 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -157,13 +157,11 @@
157 157
158#define IPR_MAX_NUM_TARGETS_PER_BUS 256 158#define IPR_MAX_NUM_TARGETS_PER_BUS 256
159#define IPR_MAX_NUM_LUNS_PER_TARGET 256 159#define IPR_MAX_NUM_LUNS_PER_TARGET 256
160#define IPR_MAX_NUM_VSET_LUNS_PER_TARGET 8
161#define IPR_VSET_BUS 0xff 160#define IPR_VSET_BUS 0xff
162#define IPR_IOA_BUS 0xff 161#define IPR_IOA_BUS 0xff
163#define IPR_IOA_TARGET 0xff 162#define IPR_IOA_TARGET 0xff
164#define IPR_IOA_LUN 0xff 163#define IPR_IOA_LUN 0xff
165#define IPR_MAX_NUM_BUSES 16 164#define IPR_MAX_NUM_BUSES 16
166#define IPR_MAX_BUS_TO_SCAN IPR_MAX_NUM_BUSES
167 165
168#define IPR_NUM_RESET_RELOAD_RETRIES 3 166#define IPR_NUM_RESET_RELOAD_RETRIES 3
169 167
@@ -1453,7 +1451,7 @@ struct ipr_ioa_cfg {
1453 u8 in_ioa_bringdown:1; 1451 u8 in_ioa_bringdown:1;
1454 u8 ioa_unit_checked:1; 1452 u8 ioa_unit_checked:1;
1455 u8 dump_taken:1; 1453 u8 dump_taken:1;
1456 u8 allow_ml_add_del:1; 1454 u8 scan_done:1;
1457 u8 needs_hard_reset:1; 1455 u8 needs_hard_reset:1;
1458 u8 dual_raid:1; 1456 u8 dual_raid:1;
1459 u8 needs_warm_reset:1; 1457 u8 needs_warm_reset:1;
diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
index 724c6265b667..cd41b63a2f10 100644
--- a/drivers/scsi/isci/init.c
+++ b/drivers/scsi/isci/init.c
@@ -158,7 +158,6 @@ static struct scsi_host_template isci_sht = {
158 .scan_finished = isci_host_scan_finished, 158 .scan_finished = isci_host_scan_finished,
159 .scan_start = isci_host_start, 159 .scan_start = isci_host_start,
160 .change_queue_depth = sas_change_queue_depth, 160 .change_queue_depth = sas_change_queue_depth,
161 .change_queue_type = sas_change_queue_type,
162 .bios_param = sas_bios_param, 161 .bios_param = sas_bios_param,
163 .can_queue = ISCI_CAN_QUEUE_VAL, 162 .can_queue = ISCI_CAN_QUEUE_VAL,
164 .cmd_per_lun = 1, 163 .cmd_per_lun = 1,
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
index 72918d227ead..519dac4e341e 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -906,13 +906,6 @@ int sas_change_queue_depth(struct scsi_device *sdev, int depth)
906 return scsi_change_queue_depth(sdev, depth); 906 return scsi_change_queue_depth(sdev, depth);
907} 907}
908 908
909int 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
916int sas_bios_param(struct scsi_device *scsi_dev, 909int sas_bios_param(struct scsi_device *scsi_dev,
917 struct block_device *bdev, 910 struct block_device *bdev,
918 sector_t capacity, int *hsc) 911 sector_t capacity, int *hsc)
@@ -1011,7 +1004,6 @@ EXPORT_SYMBOL_GPL(sas_queuecommand);
1011EXPORT_SYMBOL_GPL(sas_target_alloc); 1004EXPORT_SYMBOL_GPL(sas_target_alloc);
1012EXPORT_SYMBOL_GPL(sas_slave_configure); 1005EXPORT_SYMBOL_GPL(sas_slave_configure);
1013EXPORT_SYMBOL_GPL(sas_change_queue_depth); 1006EXPORT_SYMBOL_GPL(sas_change_queue_depth);
1014EXPORT_SYMBOL_GPL(sas_change_queue_type);
1015EXPORT_SYMBOL_GPL(sas_bios_param); 1007EXPORT_SYMBOL_GPL(sas_bios_param);
1016EXPORT_SYMBOL_GPL(sas_task_abort); 1008EXPORT_SYMBOL_GPL(sas_task_abort);
1017EXPORT_SYMBOL_GPL(sas_phy_reset); 1009EXPORT_SYMBOL_GPL(sas_phy_reset);
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index fd85952b621d..4f9222eb2266 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -5879,7 +5879,6 @@ struct scsi_host_template lpfc_template = {
5879 .max_sectors = 0xFFFF, 5879 .max_sectors = 0xFFFF,
5880 .vendor_id = LPFC_NL_VENDOR_ID, 5880 .vendor_id = LPFC_NL_VENDOR_ID,
5881 .change_queue_depth = scsi_change_queue_depth, 5881 .change_queue_depth = scsi_change_queue_depth,
5882 .change_queue_type = scsi_change_queue_type,
5883 .use_blk_tags = 1, 5882 .use_blk_tags = 1,
5884 .track_queue_depth = 1, 5883 .track_queue_depth = 1,
5885}; 5884};
@@ -5904,7 +5903,6 @@ struct scsi_host_template lpfc_vport_template = {
5904 .shost_attrs = lpfc_vport_attrs, 5903 .shost_attrs = lpfc_vport_attrs,
5905 .max_sectors = 0xFFFF, 5904 .max_sectors = 0xFFFF,
5906 .change_queue_depth = scsi_change_queue_depth, 5905 .change_queue_depth = scsi_change_queue_depth,
5907 .change_queue_type = scsi_change_queue_type,
5908 .use_blk_tags = 1, 5906 .use_blk_tags = 1,
5909 .track_queue_depth = 1, 5907 .track_queue_depth = 1,
5910}; 5908};
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 8431eb10bbb1..6a1c036a6f3f 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -7592,7 +7592,6 @@ static struct scsi_host_template scsih_driver_template = {
7592 .scan_finished = _scsih_scan_finished, 7592 .scan_finished = _scsih_scan_finished,
7593 .scan_start = _scsih_scan_start, 7593 .scan_start = _scsih_scan_start,
7594 .change_queue_depth = _scsih_change_queue_depth, 7594 .change_queue_depth = _scsih_change_queue_depth,
7595 .change_queue_type = scsi_change_queue_type,
7596 .eh_abort_handler = _scsih_abort, 7595 .eh_abort_handler = _scsih_abort,
7597 .eh_device_reset_handler = _scsih_dev_reset, 7596 .eh_device_reset_handler = _scsih_dev_reset,
7598 .eh_target_reset_handler = _scsih_target_reset, 7597 .eh_target_reset_handler = _scsih_target_reset,
diff --git a/drivers/scsi/mpt2sas/mpt2sas_transport.c b/drivers/scsi/mpt2sas/mpt2sas_transport.c
index 0d1d06488a28..e689bf20a3ea 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_transport.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_transport.c
@@ -1006,12 +1006,9 @@ mpt2sas_transport_update_links(struct MPT2SAS_ADAPTER *ioc,
1006 &mpt2sas_phy->remote_identify); 1006 &mpt2sas_phy->remote_identify);
1007 _transport_add_phy_to_an_existing_port(ioc, sas_node, 1007 _transport_add_phy_to_an_existing_port(ioc, sas_node,
1008 mpt2sas_phy, mpt2sas_phy->remote_identify.sas_address); 1008 mpt2sas_phy, mpt2sas_phy->remote_identify.sas_address);
1009 } else { 1009 } else
1010 memset(&mpt2sas_phy->remote_identify, 0 , sizeof(struct 1010 memset(&mpt2sas_phy->remote_identify, 0 , sizeof(struct
1011 sas_identify)); 1011 sas_identify));
1012 _transport_del_phy_from_an_existing_port(ioc, sas_node,
1013 mpt2sas_phy);
1014 }
1015 1012
1016 if (mpt2sas_phy->phy) 1013 if (mpt2sas_phy->phy)
1017 mpt2sas_phy->phy->negotiated_linkrate = 1014 mpt2sas_phy->phy->negotiated_linkrate =
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index a2b60991efd4..94261ee9e72d 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -7229,7 +7229,6 @@ static struct scsi_host_template scsih_driver_template = {
7229 .scan_finished = _scsih_scan_finished, 7229 .scan_finished = _scsih_scan_finished,
7230 .scan_start = _scsih_scan_start, 7230 .scan_start = _scsih_scan_start,
7231 .change_queue_depth = _scsih_change_queue_depth, 7231 .change_queue_depth = _scsih_change_queue_depth,
7232 .change_queue_type = scsi_change_queue_type,
7233 .eh_abort_handler = _scsih_abort, 7232 .eh_abort_handler = _scsih_abort,
7234 .eh_device_reset_handler = _scsih_dev_reset, 7233 .eh_device_reset_handler = _scsih_dev_reset,
7235 .eh_target_reset_handler = _scsih_target_reset, 7234 .eh_target_reset_handler = _scsih_target_reset,
diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c
index d4bafaaebea9..3637ae6c0171 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_transport.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c
@@ -1003,12 +1003,9 @@ mpt3sas_transport_update_links(struct MPT3SAS_ADAPTER *ioc,
1003 &mpt3sas_phy->remote_identify); 1003 &mpt3sas_phy->remote_identify);
1004 _transport_add_phy_to_an_existing_port(ioc, sas_node, 1004 _transport_add_phy_to_an_existing_port(ioc, sas_node,
1005 mpt3sas_phy, mpt3sas_phy->remote_identify.sas_address); 1005 mpt3sas_phy, mpt3sas_phy->remote_identify.sas_address);
1006 } else { 1006 } else
1007 memset(&mpt3sas_phy->remote_identify, 0 , sizeof(struct 1007 memset(&mpt3sas_phy->remote_identify, 0 , sizeof(struct
1008 sas_identify)); 1008 sas_identify));
1009 _transport_del_phy_from_an_existing_port(ioc, sas_node,
1010 mpt3sas_phy);
1011 }
1012 1009
1013 if (mpt3sas_phy->phy) 1010 if (mpt3sas_phy->phy)
1014 mpt3sas_phy->phy->negotiated_linkrate = 1011 mpt3sas_phy->phy->negotiated_linkrate =
diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c
index f15df3de6790..53030b0e8015 100644
--- a/drivers/scsi/mvsas/mv_init.c
+++ b/drivers/scsi/mvsas/mv_init.c
@@ -54,7 +54,6 @@ static struct scsi_host_template mvs_sht = {
54 .scan_finished = mvs_scan_finished, 54 .scan_finished = mvs_scan_finished,
55 .scan_start = mvs_scan_start, 55 .scan_start = mvs_scan_start,
56 .change_queue_depth = sas_change_queue_depth, 56 .change_queue_depth = sas_change_queue_depth,
57 .change_queue_type = sas_change_queue_type,
58 .bios_param = sas_bios_param, 57 .bios_param = sas_bios_param,
59 .can_queue = 1, 58 .can_queue = 1,
60 .cmd_per_lun = 1, 59 .cmd_per_lun = 1,
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 329aba0083ab..65555916d3b8 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -76,7 +76,6 @@ static struct scsi_host_template pm8001_sht = {
76 .scan_finished = pm8001_scan_finished, 76 .scan_finished = pm8001_scan_finished,
77 .scan_start = pm8001_scan_start, 77 .scan_start = pm8001_scan_start,
78 .change_queue_depth = sas_change_queue_depth, 78 .change_queue_depth = sas_change_queue_depth,
79 .change_queue_type = sas_change_queue_type,
80 .bios_param = sas_bios_param, 79 .bios_param = sas_bios_param,
81 .can_queue = 1, 80 .can_queue = 1,
82 .cmd_per_lun = 1, 81 .cmd_per_lun = 1,
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index b1b1f66b1ab7..8c27b6a77ec4 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -4251,7 +4251,6 @@ static struct scsi_host_template pmcraid_host_template = {
4251 .slave_configure = pmcraid_slave_configure, 4251 .slave_configure = pmcraid_slave_configure,
4252 .slave_destroy = pmcraid_slave_destroy, 4252 .slave_destroy = pmcraid_slave_destroy,
4253 .change_queue_depth = pmcraid_change_queue_depth, 4253 .change_queue_depth = pmcraid_change_queue_depth,
4254 .change_queue_type = scsi_change_queue_type,
4255 .can_queue = PMCRAID_MAX_IO_CMD, 4254 .can_queue = PMCRAID_MAX_IO_CMD,
4256 .this_id = -1, 4255 .this_id = -1,
4257 .sg_tablesize = PMCRAID_MAX_IOADLS, 4256 .sg_tablesize = PMCRAID_MAX_IOADLS,
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index a4dde7e80dbd..e59f25bff7ab 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -3237,8 +3237,6 @@ qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport)
3237 struct fc_rport *rport; 3237 struct fc_rport *rport;
3238 unsigned long flags; 3238 unsigned long flags;
3239 3239
3240 qla2x00_rport_del(fcport);
3241
3242 rport_ids.node_name = wwn_to_u64(fcport->node_name); 3240 rport_ids.node_name = wwn_to_u64(fcport->node_name);
3243 rport_ids.port_name = wwn_to_u64(fcport->port_name); 3241 rport_ids.port_name = wwn_to_u64(fcport->port_name);
3244 rport_ids.port_id = fcport->d_id.b.domain << 16 | 3242 rport_ids.port_id = fcport->d_id.b.domain << 16 |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 6b4d9235368a..12ca291c1380 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -258,7 +258,6 @@ struct scsi_host_template qla2xxx_driver_template = {
258 .scan_finished = qla2xxx_scan_finished, 258 .scan_finished = qla2xxx_scan_finished,
259 .scan_start = qla2xxx_scan_start, 259 .scan_start = qla2xxx_scan_start,
260 .change_queue_depth = scsi_change_queue_depth, 260 .change_queue_depth = scsi_change_queue_depth,
261 .change_queue_type = scsi_change_queue_type,
262 .this_id = -1, 261 .this_id = -1,
263 .cmd_per_lun = 3, 262 .cmd_per_lun = 3,
264 .use_clustering = ENABLE_CLUSTERING, 263 .use_clustering = ENABLE_CLUSTERING,
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index a902fa1db7af..57418258c101 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -3218,25 +3218,25 @@ static inline int qlt_get_fcp_task_attr(struct scsi_qla_host *vha,
3218 3218
3219 switch (task_codes) { 3219 switch (task_codes) {
3220 case ATIO_SIMPLE_QUEUE: 3220 case ATIO_SIMPLE_QUEUE:
3221 fcp_task_attr = MSG_SIMPLE_TAG; 3221 fcp_task_attr = TCM_SIMPLE_TAG;
3222 break; 3222 break;
3223 case ATIO_HEAD_OF_QUEUE: 3223 case ATIO_HEAD_OF_QUEUE:
3224 fcp_task_attr = MSG_HEAD_TAG; 3224 fcp_task_attr = TCM_HEAD_TAG;
3225 break; 3225 break;
3226 case ATIO_ORDERED_QUEUE: 3226 case ATIO_ORDERED_QUEUE:
3227 fcp_task_attr = MSG_ORDERED_TAG; 3227 fcp_task_attr = TCM_ORDERED_TAG;
3228 break; 3228 break;
3229 case ATIO_ACA_QUEUE: 3229 case ATIO_ACA_QUEUE:
3230 fcp_task_attr = MSG_ACA_TAG; 3230 fcp_task_attr = TCM_ACA_TAG;
3231 break; 3231 break;
3232 case ATIO_UNTAGGED: 3232 case ATIO_UNTAGGED:
3233 fcp_task_attr = MSG_SIMPLE_TAG; 3233 fcp_task_attr = TCM_SIMPLE_TAG;
3234 break; 3234 break;
3235 default: 3235 default:
3236 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf05d, 3236 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf05d,
3237 "qla_target: unknown task code %x, use ORDERED instead\n", 3237 "qla_target: unknown task code %x, use ORDERED instead\n",
3238 task_codes); 3238 task_codes);
3239 fcp_task_attr = MSG_ORDERED_TAG; 3239 fcp_task_attr = TCM_ORDERED_TAG;
3240 break; 3240 break;
3241 } 3241 }
3242 3242
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 1ad0c36375b8..e02885451425 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -739,34 +739,12 @@ int scsi_track_queue_full(struct scsi_device *sdev, int depth)
739 739
740 if (sdev->last_queue_full_count <= 10) 740 if (sdev->last_queue_full_count <= 10)
741 return 0; 741 return 0;
742 if (sdev->last_queue_full_depth < 8) {
743 /* Drop back to untagged */
744 scsi_set_tag_type(sdev, 0);
745 scsi_change_queue_depth(sdev, sdev->host->cmd_per_lun);
746 return -1;
747 }
748 742
749 return scsi_change_queue_depth(sdev, depth); 743 return scsi_change_queue_depth(sdev, depth);
750} 744}
751EXPORT_SYMBOL(scsi_track_queue_full); 745EXPORT_SYMBOL(scsi_track_queue_full);
752 746
753/** 747/**
754 * scsi_change_queue_type() - Change a device's queue type
755 * @sdev: The SCSI device whose queue depth is to change
756 * @tag_type: Identifier for queue type
757 */
758int scsi_change_queue_type(struct scsi_device *sdev, int tag_type)
759{
760 if (!sdev->tagged_supported)
761 return 0;
762
763 scsi_set_tag_type(sdev, tag_type);
764 return tag_type;
765
766}
767EXPORT_SYMBOL(scsi_change_queue_type);
768
769/**
770 * scsi_vpd_inquiry - Request a device provide us with a VPD page 748 * scsi_vpd_inquiry - Request a device provide us with a VPD page
771 * @sdev: The device to ask 749 * @sdev: The device to ask
772 * @buffer: Where to put the result 750 * @buffer: Where to put the result
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index aa4b6b80aade..7b8b51bc29b4 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -128,7 +128,6 @@ static const char *scsi_debug_version_date = "20141022";
128#define DEF_REMOVABLE false 128#define DEF_REMOVABLE false
129#define DEF_SCSI_LEVEL 6 /* INQUIRY, byte2 [6->SPC-4] */ 129#define DEF_SCSI_LEVEL 6 /* INQUIRY, byte2 [6->SPC-4] */
130#define DEF_SECTOR_SIZE 512 130#define DEF_SECTOR_SIZE 512
131#define DEF_TAGGED_QUEUING 0 /* 0 | MSG_SIMPLE_TAG | MSG_ORDERED_TAG */
132#define DEF_UNMAP_ALIGNMENT 0 131#define DEF_UNMAP_ALIGNMENT 0
133#define DEF_UNMAP_GRANULARITY 1 132#define DEF_UNMAP_GRANULARITY 1
134#define DEF_UNMAP_MAX_BLOCKS 0xFFFFFFFF 133#define DEF_UNMAP_MAX_BLOCKS 0xFFFFFFFF
@@ -817,6 +816,7 @@ static int check_readiness(struct scsi_cmnd *SCpnt, int uas_only,
817 UA_CHANGED_ASC, CAPACITY_CHANGED_ASCQ); 816 UA_CHANGED_ASC, CAPACITY_CHANGED_ASCQ);
818 if (debug) 817 if (debug)
819 cp = "capacity data changed"; 818 cp = "capacity data changed";
819 break;
820 default: 820 default:
821 pr_warn("%s: unexpected unit attention code=%d\n", 821 pr_warn("%s: unexpected unit attention code=%d\n",
822 __func__, k); 822 __func__, k);
@@ -3045,18 +3045,12 @@ resp_comp_write(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
3045 u8 num; 3045 u8 num;
3046 unsigned long iflags; 3046 unsigned long iflags;
3047 int ret; 3047 int ret;
3048 int retval = 0;
3048 3049
3049 lba = get_unaligned_be32(cmd + 2); 3050 lba = get_unaligned_be64(cmd + 2);
3050 num = cmd[13]; /* 1 to a maximum of 255 logical blocks */ 3051 num = cmd[13]; /* 1 to a maximum of 255 logical blocks */
3051 if (0 == num) 3052 if (0 == num)
3052 return 0; /* degenerate case, not an error */ 3053 return 0; /* degenerate case, not an error */
3053 dnum = 2 * num;
3054 arr = kzalloc(dnum * lb_size, GFP_ATOMIC);
3055 if (NULL == arr) {
3056 mk_sense_buffer(scp, ILLEGAL_REQUEST, INSUFF_RES_ASC,
3057 INSUFF_RES_ASCQ);
3058 return check_condition_result;
3059 }
3060 if (scsi_debug_dif == SD_DIF_TYPE2_PROTECTION && 3054 if (scsi_debug_dif == SD_DIF_TYPE2_PROTECTION &&
3061 (cmd[1] & 0xe0)) { 3055 (cmd[1] & 0xe0)) {
3062 mk_sense_invalid_opcode(scp); 3056 mk_sense_invalid_opcode(scp);
@@ -3079,6 +3073,13 @@ resp_comp_write(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
3079 mk_sense_buffer(scp, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB, 0); 3073 mk_sense_buffer(scp, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB, 0);
3080 return check_condition_result; 3074 return check_condition_result;
3081 } 3075 }
3076 dnum = 2 * num;
3077 arr = kzalloc(dnum * lb_size, GFP_ATOMIC);
3078 if (NULL == arr) {
3079 mk_sense_buffer(scp, ILLEGAL_REQUEST, INSUFF_RES_ASC,
3080 INSUFF_RES_ASCQ);
3081 return check_condition_result;
3082 }
3082 3083
3083 write_lock_irqsave(&atomic_rw, iflags); 3084 write_lock_irqsave(&atomic_rw, iflags);
3084 3085
@@ -3089,24 +3090,24 @@ resp_comp_write(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
3089 ret = do_device_access(scp, 0, dnum, true); 3090 ret = do_device_access(scp, 0, dnum, true);
3090 fake_storep = fake_storep_hold; 3091 fake_storep = fake_storep_hold;
3091 if (ret == -1) { 3092 if (ret == -1) {
3092 write_unlock_irqrestore(&atomic_rw, iflags); 3093 retval = DID_ERROR << 16;
3093 kfree(arr); 3094 goto cleanup;
3094 return DID_ERROR << 16;
3095 } else if ((ret < (dnum * lb_size)) && 3095 } else if ((ret < (dnum * lb_size)) &&
3096 (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)) 3096 (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts))
3097 sdev_printk(KERN_INFO, scp->device, "%s: compare_write: cdb " 3097 sdev_printk(KERN_INFO, scp->device, "%s: compare_write: cdb "
3098 "indicated=%u, IO sent=%d bytes\n", my_name, 3098 "indicated=%u, IO sent=%d bytes\n", my_name,
3099 dnum * lb_size, ret); 3099 dnum * lb_size, ret);
3100 if (!comp_write_worker(lba, num, arr)) { 3100 if (!comp_write_worker(lba, num, arr)) {
3101 write_unlock_irqrestore(&atomic_rw, iflags);
3102 kfree(arr);
3103 mk_sense_buffer(scp, MISCOMPARE, MISCOMPARE_VERIFY_ASC, 0); 3101 mk_sense_buffer(scp, MISCOMPARE, MISCOMPARE_VERIFY_ASC, 0);
3104 return check_condition_result; 3102 retval = check_condition_result;
3103 goto cleanup;
3105 } 3104 }
3106 if (scsi_debug_lbp()) 3105 if (scsi_debug_lbp())
3107 map_region(lba, num); 3106 map_region(lba, num);
3107cleanup:
3108 write_unlock_irqrestore(&atomic_rw, iflags); 3108 write_unlock_irqrestore(&atomic_rw, iflags);
3109 return 0; 3109 kfree(arr);
3110 return retval;
3110} 3111}
3111 3112
3112struct unmap_block_desc { 3113struct unmap_block_desc {
@@ -4438,6 +4439,7 @@ static ssize_t virtual_gb_store(struct device_driver *ddp, const char *buf,
4438 struct sdebug_host_info *sdhp; 4439 struct sdebug_host_info *sdhp;
4439 struct sdebug_dev_info *dp; 4440 struct sdebug_dev_info *dp;
4440 4441
4442 spin_lock(&sdebug_host_list_lock);
4441 list_for_each_entry(sdhp, &sdebug_host_list, 4443 list_for_each_entry(sdhp, &sdebug_host_list,
4442 host_list) { 4444 host_list) {
4443 list_for_each_entry(dp, &sdhp->dev_info_list, 4445 list_for_each_entry(dp, &sdhp->dev_info_list,
@@ -4446,6 +4448,7 @@ static ssize_t virtual_gb_store(struct device_driver *ddp, const char *buf,
4446 dp->uas_bm); 4448 dp->uas_bm);
4447 } 4449 }
4448 } 4450 }
4451 spin_unlock(&sdebug_host_list_lock);
4449 } 4452 }
4450 return count; 4453 return count;
4451 } 4454 }
@@ -4988,32 +4991,6 @@ sdebug_change_qdepth(struct scsi_device *sdev, int qdepth)
4988} 4991}
4989 4992
4990static int 4993static int
4991sdebug_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
5016static int
5017check_inject(struct scsi_cmnd *scp) 4994check_inject(struct scsi_cmnd *scp)
5018{ 4995{
5019 struct sdebug_scmd_extra_t *ep = scsi_cmd_priv(scp); 4996 struct sdebug_scmd_extra_t *ep = scsi_cmd_priv(scp);
@@ -5212,7 +5189,6 @@ static struct scsi_host_template sdebug_driver_template = {
5212 .ioctl = scsi_debug_ioctl, 5189 .ioctl = scsi_debug_ioctl,
5213 .queuecommand = sdebug_queuecommand_lock_or_not, 5190 .queuecommand = sdebug_queuecommand_lock_or_not,
5214 .change_queue_depth = sdebug_change_qdepth, 5191 .change_queue_depth = sdebug_change_qdepth,
5215 .change_queue_type = sdebug_change_qtype,
5216 .eh_abort_handler = scsi_debug_abort, 5192 .eh_abort_handler = scsi_debug_abort,
5217 .eh_device_reset_handler = scsi_debug_device_reset, 5193 .eh_device_reset_handler = scsi_debug_device_reset,
5218 .eh_target_reset_handler = scsi_debug_target_reset, 5194 .eh_target_reset_handler = scsi_debug_target_reset,
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index c1d04d4d3c6c..262ab837a704 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -211,6 +211,7 @@ static struct {
211 {"Medion", "Flash XL MMC/SD", "2.6D", BLIST_FORCELUN}, 211 {"Medion", "Flash XL MMC/SD", "2.6D", BLIST_FORCELUN},
212 {"MegaRAID", "LD", NULL, BLIST_FORCELUN}, 212 {"MegaRAID", "LD", NULL, BLIST_FORCELUN},
213 {"MICROP", "4110", NULL, BLIST_NOTQ}, 213 {"MICROP", "4110", NULL, BLIST_NOTQ},
214 {"MSFT", "Virtual HD", NULL, BLIST_NO_RSOC},
214 {"MYLEX", "DACARMRB", "*", BLIST_REPORTLUN2}, 215 {"MYLEX", "DACARMRB", "*", BLIST_REPORTLUN2},
215 {"nCipher", "Fastness Crypto", NULL, BLIST_FORCELUN}, 216 {"nCipher", "Fastness Crypto", NULL, BLIST_FORCELUN},
216 {"NAKAMICH", "MJ-4.8S", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, 217 {"NAKAMICH", "MJ-4.8S", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 43318d556cbc..9ea95dd3e260 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1918,7 +1918,9 @@ static int scsi_mq_prep_fn(struct request *req)
1918 1918
1919 if (scsi_host_get_prot(shost)) { 1919 if (scsi_host_get_prot(shost)) {
1920 cmd->prot_sdb = (void *)sg + 1920 cmd->prot_sdb = (void *)sg +
1921 shost->sg_tablesize * sizeof(struct scatterlist); 1921 min_t(unsigned int,
1922 shost->sg_tablesize, SCSI_MAX_SG_SEGMENTS) *
1923 sizeof(struct scatterlist);
1922 memset(cmd->prot_sdb, 0, sizeof(struct scsi_data_buffer)); 1924 memset(cmd->prot_sdb, 0, sizeof(struct scsi_data_buffer));
1923 1925
1924 cmd->prot_sdb->table.sgl = 1926 cmd->prot_sdb->table.sgl =
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 1cb64a8e18c9..1ac38e73df7e 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -738,30 +738,12 @@ store_queue_type_field(struct device *dev, struct device_attribute *attr,
738 const char *buf, size_t count) 738 const char *buf, size_t count)
739{ 739{
740 struct scsi_device *sdev = to_scsi_device(dev); 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
745 if (!sdev->tagged_supported || !sht->change_queue_type)
746 return -EINVAL;
747 741
748 /* 742 if (!sdev->tagged_supported)
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; 743 return -EINVAL;
757 744
758 if (tag_type == prev_tag_type) 745 sdev_printk(KERN_INFO, sdev,
759 return count; 746 "ignoring write to deprecated queue_type attribute");
760
761 retval = sht->change_queue_type(sdev, tag_type);
762 if (retval < 0)
763 return retval;
764
765 return count; 747 return count;
766} 748}
767 749
@@ -938,10 +920,6 @@ static umode_t scsi_sdev_attr_is_visible(struct kobject *kobj,
938 !sdev->host->hostt->change_queue_depth) 920 !sdev->host->hostt->change_queue_depth)
939 return 0; 921 return 0;
940 922
941 if (attr == &dev_attr_queue_type.attr &&
942 !sdev->host->hostt->change_queue_type)
943 return S_IRUGO;
944
945 return attr->mode; 923 return attr->mode;
946} 924}
947 925
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index fa2aece76cc2..31bbb0da3397 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -1221,7 +1221,7 @@ EXPORT_SYMBOL_GPL(spi_populate_ppr_msg);
1221int spi_populate_tag_msg(unsigned char *msg, struct scsi_cmnd *cmd) 1221int spi_populate_tag_msg(unsigned char *msg, struct scsi_cmnd *cmd)
1222{ 1222{
1223 if (cmd->flags & SCMD_TAGGED) { 1223 if (cmd->flags & SCMD_TAGGED) {
1224 *msg++ = MSG_SIMPLE_TAG; 1224 *msg++ = SIMPLE_QUEUE_TAG;
1225 *msg++ = cmd->request->tag; 1225 *msg++ = cmd->request->tag;
1226 return 2; 1226 return 2;
1227 } 1227 }
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index e3ba251fb6e7..4cff0ddc2c25 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1688,13 +1688,12 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd)
1688 if (ret == -EAGAIN) { 1688 if (ret == -EAGAIN) {
1689 /* no more space */ 1689 /* no more space */
1690 1690
1691 if (cmd_request->bounce_sgl_count) { 1691 if (cmd_request->bounce_sgl_count)
1692 destroy_bounce_buffer(cmd_request->bounce_sgl, 1692 destroy_bounce_buffer(cmd_request->bounce_sgl,
1693 cmd_request->bounce_sgl_count); 1693 cmd_request->bounce_sgl_count);
1694 1694
1695 ret = SCSI_MLQUEUE_DEVICE_BUSY; 1695 ret = SCSI_MLQUEUE_DEVICE_BUSY;
1696 goto queue_error; 1696 goto queue_error;
1697 }
1698 } 1697 }
1699 1698
1700 return 0; 1699 return 0;