scsi: remove ordered_tags scsi_device field
authorChristoph Hellwig <hch@lst.de>
Thu, 30 Oct 2014 10:54:58 +0000 (11:54 +0100)
committerChristoph Hellwig <hch@lst.de>
Wed, 12 Nov 2014 10:19:40 +0000 (11:19 +0100)
Remove the ordered_tags field, we haven't been issuing ordered tags based
on it since the big barrier rework in 2010.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/message/fusion/mptscsih.c
drivers/scsi/bfa/bfad_im.c
drivers/scsi/mpt2sas/mpt2sas_scsih.c
drivers/scsi/mpt3sas/mpt3sas_scsih.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/scsi.c
drivers/scsi/scsi_sysfs.c
drivers/scsi/vmw_pvscsi.c
drivers/target/loopback/tcm_loop.c
include/scsi/scsi_device.h
include/scsi/scsi_tcq.h

index e7dcb25833697e05a8d00742eac640dfd338f71d..00bd13dc3dc43d7d3b27a5b3de4abfaaf7bab82b 100644 (file)
@@ -2400,9 +2400,8 @@ mptscsih_slave_configure(struct scsi_device *sdev)
        mptscsih_change_queue_depth(sdev, MPT_SCSI_CMD_PER_DEV_HIGH,
                                    SCSI_QDEPTH_DEFAULT);
        dsprintk(ioc, printk(MYIOC_s_DEBUG_FMT
-               "tagged %d, simple %d, ordered %d\n",
-               ioc->name,sdev->tagged_supported, sdev->simple_tags,
-               sdev->ordered_tags));
+               "tagged %d, simple %d\n",
+               ioc->name,sdev->tagged_supported, sdev->simple_tags));
 
        blk_queue_dma_alignment (sdev->request_queue, 512 - 1);
 
index f067332bf7635901d393189fde960616ffb21c52..99280e89c2893b9930b56d43b741eb2aa64c4296 100644 (file)
@@ -868,14 +868,9 @@ bfad_ramp_up_qdepth(struct bfad_itnim_s *itnim, struct scsi_device *sdev)
                        if (bfa_lun_queue_depth > tmp_sdev->queue_depth) {
                                if (tmp_sdev->id != sdev->id)
                                        continue;
-                               if (tmp_sdev->ordered_tags)
-                                       scsi_adjust_queue_depth(tmp_sdev,
-                                               MSG_ORDERED_TAG,
-                                               tmp_sdev->queue_depth + 1);
-                               else
-                                       scsi_adjust_queue_depth(tmp_sdev,
-                                               MSG_SIMPLE_TAG,
-                                               tmp_sdev->queue_depth + 1);
+                               scsi_adjust_queue_depth(tmp_sdev,
+                                       MSG_SIMPLE_TAG,
+                                       tmp_sdev->queue_depth + 1);
 
                                itnim->last_ramp_up_time = jiffies;
                        }
index ec36b91c880f4ab609bd420949cf9c04c6f645a5..69dc166b52bc103eca106db76aa100c2d139059b 100644 (file)
@@ -1246,9 +1246,9 @@ _scsih_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
 
        if (sdev->inquiry_len > 7)
                sdev_printk(KERN_INFO, sdev, "qdepth(%d), tagged(%d), "
-               "simple(%d), ordered(%d), scsi_level(%d), cmd_que(%d)\n",
+               "simple(%d), scsi_level(%d), cmd_que(%d)\n",
                sdev->queue_depth, sdev->tagged_supported, sdev->simple_tags,
-               sdev->ordered_tags, sdev->scsi_level,
+               sdev->scsi_level,
                (sdev->inquiry[7] & 2) >> 1);
 
        return sdev->queue_depth;
@@ -3944,16 +3944,8 @@ _scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
                mpi_control = MPI2_SCSIIO_CONTROL_NODATATRANSFER;
 
        /* set tags */
-       if (!(sas_device_priv_data->flags & MPT_DEVICE_FLAGS_INIT)) {
-               if (scmd->device->tagged_supported) {
-                       if (scmd->device->ordered_tags)
-                               mpi_control |= MPI2_SCSIIO_CONTROL_ORDEREDQ;
-                       else
-                               mpi_control |= MPI2_SCSIIO_CONTROL_SIMPLEQ;
-               } else
-                       mpi_control |= MPI2_SCSIIO_CONTROL_SIMPLEQ;
-       } else
-               mpi_control |= MPI2_SCSIIO_CONTROL_SIMPLEQ;
+       mpi_control |= MPI2_SCSIIO_CONTROL_SIMPLEQ;
+
        /* Make sure Device is not raid volume.
         * We do not expose raid functionality to upper layer for warpdrive.
         */
