aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ibmvscsi/ibmvscsi.c
diff options
context:
space:
mode:
authorBrian King <brking@linux.vnet.ibm.com>2008-12-08 18:01:47 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-12-29 12:24:32 -0500
commit21465eda9eafa275ed11c27779d90aa95559b6f6 (patch)
treea81d4873e80ca93d3ecf8eac17e9c149c3a4cd58 /drivers/scsi/ibmvscsi/ibmvscsi.c
parent4d3fef9e69ac002f7531c377970449d1154fe884 (diff)
[SCSI] ibmvscsi: Don't fail EH due to insufficient resources
The ibmvscsi driver currently has a bug in it which can result in it using up all its event structs for commands. If something results in all those commands timing out, we won't have any resources left to send aborts or resets. This results in escalating to a host reset in order to recover, which is a bit heavy handed. This fixes it by reducing can_queue by two in order to have resources to do EH. It also changes the max_requests module parameter so that it is not writable at runtime, since the code really does not handle it changing at runtime. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/ibmvscsi/ibmvscsi.c')
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 6cad1758243a..868d35ea01bb 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -107,7 +107,7 @@ module_param_named(max_channel, max_channel, int, S_IRUGO | S_IWUSR);
107MODULE_PARM_DESC(max_channel, "Largest channel value"); 107MODULE_PARM_DESC(max_channel, "Largest channel value");
108module_param_named(init_timeout, init_timeout, int, S_IRUGO | S_IWUSR); 108module_param_named(init_timeout, init_timeout, int, S_IRUGO | S_IWUSR);
109MODULE_PARM_DESC(init_timeout, "Initialization timeout in seconds"); 109MODULE_PARM_DESC(init_timeout, "Initialization timeout in seconds");
110module_param_named(max_requests, max_requests, int, S_IRUGO | S_IWUSR); 110module_param_named(max_requests, max_requests, int, S_IRUGO);
111MODULE_PARM_DESC(max_requests, "Maximum requests for this adapter"); 111MODULE_PARM_DESC(max_requests, "Maximum requests for this adapter");
112 112
113/* ------------------------------------------------------------ 113/* ------------------------------------------------------------
@@ -1657,7 +1657,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
1657 1657
1658 vdev->dev.driver_data = NULL; 1658 vdev->dev.driver_data = NULL;
1659 1659
1660 driver_template.can_queue = max_requests; 1660 driver_template.can_queue = max_requests - 2;
1661 host = scsi_host_alloc(&driver_template, sizeof(*hostdata)); 1661 host = scsi_host_alloc(&driver_template, sizeof(*hostdata));
1662 if (!host) { 1662 if (!host) {
1663 dev_err(&vdev->dev, "couldn't allocate host data\n"); 1663 dev_err(&vdev->dev, "couldn't allocate host data\n");