aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_device.c
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2014-11-28 00:39:12 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2014-12-02 00:36:21 -0500
commit4b2f57e5ced40e91cbf8886d7dc40a9474d2f5c0 (patch)
tree0d8cc01a5aa5940e2ad6113b9798134c548ad612 /drivers/target/target_core_device.c
parent43cf208cbe2080ff0212bd3527d915395b6129f6 (diff)
target: Drop left-over PHBA_PDEV set attr checks
Now that PSCSI is only exposing four hw_* read-only device attributes, go ahead and drop the left-over -> legacy PHBA_PDEV checks in various se_dev_set_* code, since it's now only used by virtual devices. Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_device.c')
-rw-r--r--drivers/target/target_core_device.c64
1 files changed, 10 insertions, 54 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 953fff79bc14..7653cfb027a2 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -767,12 +767,6 @@ int se_dev_set_emulate_fua_write(struct se_device *dev, int flag)
767 pr_err("Illegal value %d\n", flag); 767 pr_err("Illegal value %d\n", flag);
768 return -EINVAL; 768 return -EINVAL;
769 } 769 }
770
771 if (flag &&
772 dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
773 pr_err("emulate_fua_write not supported for pSCSI\n");
774 return -EINVAL;
775 }
776 dev->dev_attrib.emulate_fua_write = flag; 770 dev->dev_attrib.emulate_fua_write = flag;
777 pr_debug("dev[%p]: SE Device Forced Unit Access WRITEs: %d\n", 771 pr_debug("dev[%p]: SE Device Forced Unit Access WRITEs: %d\n",
778 dev, dev->dev_attrib.emulate_fua_write); 772 dev, dev->dev_attrib.emulate_fua_write);
@@ -803,11 +797,6 @@ int se_dev_set_emulate_write_cache(struct se_device *dev, int flag)
803 return -EINVAL; 797 return -EINVAL;
804 } 798 }
805 if (flag && 799 if (flag &&
806 dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
807 pr_err("emulate_write_cache not supported for pSCSI\n");
808 return -EINVAL;
809 }
810 if (flag &&
811 dev->transport->get_write_cache) { 800 dev->transport->get_write_cache) {
812 pr_err("emulate_write_cache not supported for this device\n"); 801 pr_err("emulate_write_cache not supported for this device\n");
813 return -EINVAL; 802 return -EINVAL;
@@ -1098,26 +1087,15 @@ int se_dev_set_queue_depth(struct se_device *dev, u32 queue_depth)
1098 return -EINVAL; 1087 return -EINVAL;
1099 } 1088 }
1100 1089
1101 if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) { 1090 if (queue_depth > dev->dev_attrib.queue_depth) {
1102 if (queue_depth > dev->dev_attrib.hw_queue_depth) { 1091 if (queue_depth > dev->dev_attrib.hw_queue_depth) {
1103 pr_err("dev[%p]: Passed queue_depth: %u" 1092 pr_err("dev[%p]: Passed queue_depth:"
1104 " exceeds TCM/SE_Device TCQ: %u\n", 1093 " %u exceeds TCM/SE_Device MAX"
1105 dev, queue_depth, 1094 " TCQ: %u\n", dev, queue_depth,
1106 dev->dev_attrib.hw_queue_depth); 1095 dev->dev_attrib.hw_queue_depth);
1107 return -EINVAL; 1096 return -EINVAL;
1108 } 1097 }
1109 } else {
1110 if (queue_depth > dev->dev_attrib.queue_depth) {
1111 if (queue_depth > dev->dev_attrib.hw_queue_depth) {
1112 pr_err("dev[%p]: Passed queue_depth:"
1113 " %u exceeds TCM/SE_Device MAX"
1114 " TCQ: %u\n", dev, queue_depth,
1115 dev->dev_attrib.hw_queue_depth);
1116 return -EINVAL;
1117 }
1118 }
1119 } 1098 }
1120
1121 dev->dev_attrib.queue_depth = dev->queue_depth = queue_depth; 1099 dev->dev_attrib.queue_depth = dev->queue_depth = queue_depth;
1122 pr_debug("dev[%p]: SE Device TCQ Depth changed to: %u\n", 1100 pr_debug("dev[%p]: SE Device TCQ Depth changed to: %u\n",
1123 dev, queue_depth); 1101 dev, queue_depth);
@@ -1146,22 +1124,12 @@ int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors)
1146 DA_STATUS_MAX_SECTORS_MIN); 1124 DA_STATUS_MAX_SECTORS_MIN);
1147 return -EINVAL; 1125 return -EINVAL;
1148 } 1126 }
1149 if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) { 1127 if (fabric_max_sectors > DA_STATUS_MAX_SECTORS_MAX) {
1150 if (fabric_max_sectors > dev->dev_attrib.hw_max_sectors) { 1128 pr_err("dev[%p]: Passed fabric_max_sectors: %u"
1151 pr_err("dev[%p]: Passed fabric_max_sectors: %u" 1129 " greater than DA_STATUS_MAX_SECTORS_MAX:"
1152 " greater than TCM/SE_Device max_sectors:" 1130 " %u\n", dev, fabric_max_sectors,
1153 " %u\n", dev, fabric_max_sectors, 1131 DA_STATUS_MAX_SECTORS_MAX);
1154 dev->dev_attrib.hw_max_sectors); 1132 return -EINVAL;
1155 return -EINVAL;
1156 }
1157 } else {
1158 if (fabric_max_sectors > DA_STATUS_MAX_SECTORS_MAX) {
1159 pr_err("dev[%p]: Passed fabric_max_sectors: %u"
1160 " greater than DA_STATUS_MAX_SECTORS_MAX:"
1161 " %u\n", dev, fabric_max_sectors,
1162 DA_STATUS_MAX_SECTORS_MAX);
1163 return -EINVAL;
1164 }
1165 } 1133 }
1166 /* 1134 /*
1167 * Align max_sectors down to PAGE_SIZE to follow transport_allocate_data_tasks() 1135 * Align max_sectors down to PAGE_SIZE to follow transport_allocate_data_tasks()
@@ -1188,11 +1156,6 @@ int se_dev_set_optimal_sectors(struct se_device *dev, u32 optimal_sectors)
1188 dev, dev->export_count); 1156 dev, dev->export_count);
1189 return -EINVAL; 1157 return -EINVAL;
1190 } 1158 }
1191 if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
1192 pr_err("dev[%p]: Passed optimal_sectors cannot be"
1193 " changed for TCM/pSCSI\n", dev);
1194 return -EINVAL;
1195 }
1196 if (optimal_sectors > dev->dev_attrib.fabric_max_sectors) { 1159 if (optimal_sectors > dev->dev_attrib.fabric_max_sectors) {
1197 pr_err("dev[%p]: Passed optimal_sectors %u cannot be" 1160 pr_err("dev[%p]: Passed optimal_sectors %u cannot be"
1198 " greater than fabric_max_sectors: %u\n", dev, 1161 " greater than fabric_max_sectors: %u\n", dev,
@@ -1226,13 +1189,6 @@ int se_dev_set_block_size(struct se_device *dev, u32 block_size)
1226 return -EINVAL; 1189 return -EINVAL;
1227 } 1190 }
1228 1191
1229 if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
1230 pr_err("dev[%p]: Not allowed to change block_size for"
1231 " Physical Device, use for Linux/SCSI to change"
1232 " block_size for underlying hardware\n", dev);
1233 return -EINVAL;
1234 }
1235
1236 dev->dev_attrib.block_size = block_size; 1192 dev->dev_attrib.block_size = block_size;
1237 pr_debug("dev[%p]: SE Device block_size changed to %u\n", 1193 pr_debug("dev[%p]: SE Device block_size changed to %u\n",
1238 dev, block_size); 1194 dev, block_size);