aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBrian King <brking@linux.vnet.ibm.com>2007-03-29 13:42:40 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-04-01 12:15:26 -0400
commit5469cb5bdef76dbe18865fff30975f0694fff2c2 (patch)
treed6b596eb15bfbd247f40fbaff9da3aaaf6098f3e /drivers
parent0979c84b4affaf924a894380dd0069638b64de03 (diff)
[SCSI] ipr: Make adapter operational timeout be per adapter type
Some ipr adapters may take longer than others to come operational. This patch makes this timeout different for different adapters, while still preserving the module parameter which can be used to globally override the default. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/ipr.c29
-rw-r--r--drivers/scsi/ipr.h5
2 files changed, 26 insertions, 8 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 95045e33710d..ba17ac501278 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -89,7 +89,7 @@ static unsigned int ipr_log_level = IPR_DEFAULT_LOG_LEVEL;
89static unsigned int ipr_max_speed = 1; 89static unsigned int ipr_max_speed = 1;
90static int ipr_testmode = 0; 90static int ipr_testmode = 0;
91static unsigned int ipr_fastfail = 0; 91static unsigned int ipr_fastfail = 0;
92static unsigned int ipr_transop_timeout = IPR_OPERATIONAL_TIMEOUT; 92static unsigned int ipr_transop_timeout = 0;
93static unsigned int ipr_enable_cache = 1; 93static unsigned int ipr_enable_cache = 1;
94static unsigned int ipr_debug = 0; 94static unsigned int ipr_debug = 0;
95static int ipr_auto_create = 1; 95static int ipr_auto_create = 1;
@@ -6187,7 +6187,7 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd)
6187 dev_info(&ioa_cfg->pdev->dev, "Initializing IOA.\n"); 6187 dev_info(&ioa_cfg->pdev->dev, "Initializing IOA.\n");
6188 6188
6189 ipr_cmd->timer.data = (unsigned long) ipr_cmd; 6189 ipr_cmd->timer.data = (unsigned long) ipr_cmd;
6190 ipr_cmd->timer.expires = jiffies + (ipr_transop_timeout * HZ); 6190 ipr_cmd->timer.expires = jiffies + (ioa_cfg->transop_timeout * HZ);
6191 ipr_cmd->timer.function = (void (*)(unsigned long))ipr_oper_timeout; 6191 ipr_cmd->timer.function = (void (*)(unsigned long))ipr_oper_timeout;
6192 ipr_cmd->done = ipr_reset_ioa_job; 6192 ipr_cmd->done = ipr_reset_ioa_job;
6193 add_timer(&ipr_cmd->timer); 6193 add_timer(&ipr_cmd->timer);
@@ -7232,6 +7232,13 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev,
7232 goto out_scsi_host_put; 7232 goto out_scsi_host_put;
7233 } 7233 }
7234 7234
7235 if (ipr_transop_timeout)
7236 ioa_cfg->transop_timeout = ipr_transop_timeout;
7237 else if (dev_id->driver_data & IPR_USE_LONG_TRANSOP_TIMEOUT)
7238 ioa_cfg->transop_timeout = IPR_LONG_OPERATIONAL_TIMEOUT;
7239 else
7240 ioa_cfg->transop_timeout = IPR_OPERATIONAL_TIMEOUT;
7241
7235 ipr_regs_pci = pci_resource_start(pdev, 0); 7242 ipr_regs_pci = pci_resource_start(pdev, 0);
7236 7243
7237 rc = pci_request_regions(pdev, IPR_NAME); 7244 rc = pci_request_regions(pdev, IPR_NAME);
@@ -7539,29 +7546,35 @@ static struct pci_device_id ipr_pci_table[] __devinitdata = {
7539 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, 7546 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE,
7540 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571A, 0, 0, 0 }, 7547 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571A, 0, 0, 0 },
7541 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, 7548 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE,
7542 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575B, 0, 0, 0 }, 7549 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575B, 0, 0,
7550 IPR_USE_LONG_TRANSOP_TIMEOUT },
7543 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN, 7551 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN,
7544 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572A, 0, 0, 0 }, 7552 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572A, 0, 0, 0 },
7545 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN, 7553 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN,
7546 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572B, 0, 0, 0 }, 7554 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572B, 0, 0, 0 },
7547 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN, 7555 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN,
7548 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575C, 0, 0, 0 }, 7556 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575C, 0, 0,
7557 IPR_USE_LONG_TRANSOP_TIMEOUT },
7549 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN, 7558 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN,
7550 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572A, 0, 0, 0 }, 7559 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572A, 0, 0, 0 },
7551 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN, 7560 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN,
7552 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572B, 0, 0, 0 }, 7561 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572B, 0, 0, 0 },
7553 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN, 7562 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN,
7554 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575C, 0, 0, 0 }, 7563 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575C, 0, 0,
7564 IPR_USE_LONG_TRANSOP_TIMEOUT },
7555 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN_E, 7565 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN_E,
7556 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_57B7, 0, 0, 0 }, 7566 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_57B7, 0, 0,
7567 IPR_USE_LONG_TRANSOP_TIMEOUT },
7557 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE, 7568 { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE,
7558 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_2780, 0, 0, 0 }, 7569 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_2780, 0, 0, 0 },
7559 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, 7570 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP,
7560 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571E, 0, 0, 0 }, 7571 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571E, 0, 0, 0 },
7561 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, 7572 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP,
7562 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571F, 0, 0, 0 }, 7573 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571F, 0, 0,
7574 IPR_USE_LONG_TRANSOP_TIMEOUT },
7563 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, 7575 { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP,
7564 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572F, 0, 0, 0 }, 7576 PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572F, 0, 0,
7577 IPR_USE_LONG_TRANSOP_TIMEOUT },
7565 { } 7578 { }
7566}; 7579};
7567MODULE_DEVICE_TABLE(pci, ipr_pci_table); 7580MODULE_DEVICE_TABLE(pci, ipr_pci_table);
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 88f285de97bb..c83ccbb24983 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -104,6 +104,9 @@
104#define IPR_IOASC_IOA_WAS_RESET 0x10000001 104#define IPR_IOASC_IOA_WAS_RESET 0x10000001
105#define IPR_IOASC_PCI_ACCESS_ERROR 0x10000002 105#define IPR_IOASC_PCI_ACCESS_ERROR 0x10000002
106 106
107/* Driver data flags */
108#define IPR_USE_LONG_TRANSOP_TIMEOUT 0x00000001
109
107#define IPR_DEFAULT_MAX_ERROR_DUMP 984 110#define IPR_DEFAULT_MAX_ERROR_DUMP 984
108#define IPR_NUM_LOG_HCAMS 2 111#define IPR_NUM_LOG_HCAMS 2
109#define IPR_NUM_CFG_CHG_HCAMS 2 112#define IPR_NUM_CFG_CHG_HCAMS 2
@@ -179,6 +182,7 @@
179#define IPR_SET_SUP_DEVICE_TIMEOUT (2 * 60 * HZ) 182#define IPR_SET_SUP_DEVICE_TIMEOUT (2 * 60 * HZ)
180#define IPR_REQUEST_SENSE_TIMEOUT (10 * HZ) 183#define IPR_REQUEST_SENSE_TIMEOUT (10 * HZ)
181#define IPR_OPERATIONAL_TIMEOUT (5 * 60) 184#define IPR_OPERATIONAL_TIMEOUT (5 * 60)
185#define IPR_LONG_OPERATIONAL_TIMEOUT (12 * 60)
182#define IPR_WAIT_FOR_RESET_TIMEOUT (2 * HZ) 186#define IPR_WAIT_FOR_RESET_TIMEOUT (2 * HZ)
183#define IPR_CHECK_FOR_RESET_TIMEOUT (HZ / 10) 187#define IPR_CHECK_FOR_RESET_TIMEOUT (HZ / 10)
184#define IPR_WAIT_FOR_BIST_TIMEOUT (2 * HZ) 188#define IPR_WAIT_FOR_BIST_TIMEOUT (2 * HZ)
@@ -1119,6 +1123,7 @@ struct ipr_ioa_cfg {
1119 1123
1120 struct ipr_bus_attributes bus_attr[IPR_MAX_NUM_BUSES]; 1124 struct ipr_bus_attributes bus_attr[IPR_MAX_NUM_BUSES];
1121 1125
1126 unsigned int transop_timeout;
1122 const struct ipr_chip_cfg_t *chip_cfg; 1127 const struct ipr_chip_cfg_t *chip_cfg;
1123 1128
1124 void __iomem *hdw_dma_regs; /* iomapped PCI memory space */ 1129 void __iomem *hdw_dma_regs; /* iomapped PCI memory space */