scsi: drop reason argument from ->change_queue_depth
[firefly-linux-kernel-4.4.55.git] / drivers / scsi / mpt3sas / mpt3sas_scsih.c
index 857276b8880f4b94e8578bdc237cc9683d180c29..de175b9915e2f96093e7fadaa42aea9d48627391 100644 (file)
@@ -1090,61 +1090,31 @@ _scsih_adjust_queue_depth(struct scsi_device *sdev, int qdepth)
                max_depth = 1;
        if (qdepth > max_depth)
                qdepth = max_depth;
-       scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), qdepth);
+       scsi_change_queue_depth(sdev, qdepth);
 }
 
 /**
  * _scsih_change_queue_depth - setting device queue depth
  * @sdev: scsi device struct
  * @qdepth: requested queue depth
- * @reason: SCSI_QDEPTH_DEFAULT/SCSI_QDEPTH_QFULL/SCSI_QDEPTH_RAMP_UP
- * (see include/scsi/scsi_host.h for definition)
  *
  * Returns queue depth.
  */
 static int
-_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth, int reason)
+_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth)
 {
-       if (reason == SCSI_QDEPTH_DEFAULT || reason == SCSI_QDEPTH_RAMP_UP)
-               _scsih_adjust_queue_depth(sdev, qdepth);
-       else if (reason == SCSI_QDEPTH_QFULL)
-               scsi_track_queue_full(sdev, qdepth);
-       else
-               return -EOPNOTSUPP;
+       _scsih_adjust_queue_depth(sdev, qdepth);
 
        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;
 }
 
-/**
- * _scsih_change_queue_type - changing device queue tag type
- * @sdev: scsi device struct
- * @tag_type: requested tag type
- *
- * Returns queue tag type.
- */
-static int
-_scsih_change_queue_type(struct scsi_device *sdev, int tag_type)
-{
-       if (sdev->tagged_supported) {
-               scsi_set_tag_type(sdev, tag_type);
-               if (tag_type)
-                       scsi_activate_tcq(sdev, sdev->queue_depth);
-               else
-                       scsi_deactivate_tcq(sdev, sdev->queue_depth);
-       } else
-               tag_type = 0;
-
-       return tag_type;
-}
-
-
 /**
  * _scsih_target_alloc - target add routine
  * @starget: scsi target struct
@@ -1762,7 +1732,7 @@ _scsih_slave_configure(struct scsi_device *sdev)
                         raid_device->num_pds, ds);
 
 
-               _scsih_change_queue_depth(sdev, qdepth, SCSI_QDEPTH_DEFAULT);
+               _scsih_change_queue_depth(sdev, qdepth);
 
 /* raid transport support */
                _scsih_set_level(sdev, raid_device->volume_type);
@@ -1828,7 +1798,7 @@ _scsih_slave_configure(struct scsi_device *sdev)
                _scsih_display_sata_capabilities(ioc, handle, sdev);
 
 
-       _scsih_change_queue_depth(sdev, qdepth, SCSI_QDEPTH_DEFAULT);
+       _scsih_change_queue_depth(sdev, qdepth);
 
        if (ssp_target) {
                sas_read_port_mode_page(sdev);
@@ -3586,16 +3556,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)
@@ -7284,7 +7245,7 @@ static struct scsi_host_template scsih_driver_template = {
        .scan_finished                  = _scsih_scan_finished,
        .scan_start                     = _scsih_scan_start,
        .change_queue_depth             = _scsih_change_queue_depth,
-       .change_queue_type              = _scsih_change_queue_type,
+       .change_queue_type              = scsi_change_queue_type,
        .eh_abort_handler               = _scsih_abort,
        .eh_device_reset_handler        = _scsih_dev_reset,
        .eh_target_reset_handler        = _scsih_target_reset,
@@ -7298,6 +7259,7 @@ static struct scsi_host_template scsih_driver_template = {
        .use_clustering                 = ENABLE_CLUSTERING,
        .shost_attrs                    = mpt3sas_host_attrs,
        .sdev_attrs                     = mpt3sas_dev_attrs,
+       .track_queue_depth              = 1,
 };
 
 /**