Commit 4b2f57e5 authored by Nicholas Bellinger's avatar Nicholas Bellinger

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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 43cf208c
...@@ -767,12 +767,6 @@ int se_dev_set_emulate_fua_write(struct se_device *dev, int flag) ...@@ -767,12 +767,6 @@ int se_dev_set_emulate_fua_write(struct se_device *dev, int flag)
pr_err("Illegal value %d\n", flag); pr_err("Illegal value %d\n", flag);
return -EINVAL; return -EINVAL;
} }
if (flag &&
dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
pr_err("emulate_fua_write not supported for pSCSI\n");
return -EINVAL;
}
dev->dev_attrib.emulate_fua_write = flag; dev->dev_attrib.emulate_fua_write = flag;
pr_debug("dev[%p]: SE Device Forced Unit Access WRITEs: %d\n", pr_debug("dev[%p]: SE Device Forced Unit Access WRITEs: %d\n",
dev, dev->dev_attrib.emulate_fua_write); dev, dev->dev_attrib.emulate_fua_write);
...@@ -802,11 +796,6 @@ int se_dev_set_emulate_write_cache(struct se_device *dev, int flag) ...@@ -802,11 +796,6 @@ int se_dev_set_emulate_write_cache(struct se_device *dev, int flag)
pr_err("Illegal value %d\n", flag); pr_err("Illegal value %d\n", flag);
return -EINVAL; return -EINVAL;
} }
if (flag &&
dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
pr_err("emulate_write_cache not supported for pSCSI\n");
return -EINVAL;
}
if (flag && if (flag &&
dev->transport->get_write_cache) { dev->transport->get_write_cache) {
pr_err("emulate_write_cache not supported for this device\n"); pr_err("emulate_write_cache not supported for this device\n");
...@@ -1098,15 +1087,6 @@ int se_dev_set_queue_depth(struct se_device *dev, u32 queue_depth) ...@@ -1098,15 +1087,6 @@ int se_dev_set_queue_depth(struct se_device *dev, u32 queue_depth)
return -EINVAL; return -EINVAL;
} }
if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
if (queue_depth > dev->dev_attrib.hw_queue_depth) {
pr_err("dev[%p]: Passed queue_depth: %u"
" exceeds TCM/SE_Device TCQ: %u\n",
dev, queue_depth,
dev->dev_attrib.hw_queue_depth);
return -EINVAL;
}
} else {
if (queue_depth > dev->dev_attrib.queue_depth) { if (queue_depth > dev->dev_attrib.queue_depth) {
if (queue_depth > dev->dev_attrib.hw_queue_depth) { if (queue_depth > dev->dev_attrib.hw_queue_depth) {
pr_err("dev[%p]: Passed queue_depth:" pr_err("dev[%p]: Passed queue_depth:"
...@@ -1116,8 +1096,6 @@ int se_dev_set_queue_depth(struct se_device *dev, u32 queue_depth) ...@@ -1116,8 +1096,6 @@ int se_dev_set_queue_depth(struct se_device *dev, u32 queue_depth)
return -EINVAL; return -EINVAL;
} }
} }
}
dev->dev_attrib.queue_depth = dev->queue_depth = queue_depth; dev->dev_attrib.queue_depth = dev->queue_depth = queue_depth;
pr_debug("dev[%p]: SE Device TCQ Depth changed to: %u\n", pr_debug("dev[%p]: SE Device TCQ Depth changed to: %u\n",
dev, queue_depth); dev, queue_depth);
...@@ -1146,15 +1124,6 @@ int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors) ...@@ -1146,15 +1124,6 @@ int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors)
DA_STATUS_MAX_SECTORS_MIN); DA_STATUS_MAX_SECTORS_MIN);
return -EINVAL; return -EINVAL;
} }
if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
if (fabric_max_sectors > dev->dev_attrib.hw_max_sectors) {
pr_err("dev[%p]: Passed fabric_max_sectors: %u"
" greater than TCM/SE_Device max_sectors:"
" %u\n", dev, fabric_max_sectors,
dev->dev_attrib.hw_max_sectors);
return -EINVAL;
}
} else {
if (fabric_max_sectors > DA_STATUS_MAX_SECTORS_MAX) { if (fabric_max_sectors > DA_STATUS_MAX_SECTORS_MAX) {
pr_err("dev[%p]: Passed fabric_max_sectors: %u" pr_err("dev[%p]: Passed fabric_max_sectors: %u"
" greater than DA_STATUS_MAX_SECTORS_MAX:" " greater than DA_STATUS_MAX_SECTORS_MAX:"
...@@ -1162,7 +1131,6 @@ int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors) ...@@ -1162,7 +1131,6 @@ int se_dev_set_fabric_max_sectors(struct se_device *dev, u32 fabric_max_sectors)
DA_STATUS_MAX_SECTORS_MAX); DA_STATUS_MAX_SECTORS_MAX);
return -EINVAL; return -EINVAL;
} }
}
/* /*
* Align max_sectors down to PAGE_SIZE to follow transport_allocate_data_tasks() * 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,11 +1156,6 @@ int se_dev_set_optimal_sectors(struct se_device *dev, u32 optimal_sectors)
dev, dev->export_count); dev, dev->export_count);
return -EINVAL; return -EINVAL;
} }
if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
pr_err("dev[%p]: Passed optimal_sectors cannot be"
" changed for TCM/pSCSI\n", dev);
return -EINVAL;
}
if (optimal_sectors > dev->dev_attrib.fabric_max_sectors) { if (optimal_sectors > dev->dev_attrib.fabric_max_sectors) {
pr_err("dev[%p]: Passed optimal_sectors %u cannot be" pr_err("dev[%p]: Passed optimal_sectors %u cannot be"
" greater than fabric_max_sectors: %u\n", dev, " 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,13 +1189,6 @@ int se_dev_set_block_size(struct se_device *dev, u32 block_size)
return -EINVAL; return -EINVAL;
} }
if (dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
pr_err("dev[%p]: Not allowed to change block_size for"
" Physical Device, use for Linux/SCSI to change"
" block_size for underlying hardware\n", dev);
return -EINVAL;
}
dev->dev_attrib.block_size = block_size; dev->dev_attrib.block_size = block_size;
pr_debug("dev[%p]: SE Device block_size changed to %u\n", pr_debug("dev[%p]: SE Device block_size changed to %u\n",
dev, block_size); dev, block_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment