The value of the parameter is never re-read by the driver,
so a new value is ignored. Let know the user he
can't modify it by removing writable attribute.
Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Brian King <[email protected]>
Acked-by: Tyrel Datwyler <[email protected]>
---
drivers/scsi/ibmvscsi/ibmvscsi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 6a41c36..3e76490 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -105,9 +105,9 @@ MODULE_AUTHOR("Dave Boutcher");
MODULE_LICENSE("GPL");
MODULE_VERSION(IBMVSCSI_VERSION);
-module_param_named(max_id, max_id, int, S_IRUGO | S_IWUSR);
+module_param_named(max_id, max_id, int, S_IRUGO);
MODULE_PARM_DESC(max_id, "Largest ID value for each channel");
-module_param_named(max_channel, max_channel, int, S_IRUGO | S_IWUSR);
+module_param_named(max_channel, max_channel, int, S_IRUGO);
MODULE_PARM_DESC(max_channel, "Largest channel value");
module_param_named(init_timeout, init_timeout, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(init_timeout, "Initialization timeout in seconds");
--
2.1.0
As devices with values greater than that are silently ignored,
this gives some hints to the sys admin to know why he doesn't see
his devices...
Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Brian King <[email protected]>
Acked-by: Tyrel Datwyler <[email protected]>
---
drivers/scsi/ibmvscsi/ibmvscsi.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 3e76490..f9d7ec4 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -106,9 +106,9 @@ MODULE_LICENSE("GPL");
MODULE_VERSION(IBMVSCSI_VERSION);
module_param_named(max_id, max_id, int, S_IRUGO);
-MODULE_PARM_DESC(max_id, "Largest ID value for each channel");
+MODULE_PARM_DESC(max_id, "Largest ID value for each channel [Default=64]");
module_param_named(max_channel, max_channel, int, S_IRUGO);
-MODULE_PARM_DESC(max_channel, "Largest channel value");
+MODULE_PARM_DESC(max_channel, "Largest channel value [Default=3]");
module_param_named(init_timeout, init_timeout, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(init_timeout, "Initialization timeout in seconds");
module_param_named(max_requests, max_requests, int, S_IRUGO);
@@ -2294,6 +2294,10 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
host->max_channel = max_channel;
host->max_cmd_len = 16;
+ dev_info(dev,
+ "Maximum ID: %d Maximum LUN: %d Maximum Channel: %d\n",
+ host->max_id, host->max_lun, host->max_channel);
+
if (scsi_add_host(hostdata->host, hostdata->dev))
goto add_host_failed;
--
2.1.0
QEMU allows until 32 LUNs.
Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Brian King <[email protected]>
Acked-by: Tyrel Datwyler <[email protected]>
---
drivers/scsi/ibmvscsi/ibmvscsi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index f9d7ec4..e5478b0 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -84,6 +84,7 @@
*/
static int max_id = 64;
static int max_channel = 3;
+static int max_lun = 8;
static int init_timeout = 300;
static int login_timeout = 60;
static int info_timeout = 30;
@@ -117,6 +118,8 @@ module_param_named(fast_fail, fast_fail, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(fast_fail, "Enable fast fail. [Default=1]");
module_param_named(client_reserve, client_reserve, int, S_IRUGO );
MODULE_PARM_DESC(client_reserve, "Attempt client managed reserve/release");
+module_param(max_lun, int, S_IRUGO);
+MODULE_PARM_DESC(max_lun, "Maximum LUN value [Default=8]");
static void ibmvscsi_handle_crq(struct viosrp_crq *crq,
struct ibmvscsi_host_data *hostdata);
@@ -2289,7 +2292,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
goto init_pool_failed;
}
- host->max_lun = 8;
+ host->max_lun = max_lun;
host->max_id = max_id;
host->max_channel = max_channel;
host->max_cmd_len = 16;
--
2.1.0
Hi Laurent,
[auto build test WARNING on scsi/for-next]
[also WARNING on: v4.3 next-20151103]
url: https://github.com/0day-ci/linux/commits/Laurent-Vivier/ibmvscsi-make-parameters-max_id-and-max_channel-read-only/20151103-223706
base: https://github.com/0day-ci/linux Laurent-Vivier/ibmvscsi-make-parameters-max_id-and-max_channel-read-only/20151103-223706
config: powerpc-defconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=powerpc
All warnings (new ones prefixed by >>):
In file included from include/linux/dma-mapping.h:5:0,
from drivers/scsi/ibmvscsi/ibmvscsi.c:65:
drivers/scsi/ibmvscsi/ibmvscsi.c: In function 'ibmvscsi_probe':
>> drivers/scsi/ibmvscsi/ibmvscsi.c:2298:4: warning: format '%d' expects argument of type 'int', but argument 4 has type 'u64 {aka long long unsigned int}' [-Wformat=]
"Maximum ID: %d Maximum LUN: %d Maximum Channel: %d\n",
^
include/linux/device.h:1166:51: note: in definition of macro 'dev_info'
#define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
^
vim +2298 drivers/scsi/ibmvscsi/ibmvscsi.c
2282 rc = ibmvscsi_init_crq_queue(&hostdata->queue, hostdata, max_events);
2283 if (rc != 0 && rc != H_RESOURCE) {
2284 dev_err(&vdev->dev, "couldn't initialize crq. rc=%d\n", rc);
2285 goto kill_kthread;
2286 }
2287 if (initialize_event_pool(&hostdata->pool, max_events, hostdata) != 0) {
2288 dev_err(&vdev->dev, "couldn't initialize event pool\n");
2289 goto init_pool_failed;
2290 }
2291
2292 host->max_lun = 8;
2293 host->max_id = max_id;
2294 host->max_channel = max_channel;
2295 host->max_cmd_len = 16;
2296
2297 dev_info(dev,
> 2298 "Maximum ID: %d Maximum LUN: %d Maximum Channel: %d\n",
2299 host->max_id, host->max_lun, host->max_channel);
2300
2301 if (scsi_add_host(hostdata->host, hostdata->dev))
2302 goto add_host_failed;
2303
2304 /* we don't have a proper target_port_id so let's use the fake one */
2305 memcpy(ids.port_id, hostdata->madapter_info.partition_name,
2306 sizeof(ids.port_id));
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation