aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi.c')
-rw-r--r--drivers/scsi/scsi.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index a3426f1bf0dd..106fa2f886d2 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -744,8 +744,6 @@ void scsi_finish_command(struct scsi_cmnd *cmd)
744/** 744/**
745 * scsi_adjust_queue_depth - Let low level drivers change a device's queue depth 745 * scsi_adjust_queue_depth - Let low level drivers change a device's queue depth
746 * @sdev: SCSI Device in question 746 * @sdev: SCSI Device in question
747 * @tagged: Do we use tagged queueing (non-0) or do we treat
748 * this device as an untagged device (0)
749 * @tags: Number of tags allowed if tagged queueing enabled, 747 * @tags: Number of tags allowed if tagged queueing enabled,
750 * or number of commands the low level driver can 748 * or number of commands the low level driver can
751 * queue up in non-tagged mode (as per cmd_per_lun). 749 * queue up in non-tagged mode (as per cmd_per_lun).
@@ -759,7 +757,7 @@ void scsi_finish_command(struct scsi_cmnd *cmd)
759 * currently active and whether or not it even has the 757 * currently active and whether or not it even has the
760 * command blocks built yet. 758 * command blocks built yet.
761 */ 759 */
762void scsi_adjust_queue_depth(struct scsi_device *sdev, int tagged, int tags) 760void scsi_adjust_queue_depth(struct scsi_device *sdev, int tags)
763{ 761{
764 unsigned long flags; 762 unsigned long flags;
765 763
@@ -787,20 +785,6 @@ void scsi_adjust_queue_depth(struct scsi_device *sdev, int tagged, int tags)
787 } 785 }
788 786
789 sdev->queue_depth = tags; 787 sdev->queue_depth = tags;
790 switch (tagged) {
791 case 0:
792 sdev->simple_tags = 0;
793 break;
794 case MSG_ORDERED_TAG:
795 case MSG_SIMPLE_TAG:
796 sdev->simple_tags = 1;
797 break;
798 default:
799 sdev->simple_tags = 0;
800 sdev_printk(KERN_WARNING, sdev,
801 "scsi_adjust_queue_depth, bad queue type, "
802 "disabled\n");
803 }
804 out: 788 out:
805 spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); 789 spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags);
806} 790}
@@ -848,11 +832,12 @@ int scsi_track_queue_full(struct scsi_device *sdev, int depth)
848 return 0; 832 return 0;
849 if (sdev->last_queue_full_depth < 8) { 833 if (sdev->last_queue_full_depth < 8) {
850 /* Drop back to untagged */ 834 /* Drop back to untagged */
851 scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun); 835 scsi_set_tag_type(sdev, 0);
836 scsi_adjust_queue_depth(sdev, sdev->host->cmd_per_lun);
852 return -1; 837 return -1;
853 } 838 }
854 839
855 scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, depth); 840 scsi_adjust_queue_depth(sdev, depth);
856 return depth; 841 return depth;
857} 842}
858EXPORT_SYMBOL(scsi_track_queue_full); 843EXPORT_SYMBOL(scsi_track_queue_full);
@@ -867,7 +852,7 @@ int scsi_change_queue_type(struct scsi_device *sdev, int tag_type)
867 if (!sdev->tagged_supported) 852 if (!sdev->tagged_supported)
868 return 0; 853 return 0;
869 854
870 scsi_adjust_queue_depth(sdev, tag_type, sdev->queue_depth); 855 scsi_set_tag_type(sdev, tag_type);
871 return tag_type; 856 return tag_type;
872 857
873} 858}