aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeubner, Achim <Achim_Leubner@adaptec.com>2009-04-01 10:16:08 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-04-03 10:23:11 -0400
commitd8e965076514dcb16410c0d18c6c8de4dcba19fc (patch)
tree8793c7b73c1af93200a4fe01bf6ca67c977e6c71
parentd58069adc6f59f48bf96a72e6df68a670ff1b3bc (diff)
[SCSI] aacraid driver update
changes: - set aac_cache=2 as default value to avoid performance problem (Novell bugzilla #469922) - Dell/PERC controller boot problem fixed (RedHat bugzilla #457552) - WWN flag added to fix SLES10 SP1/SP2 drive detection problems - 64-bit support changes - DECLARE_PCI_DEVICE_TABLE macro added - controller type changes Signed-off-by: Achim Leubner <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--Documentation/scsi/aacraid.txt15
-rw-r--r--drivers/scsi/aacraid/aachba.c40
-rw-r--r--drivers/scsi/aacraid/aacraid.h9
-rw-r--r--drivers/scsi/aacraid/comminit.c14
-rw-r--r--drivers/scsi/aacraid/linit.c8
5 files changed, 63 insertions, 23 deletions
diff --git a/Documentation/scsi/aacraid.txt b/Documentation/scsi/aacraid.txt
index ddace3afc83b..30f643f611b2 100644
--- a/Documentation/scsi/aacraid.txt
+++ b/Documentation/scsi/aacraid.txt
@@ -60,17 +60,9 @@ Supported Cards/Chipsets
60 9005:0285:9005:02d5 Adaptec ASR-2405 (Voodoo40 Lite) 60 9005:0285:9005:02d5 Adaptec ASR-2405 (Voodoo40 Lite)
61 9005:0285:9005:02d6 Adaptec ASR-2445 (Voodoo44 Lite) 61 9005:0285:9005:02d6 Adaptec ASR-2445 (Voodoo44 Lite)
62 9005:0285:9005:02d7 Adaptec ASR-2805 (Voodoo80 Lite) 62 9005:0285:9005:02d7 Adaptec ASR-2805 (Voodoo80 Lite)
63 9005:0285:9005:02d8 Adaptec 5405G (Voodoo40 PM) 63 9005:0285:9005:02d8 Adaptec 5405Z (Voodoo40 BLBU)
64 9005:0285:9005:02d9 Adaptec 5445G (Voodoo44 PM) 64 9005:0285:9005:02d9 Adaptec 5445Z (Voodoo44 BLBU)
65 9005:0285:9005:02da Adaptec 5805G (Voodoo80 PM) 65 9005:0285:9005:02da Adaptec 5805Z (Voodoo80 BLBU)
66 9005:0285:9005:02db Adaptec 5085G (Voodoo08 PM)
67 9005:0285:9005:02dc Adaptec 51245G (Voodoo124 PM)
68 9005:0285:9005:02dd Adaptec 51645G (Voodoo164 PM)
69 9005:0285:9005:02de Adaptec 52445G (Voodoo244 PM)
70 9005:0285:9005:02df Adaptec ASR-2045G (Voodoo04 Lite PM)
71 9005:0285:9005:02e0 Adaptec ASR-2405G (Voodoo40 Lite PM)
72 9005:0285:9005:02e1 Adaptec ASR-2445G (Voodoo44 Lite PM)
73 9005:0285:9005:02e2 Adaptec ASR-2805G (Voodoo80 Lite PM)
74 1011:0046:9005:0364 Adaptec 5400S (Mustang) 66 1011:0046:9005:0364 Adaptec 5400S (Mustang)
75 1011:0046:9005:0365 Adaptec 5400S (Mustang) 67 1011:0046:9005:0365 Adaptec 5400S (Mustang)
76 9005:0287:9005:0800 Adaptec Themisto (Jupiter) 68 9005:0287:9005:0800 Adaptec Themisto (Jupiter)
@@ -140,6 +132,7 @@ Deanna Bonds (non-DASD support, PAE fibs and 64 bit,
140 where fibs that go to the hardware are consistently called hw_fibs and 132 where fibs that go to the hardware are consistently called hw_fibs and
141 not just fibs like the name of the driver tracking structure) 133 not just fibs like the name of the driver tracking structure)
142Mark Salyzyn <Mark_Salyzyn@adaptec.com> Fixed panic issues and added some new product ids for upcoming hbas. Performance tuning, card failover and bug mitigations. 134Mark Salyzyn <Mark_Salyzyn@adaptec.com> Fixed panic issues and added some new product ids for upcoming hbas. Performance tuning, card failover and bug mitigations.
135Achim Leubner <Achim_Leubner@adaptec.com>
143 136
144Original Driver 137Original Driver
145------------------------- 138-------------------------
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 90d1d0878cb8..21964aaebca5 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -143,7 +143,7 @@ static char *aac_get_status_string(u32 status);
143 */ 143 */
144 144
145static int nondasd = -1; 145static int nondasd = -1;
146static int aac_cache; 146static int aac_cache = 2; /* WCE=0 to avoid performance problems */
147static int dacmode = -1; 147static int dacmode = -1;
148int aac_msi; 148int aac_msi;
149int aac_commit = -1; 149int aac_commit = -1;
@@ -157,7 +157,7 @@ module_param_named(cache, aac_cache, int, S_IRUGO|S_IWUSR);
157MODULE_PARM_DESC(cache, "Disable Queue Flush commands:\n" 157MODULE_PARM_DESC(cache, "Disable Queue Flush commands:\n"
158 "\tbit 0 - Disable FUA in WRITE SCSI commands\n" 158 "\tbit 0 - Disable FUA in WRITE SCSI commands\n"
159 "\tbit 1 - Disable SYNCHRONIZE_CACHE SCSI command\n" 159 "\tbit 1 - Disable SYNCHRONIZE_CACHE SCSI command\n"
160 "\tbit 2 - Disable only if Battery not protecting Cache"); 160 "\tbit 2 - Disable only if Battery is protecting Cache");
161module_param(dacmode, int, S_IRUGO|S_IWUSR); 161module_param(dacmode, int, S_IRUGO|S_IWUSR);
162MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC." 162MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC."
163 " 0=off, 1=on"); 163 " 0=off, 1=on");
@@ -217,6 +217,14 @@ int aac_reset_devices;
217module_param_named(reset_devices, aac_reset_devices, int, S_IRUGO|S_IWUSR); 217module_param_named(reset_devices, aac_reset_devices, int, S_IRUGO|S_IWUSR);
218MODULE_PARM_DESC(reset_devices, "Force an adapter reset at initialization."); 218MODULE_PARM_DESC(reset_devices, "Force an adapter reset at initialization.");
219 219
220int aac_wwn = 1;
221module_param_named(wwn, aac_wwn, int, S_IRUGO|S_IWUSR);
222MODULE_PARM_DESC(wwn, "Select a WWN type for the arrays:\n"
223 "\t0 - Disable\n"
224 "\t1 - Array Meta Data Signature (default)\n"
225 "\t2 - Adapter Serial Number");
226
227
220static inline int aac_valid_context(struct scsi_cmnd *scsicmd, 228static inline int aac_valid_context(struct scsi_cmnd *scsicmd,
221 struct fib *fibptr) { 229 struct fib *fibptr) {
222 struct scsi_device *device; 230 struct scsi_device *device;
@@ -1206,9 +1214,8 @@ static int aac_scsi_32(struct fib * fib, struct scsi_cmnd * cmd)
1206 1214
1207static int aac_scsi_32_64(struct fib * fib, struct scsi_cmnd * cmd) 1215static int aac_scsi_32_64(struct fib * fib, struct scsi_cmnd * cmd)
1208{ 1216{
1209 if ((sizeof(dma_addr_t) > 4) && 1217 if ((sizeof(dma_addr_t) > 4) && fib->dev->needs_dac &&
1210 (num_physpages > (0xFFFFFFFFULL >> PAGE_SHIFT)) && 1218 (fib->dev->adapter_info.options & AAC_OPT_SGMAP_HOST64))
1211 (fib->dev->adapter_info.options & AAC_OPT_SGMAP_HOST64))
1212 return FAILED; 1219 return FAILED;
1213 return aac_scsi_32(fib, cmd); 1220 return aac_scsi_32(fib, cmd);
1214} 1221}
@@ -1371,8 +1378,11 @@ int aac_get_adapter_info(struct aac_dev* dev)
1371 if (dev->nondasd_support && !dev->in_reset) 1378 if (dev->nondasd_support && !dev->in_reset)
1372 printk(KERN_INFO "%s%d: Non-DASD support enabled.\n",dev->name, dev->id); 1379 printk(KERN_INFO "%s%d: Non-DASD support enabled.\n",dev->name, dev->id);
1373 1380
1381 if (dma_get_required_mask(&dev->pdev->dev) > DMA_32BIT_MASK)
1382 dev->needs_dac = 1;
1374 dev->dac_support = 0; 1383 dev->dac_support = 0;
1375 if( (sizeof(dma_addr_t) > 4) && (dev->adapter_info.options & AAC_OPT_SGMAP_HOST64)){ 1384 if ((sizeof(dma_addr_t) > 4) && dev->needs_dac &&
1385 (dev->adapter_info.options & AAC_OPT_SGMAP_HOST64)) {
1376 if (!dev->in_reset) 1386 if (!dev->in_reset)
1377 printk(KERN_INFO "%s%d: 64bit support enabled.\n", 1387 printk(KERN_INFO "%s%d: 64bit support enabled.\n",
1378 dev->name, dev->id); 1388 dev->name, dev->id);
@@ -1382,6 +1392,15 @@ int aac_get_adapter_info(struct aac_dev* dev)
1382 if(dacmode != -1) { 1392 if(dacmode != -1) {
1383 dev->dac_support = (dacmode!=0); 1393 dev->dac_support = (dacmode!=0);
1384 } 1394 }
1395
1396 /* avoid problems with AAC_QUIRK_SCSI_32 controllers */
1397 if (dev->dac_support && (aac_get_driver_ident(dev->cardtype)->quirks
1398 & AAC_QUIRK_SCSI_32)) {
1399 dev->nondasd_support = 0;
1400 dev->jbod = 0;
1401 expose_physicals = 0;
1402 }
1403
1385 if(dev->dac_support != 0) { 1404 if(dev->dac_support != 0) {
1386 if (!pci_set_dma_mask(dev->pdev, DMA_64BIT_MASK) && 1405 if (!pci_set_dma_mask(dev->pdev, DMA_64BIT_MASK) &&
1387 !pci_set_consistent_dma_mask(dev->pdev, DMA_64BIT_MASK)) { 1406 !pci_set_consistent_dma_mask(dev->pdev, DMA_64BIT_MASK)) {
@@ -2058,7 +2077,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
2058 dprintk((KERN_DEBUG "INQUIRY command, ID: %d.\n", cid)); 2077 dprintk((KERN_DEBUG "INQUIRY command, ID: %d.\n", cid));
2059 memset(&inq_data, 0, sizeof (struct inquiry_data)); 2078 memset(&inq_data, 0, sizeof (struct inquiry_data));
2060 2079
2061 if (scsicmd->cmnd[1] & 0x1) { 2080 if ((scsicmd->cmnd[1] & 0x1) && aac_wwn) {
2062 char *arr = (char *)&inq_data; 2081 char *arr = (char *)&inq_data;
2063 2082
2064 /* EVPD bit set */ 2083 /* EVPD bit set */
@@ -2081,7 +2100,12 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
2081 arr[1] = scsicmd->cmnd[2]; 2100 arr[1] = scsicmd->cmnd[2];
2082 scsi_sg_copy_from_buffer(scsicmd, &inq_data, 2101 scsi_sg_copy_from_buffer(scsicmd, &inq_data,
2083 sizeof(inq_data)); 2102 sizeof(inq_data));
2084 return aac_get_container_serial(scsicmd); 2103 if (aac_wwn != 2)
2104 return aac_get_container_serial(
2105 scsicmd);
2106 /* SLES 10 SP1 special */
2107 scsicmd->result = DID_OK << 16 |
2108 COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
2085 } else { 2109 } else {
2086 /* vpd page not implemented */ 2110 /* vpd page not implemented */
2087 scsicmd->result = DID_OK << 16 | 2111 scsicmd->result = DID_OK << 16 |
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 73916adb8f80..cdbdec9f4fb2 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -12,7 +12,7 @@
12 *----------------------------------------------------------------------------*/ 12 *----------------------------------------------------------------------------*/
13 13
14#ifndef AAC_DRIVER_BUILD 14#ifndef AAC_DRIVER_BUILD
15# define AAC_DRIVER_BUILD 2456 15# define AAC_DRIVER_BUILD 2461
16# define AAC_DRIVER_BRANCH "-ms" 16# define AAC_DRIVER_BRANCH "-ms"
17#endif 17#endif
18#define MAXIMUM_NUM_CONTAINERS 32 18#define MAXIMUM_NUM_CONTAINERS 32
@@ -865,7 +865,11 @@ struct aac_supplement_adapter_info
865 u8 MfgPcbaSerialNo[12]; 865 u8 MfgPcbaSerialNo[12];
866 u8 MfgWWNName[8]; 866 u8 MfgWWNName[8];
867 __le32 SupportedOptions2; 867 __le32 SupportedOptions2;
868 __le32 ReservedGrowth[1]; 868 __le32 StructExpansion;
869 /* StructExpansion == 1 */
870 __le32 FeatureBits3;
871 __le32 SupportedPerformanceModes;
872 __le32 ReservedForFutureGrowth[80];
869}; 873};
870#define AAC_FEATURE_FALCON cpu_to_le32(0x00000010) 874#define AAC_FEATURE_FALCON cpu_to_le32(0x00000010)
871#define AAC_FEATURE_JBOD cpu_to_le32(0x08000000) 875#define AAC_FEATURE_JBOD cpu_to_le32(0x08000000)
@@ -1020,6 +1024,7 @@ struct aac_dev
1020 u8 jbod; 1024 u8 jbod;
1021 u8 cache_protected; 1025 u8 cache_protected;
1022 u8 dac_support; 1026 u8 dac_support;
1027 u8 needs_dac;
1023 u8 raid_scsi_mode; 1028 u8 raid_scsi_mode;
1024 u8 comm_interface; 1029 u8 comm_interface;
1025# define AAC_COMM_PRODUCER 0 1030# define AAC_COMM_PRODUCER 0
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
index 16310443b55a..d598eba630d0 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -54,6 +54,7 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
54 const unsigned long printfbufsiz = 256; 54 const unsigned long printfbufsiz = 256;
55 struct aac_init *init; 55 struct aac_init *init;
56 dma_addr_t phys; 56 dma_addr_t phys;
57 unsigned long aac_max_hostphysmempages;
57 58
58 size = fibsize + sizeof(struct aac_init) + commsize + commalign + printfbufsiz; 59 size = fibsize + sizeof(struct aac_init) + commsize + commalign + printfbufsiz;
59 60
@@ -90,7 +91,18 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
90 init->AdapterFibsPhysicalAddress = cpu_to_le32((u32)phys); 91 init->AdapterFibsPhysicalAddress = cpu_to_le32((u32)phys);
91 init->AdapterFibsSize = cpu_to_le32(fibsize); 92 init->AdapterFibsSize = cpu_to_le32(fibsize);
92 init->AdapterFibAlign = cpu_to_le32(sizeof(struct hw_fib)); 93 init->AdapterFibAlign = cpu_to_le32(sizeof(struct hw_fib));
93 init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES); 94 /*
95 * number of 4k pages of host physical memory. The aacraid fw needs
96 * this number to be less than 4gb worth of pages. New firmware doesn't
97 * have any issues with the mapping system, but older Firmware did, and
98 * had *troubles* dealing with the math overloading past 32 bits, thus
99 * we must limit this field.
100 */
101 aac_max_hostphysmempages = dma_get_required_mask(&dev->pdev->dev) >> 12;
102 if (aac_max_hostphysmempages < AAC_MAX_HOSTPHYSMEMPAGES)
103 init->HostPhysMemPages = cpu_to_le32(aac_max_hostphysmempages);
104 else
105 init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES);
94 106
95 init->InitFlags = 0; 107 init->InitFlags = 0;
96 if (dev->comm_interface == AAC_COMM_MESSAGE) { 108 if (dev->comm_interface == AAC_COMM_MESSAGE) {
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 36d8aab97efe..c507719c0d44 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -86,7 +86,13 @@ char aac_driver_version[] = AAC_DRIVER_FULL_VERSION;
86 * 86 *
87 * Note: The last field is used to index into aac_drivers below. 87 * Note: The last field is used to index into aac_drivers below.
88 */ 88 */
89static struct pci_device_id aac_pci_tbl[] = { 89#ifdef DECLARE_PCI_DEVICE_TABLE
90static DECLARE_PCI_DEVICE_TABLE(aac_pci_tbl) = {
91#elif defined(__devinitconst)
92static const struct pci_device_id aac_pci_tbl[] __devinitconst = {
93#else
94static const struct pci_device_id aac_pci_tbl[] __devinitdata = {
95#endif
90 { 0x1028, 0x0001, 0x1028, 0x0001, 0, 0, 0 }, /* PERC 2/Si (Iguana/PERC2Si) */ 96 { 0x1028, 0x0001, 0x1028, 0x0001, 0, 0, 0 }, /* PERC 2/Si (Iguana/PERC2Si) */
91 { 0x1028, 0x0002, 0x1028, 0x0002, 0, 0, 1 }, /* PERC 3/Di (Opal/PERC3Di) */ 97 { 0x1028, 0x0002, 0x1028, 0x0002, 0, 0, 1 }, /* PERC 3/Di (Opal/PERC3Di) */
92 { 0x1028, 0x0003, 0x1028, 0x0003, 0, 0, 2 }, /* PERC 3/Si (SlimFast/PERC3Si */ 98 { 0x1028, 0x0003, 0x1028, 0x0003, 0, 0, 2 }, /* PERC 3/Si (SlimFast/PERC3Si */