index 52464ace282b1858b00c64ac8581ead60eb11c29..d3abf254341de748efa126d0b5372f5a28acb53e 100644 (file)
@@ -1114,9 +1114,9 @@ _scsih_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
 
        if (sdev->inquiry_len > 7)
                sdev_printk(KERN_INFO, sdev, "qdepth(%d), tagged(%d), " \
-               "simple(%d), ordered(%d), scsi_level(%d), cmd_que(%d)\n",
+               "simple(%d), scsi_level(%d), cmd_que(%d)\n",
                sdev->queue_depth, sdev->tagged_supported, sdev->simple_tags,
-               sdev->ordered_tags, sdev->scsi_level,
+               sdev->scsi_level,
                (sdev->inquiry[7] & 2) >> 1);
 
        return sdev->queue_depth;
@@ -3563,16 +3563,7 @@ _scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
                mpi_control = MPI2_SCSIIO_CONTROL_NODATATRANSFER;
 
        /* set tags */
-       if (!(sas_device_priv_data->flags & MPT_DEVICE_FLAGS_INIT)) {
-               if (scmd->device->tagged_supported) {
-                       if (scmd->device->ordered_tags)
-                               mpi_control |= MPI2_SCSIIO_CONTROL_ORDEREDQ;
-                       else
-                               mpi_control |= MPI2_SCSIIO_CONTROL_SIMPLEQ;
-               } else
-                       mpi_control |= MPI2_SCSIIO_CONTROL_SIMPLEQ;
-       } else
-               mpi_control |= MPI2_SCSIIO_CONTROL_SIMPLEQ;
+       mpi_control |= MPI2_SCSIIO_CONTROL_SIMPLEQ;
 
        if ((sas_device_priv_data->flags & MPT_DEVICE_TLR_ON) &&
            scmd->cmd_len != 32)
index 5e755747e073188601a2194b7eb728b18ebb4303..1e34fcf68e77f450595fc034172560d540588332 100644 (file)
@@ -1442,10 +1442,7 @@ static void qla2x00_adjust_sdev_qdepth_up(struct scsi_device *sdev, int qdepth)
        if (req->max_q_depth <= sdev->queue_depth || req->max_q_depth < qdepth)
                return;
 
-       if (sdev->ordered_tags)
-               scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, qdepth);
-       else
-               scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, qdepth);
+       scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, qdepth);
 
        ql_dbg(ql_dbg_io, vha, 0x302a,
            "Queue depth adjusted-up to %d for nexus=%ld:%d:%llu.\n",
index 9baeff03dd9b01e4bfa608688022f6ac2422762c..22c449e926fa9197ab0da4bbd4f1b32c4f148049 100644 (file)
@@ -789,19 +789,13 @@ void scsi_adjust_queue_depth(struct scsi_device *sdev, int tagged, int tags)
        sdev->queue_depth = tags;
        switch (tagged) {
                case 0:
-                       sdev->ordered_tags = 0;
                        sdev->simple_tags = 0;
                        break;
                case MSG_ORDERED_TAG:
-                       sdev->ordered_tags = 1;
-                       sdev->simple_tags = 1;
-                       break;
                case MSG_SIMPLE_TAG:
-                       sdev->ordered_tags = 0;
                        sdev->simple_tags = 1;
                        break;
                default:
-                       sdev->ordered_tags = 0;
                        sdev->simple_tags = 0;
                        sdev_printk(KERN_WARNING, sdev,
                                    "scsi_adjust_queue_depth, bad queue type, "
@@ -857,11 +851,8 @@ int scsi_track_queue_full(struct scsi_device *sdev, int depth)
                scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun);
                return -1;
        }
-       
-       if (sdev->ordered_tags)
-               scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, depth);
-       else
-               scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, depth);
+
+       scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, depth);
        return depth;
 }
 EXPORT_SYMBOL(scsi_track_queue_full);
