Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Leubner, Achim and committed by
James Bottomley
d8e96507 d58069ad

+63 -23
+4 -11
Documentation/scsi/aacraid.txt
··· 60 60 9005:0285:9005:02d5 Adaptec ASR-2405 (Voodoo40 Lite) 61 61 9005:0285:9005:02d6 Adaptec ASR-2445 (Voodoo44 Lite) 62 62 9005:0285:9005:02d7 Adaptec ASR-2805 (Voodoo80 Lite) 63 - 9005:0285:9005:02d8 Adaptec 5405G (Voodoo40 PM) 64 - 9005:0285:9005:02d9 Adaptec 5445G (Voodoo44 PM) 65 - 9005:0285:9005:02da Adaptec 5805G (Voodoo80 PM) 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) 63 + 9005:0285:9005:02d8 Adaptec 5405Z (Voodoo40 BLBU) 64 + 9005:0285:9005:02d9 Adaptec 5445Z (Voodoo44 BLBU) 65 + 9005:0285:9005:02da Adaptec 5805Z (Voodoo80 BLBU) 74 66 1011:0046:9005:0364 Adaptec 5400S (Mustang) 75 67 1011:0046:9005:0365 Adaptec 5400S (Mustang) 76 68 9005:0287:9005:0800 Adaptec Themisto (Jupiter) ··· 132 140 where fibs that go to the hardware are consistently called hw_fibs and 133 141 not just fibs like the name of the driver tracking structure) 134 142 Mark Salyzyn <Mark_Salyzyn@adaptec.com> Fixed panic issues and added some new product ids for upcoming hbas. Performance tuning, card failover and bug mitigations. 143 + Achim Leubner <Achim_Leubner@adaptec.com> 135 144 136 145 Original Driver 137 146 -------------------------
+32 -8
drivers/scsi/aacraid/aachba.c
··· 143 143 */ 144 144 145 145 static int nondasd = -1; 146 - static int aac_cache; 146 + static int aac_cache = 2; /* WCE=0 to avoid performance problems */ 147 147 static int dacmode = -1; 148 148 int aac_msi; 149 149 int aac_commit = -1; ··· 157 157 MODULE_PARM_DESC(cache, "Disable Queue Flush commands:\n" 158 158 "\tbit 0 - Disable FUA in WRITE SCSI commands\n" 159 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"); 161 161 module_param(dacmode, int, S_IRUGO|S_IWUSR); 162 162 MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC." 163 163 " 0=off, 1=on"); ··· 216 216 int aac_reset_devices; 217 217 module_param_named(reset_devices, aac_reset_devices, int, S_IRUGO|S_IWUSR); 218 218 MODULE_PARM_DESC(reset_devices, "Force an adapter reset at initialization."); 219 + 220 + int aac_wwn = 1; 221 + module_param_named(wwn, aac_wwn, int, S_IRUGO|S_IWUSR); 222 + MODULE_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 + 219 227 220 228 static inline int aac_valid_context(struct scsi_cmnd *scsicmd, 221 229 struct fib *fibptr) { ··· 1214 1206 1215 1207 static int aac_scsi_32_64(struct fib * fib, struct scsi_cmnd * cmd) 1216 1208 { 1217 - if ((sizeof(dma_addr_t) > 4) && 1218 - (num_physpages > (0xFFFFFFFFULL >> PAGE_SHIFT)) && 1219 - (fib->dev->adapter_info.options & AAC_OPT_SGMAP_HOST64)) 1209 + if ((sizeof(dma_addr_t) > 4) && fib->dev->needs_dac && 1210 + (fib->dev->adapter_info.options & AAC_OPT_SGMAP_HOST64)) 1220 1211 return FAILED; 1221 1212 return aac_scsi_32(fib, cmd); 1222 1213 } ··· 1378 1371 if (dev->nondasd_support && !dev->in_reset) 1379 1372 printk(KERN_INFO "%s%d: Non-DASD support enabled.\n",dev->name, dev->id); 1380 1373 1374 + if (dma_get_required_mask(&dev->pdev->dev) > DMA_32BIT_MASK) 1375 + dev->needs_dac = 1; 1381 1376 dev->dac_support = 0; 1382 - if( (sizeof(dma_addr_t) > 4) && (dev->adapter_info.options & AAC_OPT_SGMAP_HOST64)){ 1377 + if ((sizeof(dma_addr_t) > 4) && dev->needs_dac && 1378 + (dev->adapter_info.options & AAC_OPT_SGMAP_HOST64)) { 1383 1379 if (!dev->in_reset) 1384 1380 printk(KERN_INFO "%s%d: 64bit support enabled.\n", 1385 1381 dev->name, dev->id); ··· 1392 1382 if(dacmode != -1) { 1393 1383 dev->dac_support = (dacmode!=0); 1394 1384 } 1385 + 1386 + /* avoid problems with AAC_QUIRK_SCSI_32 controllers */ 1387 + if (dev->dac_support && (aac_get_driver_ident(dev->cardtype)->quirks 1388 + & AAC_QUIRK_SCSI_32)) { 1389 + dev->nondasd_support = 0; 1390 + dev->jbod = 0; 1391 + expose_physicals = 0; 1392 + } 1393 + 1395 1394 if(dev->dac_support != 0) { 1396 1395 if (!pci_set_dma_mask(dev->pdev, DMA_64BIT_MASK) && 1397 1396 !pci_set_consistent_dma_mask(dev->pdev, DMA_64BIT_MASK)) { ··· 2077 2058 dprintk((KERN_DEBUG "INQUIRY command, ID: %d.\n", cid)); 2078 2059 memset(&inq_data, 0, sizeof (struct inquiry_data)); 2079 2060 2080 - if (scsicmd->cmnd[1] & 0x1) { 2061 + if ((scsicmd->cmnd[1] & 0x1) && aac_wwn) { 2081 2062 char *arr = (char *)&inq_data; 2082 2063 2083 2064 /* EVPD bit set */ ··· 2100 2081 arr[1] = scsicmd->cmnd[2]; 2101 2082 scsi_sg_copy_from_buffer(scsicmd, &inq_data, 2102 2083 sizeof(inq_data)); 2103 - return aac_get_container_serial(scsicmd); 2084 + if (aac_wwn != 2) 2085 + return aac_get_container_serial( 2086 + scsicmd); 2087 + /* SLES 10 SP1 special */ 2088 + scsicmd->result = DID_OK << 16 | 2089 + COMMAND_COMPLETE << 8 | SAM_STAT_GOOD; 2104 2090 } else { 2105 2091 /* vpd page not implemented */ 2106 2092 scsicmd->result = DID_OK << 16 |
+7 -2
drivers/scsi/aacraid/aacraid.h
··· 12 12 *----------------------------------------------------------------------------*/ 13 13 14 14 #ifndef AAC_DRIVER_BUILD 15 - # define AAC_DRIVER_BUILD 2456 15 + # define AAC_DRIVER_BUILD 2461 16 16 # define AAC_DRIVER_BRANCH "-ms" 17 17 #endif 18 18 #define MAXIMUM_NUM_CONTAINERS 32 ··· 865 865 u8 MfgPcbaSerialNo[12]; 866 866 u8 MfgWWNName[8]; 867 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 874 #define AAC_FEATURE_FALCON cpu_to_le32(0x00000010) 871 875 #define AAC_FEATURE_JBOD cpu_to_le32(0x08000000) ··· 1024 1020 u8 jbod; 1025 1021 u8 cache_protected; 1026 1022 u8 dac_support; 1023 + u8 needs_dac; 1027 1024 u8 raid_scsi_mode; 1028 1025 u8 comm_interface; 1029 1026 # define AAC_COMM_PRODUCER 0
+13 -1
drivers/scsi/aacraid/comminit.c
··· 54 54 const unsigned long printfbufsiz = 256; 55 55 struct aac_init *init; 56 56 dma_addr_t phys; 57 + unsigned long aac_max_hostphysmempages; 57 58 58 59 size = fibsize + sizeof(struct aac_init) + commsize + commalign + printfbufsiz; 59 60 ··· 91 90 init->AdapterFibsPhysicalAddress = cpu_to_le32((u32)phys); 92 91 init->AdapterFibsSize = cpu_to_le32(fibsize); 93 92 init->AdapterFibAlign = cpu_to_le32(sizeof(struct hw_fib)); 94 - init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES); 93 + /* 94 + * number of 4k pages of host physical memory. The aacraid fw needs 95 + * this number to be less than 4gb worth of pages. New firmware doesn't 96 + * have any issues with the mapping system, but older Firmware did, and 97 + * had *troubles* dealing with the math overloading past 32 bits, thus 98 + * we must limit this field. 99 + */ 100 + aac_max_hostphysmempages = dma_get_required_mask(&dev->pdev->dev) >> 12; 101 + if (aac_max_hostphysmempages < AAC_MAX_HOSTPHYSMEMPAGES) 102 + init->HostPhysMemPages = cpu_to_le32(aac_max_hostphysmempages); 103 + else 104 + init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES); 95 105 96 106 init->InitFlags = 0; 97 107 if (dev->comm_interface == AAC_COMM_MESSAGE) {
+7 -1
drivers/scsi/aacraid/linit.c
··· 86 86 * 87 87 * Note: The last field is used to index into aac_drivers below. 88 88 */ 89 - static struct pci_device_id aac_pci_tbl[] = { 89 + #ifdef DECLARE_PCI_DEVICE_TABLE 90 + static DECLARE_PCI_DEVICE_TABLE(aac_pci_tbl) = { 91 + #elif defined(__devinitconst) 92 + static const struct pci_device_id aac_pci_tbl[] __devinitconst = { 93 + #else 94 + static const struct pci_device_id aac_pci_tbl[] __devinitdata = { 95 + #endif 90 96 { 0x1028, 0x0001, 0x1028, 0x0001, 0, 0, 0 }, /* PERC 2/Si (Iguana/PERC2Si) */ 91 97 { 0x1028, 0x0002, 0x1028, 0x0002, 0, 0, 1 }, /* PERC 3/Di (Opal/PERC3Di) */ 92 98 { 0x1028, 0x0003, 0x1028, 0x0003, 0, 0, 2 }, /* PERC 3/Si (SlimFast/PERC3Si */