index f4cb7b3e9e2350d8b12f28d366cf90ab6c552262..35d93b0af82b8163e5e9c1653689903e8814fd7c 100644 (file)
@@ -727,9 +727,7 @@ show_queue_type_field(struct device *dev, struct device_attribute *attr,
        struct scsi_device *sdev = to_scsi_device(dev);
        const char *name = "none";
 
-       if (sdev->ordered_tags)
-               name = "ordered";
-       else if (sdev->simple_tags)
+       if (sdev->simple_tags)
                name = "simple";
 
        return snprintf(buf, 20, "%s\n", name);
@@ -747,9 +745,12 @@ store_queue_type_field(struct device *dev, struct device_attribute *attr,
        if (!sdev->tagged_supported || !sht->change_queue_type)
                return -EINVAL;
 
-       if (strncmp(buf, "ordered", 7) == 0)
-               tag_type = MSG_ORDERED_TAG;
-       else if (strncmp(buf, "simple", 6) == 0)
+       /*
+        * We're never issueing order tags these days, but allow the value
+        * for backwards compatibility.
+        */
+       if (strncmp(buf, "ordered", 7) == 0 ||
+           strncmp(buf, "simple", 6) == 0)
                tag_type = MSG_SIMPLE_TAG;
        else if (strncmp(buf, "none", 4) != 0)
                return -EINVAL;
index 598f65efaaec0e725851301959d138deda7cfaa1..53a3eb6c0634ed286efa7049d1aba0785aa0d101 100644 (file)
@@ -526,9 +526,9 @@ static int pvscsi_change_queue_depth(struct scsi_device *sdev,
 
        if (sdev->inquiry_len > 7)
                sdev_printk(KERN_INFO, sdev,
-                           "qdepth(%d), tagged(%d), simple(%d), ordered(%d), scsi_level(%d), cmd_que(%d)\n",
+                           "qdepth(%d), tagged(%d), simple(%d), scsi_level(%d), cmd_que(%d)\n",
                            sdev->queue_depth, sdev->tagged_supported,
-                           sdev->simple_tags, sdev->ordered_tags,
+                           sdev->simple_tags,
                            sdev->scsi_level, (sdev->inquiry[7] & 2) >> 1);
        return sdev->queue_depth;
 }
index 3b9c76835b4525cae1f0b3c138fff3ba835303f9..e30932f989a1265523cd28a7d7d51a54f003d020 100644 (file)
@@ -135,18 +135,6 @@ static int tcm_loop_change_queue_depth(
        return sdev->queue_depth;
 }
 
-/*
- * Locate the SAM Task Attr from struct scsi_cmnd *
- */
-static int tcm_loop_sam_attr(struct scsi_cmnd *sc, int tag)
-{
-       if (sc->device->tagged_supported &&
-           sc->device->ordered_tags && tag >= 0)
-               return MSG_ORDERED_TAG;
-
-       return MSG_SIMPLE_TAG;
-}
-
 static void tcm_loop_submission_work(struct work_struct *work)
 {
        struct tcm_loop_cmd *tl_cmd =
@@ -205,7 +193,7 @@ static void tcm_loop_submission_work(struct work_struct *work)
 
        rc = target_submit_cmd_map_sgls(se_cmd, tl_nexus->se_sess, sc->cmnd,
                        &tl_cmd->tl_sense_buf[0], tl_cmd->sc->device->lun,
-                       transfer_length, tcm_loop_sam_attr(sc, tl_cmd->sc_cmd_tag),
+                       transfer_length, MSG_SIMPLE_TAG,
                        sc->sc_data_direction, 0,
                        scsi_sglist(sc), scsi_sg_count(sc),
                        sgl_bidi, sgl_bidi_count,
index 50d47e6e89d180a1a67ac4064bd6b8ffc896ac44..e8fecb5ea79ab47677f4d670c9f1644883e1197d 100644 (file)
@@ -141,7 +141,6 @@ struct scsi_device {
        unsigned ppr:1;         /* Device supports PPR messages */
        unsigned tagged_supported:1;    /* Supports SCSI-II tagged queuing */
        unsigned simple_tags:1; /* simple queue tag messages are enabled */
-       unsigned ordered_tags:1;/* ordered queue tag messages are enabled */
        unsigned was_reset:1;   /* There was a bus reset on the bus for 
                                 * this device */
        unsigned expecting_cc_ua:1; /* Expecting a CHECK_CONDITION/UNIT_ATTN
index 032df74b66d7f36e57ce0aab110e88a41e7bb47e..342f38c5b0657e558f87c57d71741fd1c3fe3da1 100644 (file)
@@ -21,17 +21,11 @@ int scsi_change_queue_type(struct scsi_device *sdev, int tag_type);
 /**
  * scsi_get_tag_type - get the type of tag the device supports
  * @sdev:      the scsi device
- *
- * Notes:
- *     If the drive only supports simple tags, returns MSG_SIMPLE_TAG
- *     if it supports all tag types, returns MSG_ORDERED_TAG.
  */
 static inline int scsi_get_tag_type(struct scsi_device *sdev)
 {
        if (!sdev->tagged_supported)
                return 0;
-       if (sdev->ordered_tags)
-               return MSG_ORDERED_TAG;
        if (sdev->simple_tags)
                return MSG_SIMPLE_TAG;
        return 0;
@@ -41,15 +35,12 @@ static inline void scsi_set_tag_type(struct scsi_device *sdev, int tag)
 {
        switch (tag) {
        case MSG_ORDERED_TAG:
-               sdev->ordered_tags = 1;
-               /* fall through */
        case MSG_SIMPLE_TAG:
                sdev->simple_tags = 1;
                break;
        case 0:
                /* fall through */
        default:
-               sdev->ordered_tags = 0;
                sdev->simple_tags = 0;
                break;
        }