Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6:
ide: make legacy IDE VLB modules check for the "probe" kernel params (v2)
ide: remove some obsoleted kernel params (v2)
ide/pci/delkin_cb.c: pci_module_init to pci_register_driver
scc_pata: bugfix for checking DMA IRQ status
ide: remove a ton of pointless #undef REALLY_SLOW_IO
siimage: DRAC4 note
adjust legacy IDE resource setting (v2)
ide: fix pmac breakage
ide-cs: Update device table
ide: ide_get_best_pio_mode() returns incorrect IORDY setting (take 2)
piix/slc90e66: more tuneproc() fixing (take 2)
ide: fix drive side 80c cable check, take 2
cmd64x: fix PIO mode setup (take 3)
alim15x3: fix PIO mode setup

+306 -224
+12 -17
Documentation/ide.txt
··· 232 232 233 233 "hdx=remap63" : remap the drive: add 63 to all sector numbers 234 234 (for DM OnTrack) 235 - 235 + 236 + "idex=noautotune" : driver will NOT attempt to tune interface speed 237 + 236 238 "hdx=autotune" : driver will attempt to tune interface speed 237 239 to the fastest PIO mode supported, 238 240 if possible for this drive only. ··· 269 267 "idex=base,ctl" : specify both base and ctl 270 268 271 269 "idex=base,ctl,irq" : specify base, ctl, and irq number 272 - 273 - "idex=autotune" : driver will attempt to tune interface speed 274 - to the fastest PIO mode supported, 275 - for all drives on this interface. 276 - Not fully supported by all chipset types, 277 - and quite likely to cause trouble with 278 - older/odd IDE drives. 279 - 280 - "idex=noautotune" : driver will NOT attempt to tune interface speed 281 - This is the default for most chipsets, 282 - except the cmd640. 283 270 284 271 "idex=serialize" : do not overlap operations on idex. Please note 285 272 that you will have to specify this option for ··· 294 303 to the first ATA interface found on the particular host, and the defaults for 295 304 the base,ctl ports must not be altered. 296 305 297 - "ide0=dtc2278" : probe/support DTC2278 interface 298 - "ide0=ht6560b" : probe/support HT6560B interface 299 306 "ide0=cmd640_vlb" : *REQUIRED* for VLB cards with the CMD640 chip 300 307 (not for PCI -- automatically detected) 301 - "ide0=qd65xx" : probe/support qd65xx interface 302 - "ide0=ali14xx" : probe/support ali14xx chipsets (ALI M1439/M1443/M1445) 303 - "ide0=umc8672" : probe/support umc8672 chipsets 304 308 305 309 "ide=doubler" : probe/support IDE doublers on Amiga 306 310 307 311 There may be more options than shown -- use the source, Luke! 308 312 309 313 Everything else is rejected with a "BAD OPTION" message. 314 + 315 + For legacy IDE VLB host drivers (ali14xx/dtc2278/ht6560b/qd65xx/umc8672) 316 + you need to explicitly enable probing by using "probe" kernel parameter, 317 + i.e. to enable probing for ALI M14xx chipsets (ali14xx host driver) use: 318 + 319 + * "ali14xx.probe" boot option when ali14xx driver is built-in the kernel 320 + 321 + * "probe" module parameter when ali14xx driver is compiled as module 322 + ("modprobe ali14xx probe") 310 323 311 324 ================================================================================ 312 325
+5 -5
drivers/ide/Kconfig
··· 1023 1023 config BLK_DEV_ALI14XX 1024 1024 tristate "ALI M14xx support" 1025 1025 help 1026 - This driver is enabled at runtime using the "ide0=ali14xx" kernel 1026 + This driver is enabled at runtime using the "ali14xx.probe" kernel 1027 1027 boot parameter. It enables support for the secondary IDE interface 1028 1028 of the ALI M1439/1443/1445/1487/1489 chipsets, and permits faster 1029 1029 I/O speeds to be set as well. See the files ··· 1033 1033 config BLK_DEV_DTC2278 1034 1034 tristate "DTC-2278 support" 1035 1035 help 1036 - This driver is enabled at runtime using the "ide0=dtc2278" kernel 1036 + This driver is enabled at runtime using the "dtc2278.probe" kernel 1037 1037 boot parameter. It enables support for the secondary IDE interface 1038 1038 of the DTC-2278 card, and permits faster I/O speeds to be set as 1039 1039 well. See the <file:Documentation/ide.txt> and ··· 1042 1042 config BLK_DEV_HT6560B 1043 1043 tristate "Holtek HT6560B support" 1044 1044 help 1045 - This driver is enabled at runtime using the "ide0=ht6560b" kernel 1045 + This driver is enabled at runtime using the "ht6560b.probe" kernel 1046 1046 boot parameter. It enables support for the secondary IDE interface 1047 1047 of the Holtek card, and permits faster I/O speeds to be set as well. 1048 1048 See the <file:Documentation/ide.txt> and ··· 1051 1051 config BLK_DEV_QD65XX 1052 1052 tristate "QDI QD65xx support" 1053 1053 help 1054 - This driver is enabled at runtime using the "ide0=qd65xx" kernel 1054 + This driver is enabled at runtime using the "qd65xx.probe" kernel 1055 1055 boot parameter. It permits faster I/O speeds to be set. See the 1056 1056 <file:Documentation/ide.txt> and <file:drivers/ide/legacy/qd65xx.c> for 1057 1057 more info. ··· 1059 1059 config BLK_DEV_UMC8672 1060 1060 tristate "UMC-8672 support" 1061 1061 help 1062 - This driver is enabled at runtime using the "ide0=umc8672" kernel 1062 + This driver is enabled at runtime using the "umc8672.probe" kernel 1063 1063 boot parameter. It enables support for the secondary IDE interface 1064 1064 of the UMC-8672, and permits faster I/O speeds to be set as well. 1065 1065 See the files <file:Documentation/ide.txt> and
-2
drivers/ide/cris/ide-cris.c
··· 17 17 * device can't do DMA handshaking for some stupid reason. We don't need to do that. 18 18 */ 19 19 20 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 21 - 22 20 #include <linux/types.h> 23 21 #include <linux/kernel.h> 24 22 #include <linux/timer.h>
-2
drivers/ide/ide-disk.c
··· 43 43 44 44 #define IDEDISK_VERSION "1.18" 45 45 46 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 47 - 48 46 //#define DEBUG 49 47 50 48 #include <linux/module.h>
+2
drivers/ide/ide-iops.c
··· 583 583 if(!(drive->id->hw_config & 0x4000)) 584 584 return 0; 585 585 #endif /* CONFIG_IDEDMA_IVB */ 586 + if (!(drive->id->hw_config & 0x2000)) 587 + return 0; 586 588 return 1; 587 589 } 588 590
+6 -12
drivers/ide/ide-lib.c
··· 345 345 346 346 /** 347 347 * ide_get_best_pio_mode - get PIO mode from drive 348 - * @driver: drive to consider 348 + * @drive: drive to consider 349 349 * @mode_wanted: preferred mode 350 - * @max_mode: highest allowed 351 - * @d: pio data 350 + * @max_mode: highest allowed mode 351 + * @d: PIO data 352 352 * 353 353 * This routine returns the recommended PIO settings for a given drive, 354 354 * based on the drive->id information and the ide_pio_blacklist[]. 355 - * This is used by most chipset support modules when "auto-tuning". 356 355 * 357 - * Drive PIO mode auto selection 356 + * Drive PIO mode is auto-selected if 255 is passed as mode_wanted. 357 + * This is used by most chipset support modules when "auto-tuning". 358 358 */ 359 359 360 360 u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d) ··· 367 367 368 368 if (mode_wanted != 255) { 369 369 pio_mode = mode_wanted; 370 + use_iordy = (pio_mode > 2); 370 371 } else if (!drive->id) { 371 372 pio_mode = 0; 372 373 } else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) { ··· 397 396 } 398 397 } 399 398 400 - #if 0 401 - if (drive->id->major_rev_num & 0x0004) printk("ATA-2 "); 402 - #endif 403 - 404 399 /* 405 400 * Conservative "downgrade" for all pre-ATA2 drives 406 401 */ 407 402 if (pio_mode && pio_mode < 4) { 408 403 pio_mode--; 409 404 overridden = 1; 410 - #if 0 411 - use_iordy = (pio_mode > 2); 412 - #endif 413 405 if (cycle_time && cycle_time < ide_pio_timings[pio_mode].cycle_time) 414 406 cycle_time = 0; /* use standard timing */ 415 407 }
-2
drivers/ide/ide-probe.c
··· 31 31 * valid after probe time even with noprobe 32 32 */ 33 33 34 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 35 - 36 34 #include <linux/module.h> 37 35 #include <linux/types.h> 38 36 #include <linux/string.h>
+15 -24
drivers/ide/ide.c
··· 126 126 #define REVISION "Revision: 7.00alpha2" 127 127 #define VERSION "Id: ide.c 7.00a2 20020906" 128 128 129 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 130 - 131 129 #define _IDE_C /* Tell ide.h it's really us */ 132 130 133 131 #include <linux/module.h> ··· 1484 1486 } 1485 1487 1486 1488 #ifdef CONFIG_BLK_DEV_ALI14XX 1487 - static int __initdata probe_ali14xx; 1489 + extern int probe_ali14xx; 1488 1490 extern int ali14xx_init(void); 1489 1491 #endif 1490 1492 #ifdef CONFIG_BLK_DEV_UMC8672 1491 - static int __initdata probe_umc8672; 1493 + extern int probe_umc8672; 1492 1494 extern int umc8672_init(void); 1493 1495 #endif 1494 1496 #ifdef CONFIG_BLK_DEV_DTC2278 1495 - static int __initdata probe_dtc2278; 1497 + extern int probe_dtc2278; 1496 1498 extern int dtc2278_init(void); 1497 1499 #endif 1498 1500 #ifdef CONFIG_BLK_DEV_HT6560B 1499 - static int __initdata probe_ht6560b; 1501 + extern int probe_ht6560b; 1500 1502 extern int ht6560b_init(void); 1501 1503 #endif 1502 1504 #ifdef CONFIG_BLK_DEV_QD65XX 1503 - static int __initdata probe_qd65xx; 1505 + extern int probe_qd65xx; 1504 1506 extern int qd65xx_init(void); 1505 1507 #endif 1506 1508 ··· 1578 1580 */ 1579 1581 if (s[0] == 'h' && s[1] == 'd' && s[2] >= 'a' && s[2] <= max_drive) { 1580 1582 const char *hd_words[] = { 1581 - "none", "noprobe", "nowerr", "cdrom", "serialize", 1583 + "none", "noprobe", "nowerr", "cdrom", "minus5", 1582 1584 "autotune", "noautotune", "minus8", "swapdata", "bswap", 1583 1585 "noflush", "remap", "remap63", "scsi", NULL }; 1584 1586 unit = s[2] - 'a'; ··· 1606 1608 drive->ready_stat = 0; 1607 1609 hwif->noprobe = 0; 1608 1610 goto done; 1609 - case -5: /* "serialize" */ 1610 - printk(" -- USE \"ide%d=serialize\" INSTEAD", hw); 1611 - goto do_serialize; 1612 1611 case -6: /* "autotune" */ 1613 1612 drive->autotune = IDE_TUNE_AUTO; 1614 1613 goto obsolete_option; ··· 1666 1671 * (-8, -9, -10) are reserved to ease the hardcoding. 1667 1672 */ 1668 1673 static const char *ide_words[] = { 1669 - "noprobe", "serialize", "autotune", "noautotune", 1674 + "noprobe", "serialize", "minus3", "minus4", 1670 1675 "reset", "dma", "ata66", "minus8", "minus9", 1671 1676 "minus10", "four", "qd65xx", "ht6560b", "cmd640_vlb", 1672 1677 "dtc2278", "umc8672", "ali14xx", NULL }; ··· 1737 1742 hwif->chipset = mate->chipset = ide_4drives; 1738 1743 mate->irq = hwif->irq; 1739 1744 memcpy(mate->io_ports, hwif->io_ports, sizeof(hwif->io_ports)); 1740 - goto do_serialize; 1745 + hwif->mate = mate; 1746 + mate->mate = hwif; 1747 + hwif->serialized = mate->serialized = 1; 1748 + goto obsolete_option; 1741 1749 } 1742 1750 #endif /* CONFIG_BLK_DEV_4DRIVES */ 1743 1751 case -10: /* minus10 */ 1744 1752 case -9: /* minus9 */ 1745 1753 case -8: /* minus8 */ 1754 + case -4: 1755 + case -3: 1746 1756 goto bad_option; 1747 1757 case -7: /* ata66 */ 1748 1758 #ifdef CONFIG_BLK_DEV_IDEPCI ··· 1762 1762 case -5: /* "reset" */ 1763 1763 hwif->reset = 1; 1764 1764 goto obsolete_option; 1765 - case -4: /* "noautotune" */ 1766 - hwif->drives[0].autotune = IDE_TUNE_NOAUTO; 1767 - hwif->drives[1].autotune = IDE_TUNE_NOAUTO; 1768 - goto obsolete_option; 1769 - case -3: /* "autotune" */ 1770 - hwif->drives[0].autotune = IDE_TUNE_AUTO; 1771 - hwif->drives[1].autotune = IDE_TUNE_AUTO; 1772 - goto obsolete_option; 1773 1765 case -2: /* "serialize" */ 1774 - do_serialize: 1775 1766 hwif->mate = &ide_hwifs[hw^1]; 1776 1767 hwif->mate->mate = hwif; 1777 1768 hwif->serialized = hwif->mate->serialized = 1; ··· 1831 1840 #endif /* CONFIG_BLK_DEV_CMD640 */ 1832 1841 #ifdef CONFIG_BLK_DEV_IDE_PMAC 1833 1842 { 1834 - extern void pmac_ide_probe(void); 1835 - pmac_ide_probe(); 1843 + extern int pmac_ide_probe(void); 1844 + (void)pmac_ide_probe(); 1836 1845 } 1837 1846 #endif /* CONFIG_BLK_DEV_IDE_PMAC */ 1838 1847 #ifdef CONFIG_BLK_DEV_GAYLE
+9 -2
drivers/ide/legacy/ali14xx.c
··· 37 37 * mode 4 for a while now with no trouble.) -Derek 38 38 */ 39 39 40 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 41 - 42 40 #include <linux/module.h> 43 41 #include <linux/types.h> 44 42 #include <linux/kernel.h> ··· 228 230 return 0; 229 231 } 230 232 233 + int probe_ali14xx = 0; 234 + 235 + module_param_named(probe, probe_ali14xx, bool, 0); 236 + MODULE_PARM_DESC(probe, "probe for ALI M14xx chipsets"); 237 + 231 238 /* Can be called directly from ide.c. */ 232 239 int __init ali14xx_init(void) 233 240 { 241 + if (probe_ali14xx == 0) 242 + goto out; 243 + 234 244 /* auto-detect IDE controller port */ 235 245 if (findPort()) { 236 246 if (ali14xx_probe()) ··· 246 240 return 0; 247 241 } 248 242 printk(KERN_ERR "ali14xx: not found.\n"); 243 + out: 249 244 return -ENODEV; 250 245 } 251 246
+10 -4
drivers/ide/legacy/dtc2278.c
··· 4 4 * Copyright (C) 1996 Linus Torvalds & author (see below) 5 5 */ 6 6 7 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 8 - 9 7 #include <linux/module.h> 10 8 #include <linux/types.h> 11 9 #include <linux/kernel.h> ··· 92 94 HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1; 93 95 } 94 96 95 - static int __init probe_dtc2278(void) 97 + static int __init dtc2278_probe(void) 96 98 { 97 99 unsigned long flags; 98 100 ide_hwif_t *hwif, *mate; ··· 143 145 return 0; 144 146 } 145 147 148 + int probe_dtc2278 = 0; 149 + 150 + module_param_named(probe, probe_dtc2278, bool, 0); 151 + MODULE_PARM_DESC(probe, "probe for DTC2278xx chipsets"); 152 + 146 153 /* Can be called directly from ide.c. */ 147 154 int __init dtc2278_init(void) 148 155 { 149 - if (probe_dtc2278()) { 156 + if (probe_dtc2278 == 0) 157 + return -ENODEV; 158 + 159 + if (dtc2278_probe()) { 150 160 printk(KERN_ERR "dtc2278: ide interfaces already in use!\n"); 151 161 return -EBUSY; 152 162 }
+8 -2
drivers/ide/legacy/ht6560b.c
··· 36 36 37 37 #define HT6560B_VERSION "v0.07" 38 38 39 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 40 - 41 39 #include <linux/module.h> 42 40 #include <linux/types.h> 43 41 #include <linux/kernel.h> ··· 301 303 #endif 302 304 } 303 305 306 + int probe_ht6560b = 0; 307 + 308 + module_param_named(probe, probe_ht6560b, bool, 0); 309 + MODULE_PARM_DESC(probe, "probe for HT6560B chipset"); 310 + 304 311 /* Can be called directly from ide.c. */ 305 312 int __init ht6560b_init(void) 306 313 { 307 314 ide_hwif_t *hwif, *mate; 308 315 int t; 316 + 317 + if (probe_ht6560b == 0) 318 + return -ENODEV; 309 319 310 320 hwif = &ide_hwifs[0]; 311 321 mate = &ide_hwifs[1];
+5 -2
drivers/ide/legacy/ide-cs.c
··· 359 359 static struct pcmcia_device_id ide_ids[] = { 360 360 PCMCIA_DEVICE_FUNC_ID(4), 361 361 PCMCIA_DEVICE_MANF_CARD(0x0007, 0x0000), /* Hitachi */ 362 + PCMCIA_DEVICE_MANF_CARD(0x000a, 0x0000), /* I-O Data CFA */ 363 + PCMCIA_DEVICE_MANF_CARD(0x001c, 0x0001), /* Mitsubishi CFA */ 362 364 PCMCIA_DEVICE_MANF_CARD(0x0032, 0x0704), 363 - PCMCIA_DEVICE_MANF_CARD(0x0045, 0x0401), 365 + PCMCIA_DEVICE_MANF_CARD(0x0045, 0x0401), /* SanDisk CFA */ 364 366 PCMCIA_DEVICE_MANF_CARD(0x0098, 0x0000), /* Toshiba */ 365 367 PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d), 366 368 PCMCIA_DEVICE_MANF_CARD(0x00ce, 0x0000), /* Samsung */ 367 369 PCMCIA_DEVICE_MANF_CARD(0x0319, 0x0000), /* Hitachi */ 368 370 PCMCIA_DEVICE_MANF_CARD(0x2080, 0x0001), 369 - PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0200), /* Lexar */ 371 + PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0100), /* Viking CFA */ 372 + PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0200), /* Lexar, Viking CFA */ 370 373 PCMCIA_DEVICE_PROD_ID123("Caravelle", "PSC-IDE ", "PSC000", 0x8c36137c, 0xd0693ab8, 0x2768a9f0), 371 374 PCMCIA_DEVICE_PROD_ID123("CDROM", "IDE", "MCD-601p", 0x1b9179ca, 0xede88951, 0x0d902f74), 372 375 PCMCIA_DEVICE_PROD_ID123("PCMCIA", "IDE CARD", "F1", 0x281f1c5d, 0x1907960c, 0xf7fde8b9),
+10 -4
drivers/ide/legacy/qd65xx.c
··· 16 16 * Please set local bus speed using kernel parameter idebus 17 17 * for example, "idebus=33" stands for 33Mhz VLbus 18 18 * To activate controller support, use "ide0=qd65xx" 19 - * To enable tuning, use "ide0=autotune" 20 - * To enable second channel tuning (qd6580 only), use "ide1=autotune" 19 + * To enable tuning, use "hda=autotune hdb=autotune" 20 + * To enable 2nd channel tuning (qd6580 only), use "hdc=autotune hdd=autotune" 21 21 */ 22 22 23 23 /* 24 24 * Rewritten from the work of Colten Edwards <pje120@cs.usask.ca> by 25 25 * Samuel Thibault <samuel.thibault@fnac.net> 26 26 */ 27 - 28 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 29 27 30 28 #include <linux/module.h> 31 29 #include <linux/types.h> ··· 488 490 return 1; 489 491 } 490 492 493 + int probe_qd65xx = 0; 494 + 495 + module_param_named(probe, probe_qd65xx, bool, 0); 496 + MODULE_PARM_DESC(probe, "probe for QD65xx chipsets"); 497 + 491 498 /* Can be called directly from ide.c. */ 492 499 int __init qd65xx_init(void) 493 500 { 501 + if (probe_qd65xx == 0) 502 + return -ENODEV; 503 + 494 504 if (qd_probe(0x30)) 495 505 qd_probe(0xb0); 496 506 if (ide_hwifs[0].chipset != ide_qd65xx &&
+12 -3
drivers/ide/legacy/umc8672.c
··· 165 165 return 0; 166 166 } 167 167 168 + int probe_umc8672 = 0; 169 + 170 + module_param_named(probe, probe_umc8672, bool, 0); 171 + MODULE_PARM_DESC(probe, "probe for UMC8672 chipset"); 172 + 168 173 /* Can be called directly from ide.c. */ 169 174 int __init umc8672_init(void) 170 175 { 171 - if (umc8672_probe()) 172 - return -ENODEV; 173 - return 0; 176 + if (probe_umc8672 == 0) 177 + goto out; 178 + 179 + if (umc8672_probe() == 0) 180 + return 0;; 181 + out: 182 + return -ENODEV;; 174 183 } 175 184 176 185 #ifdef MODULE
-2
drivers/ide/mips/au1xxx-ide.c
··· 29 29 * Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE 30 30 * Interface and Linux Device Driver" Application Note. 31 31 */ 32 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 33 - 34 32 #include <linux/types.h> 35 33 #include <linux/module.h> 36 34 #include <linux/kernel.h>
+27 -8
drivers/ide/pci/alim15x3.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/alim15x3.c Version 0.17 2003/01/02 2 + * linux/drivers/ide/pci/alim15x3.c Version 0.21 2007/02/03 3 3 * 4 4 * Copyright (C) 1998-2000 Michel Aubry, Maintainer 5 5 * Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer ··· 9 9 * May be copied or modified under the terms of the GNU General Public License 10 10 * Copyright (C) 2002 Alan Cox <alan@redhat.com> 11 11 * ALi (now ULi M5228) support by Clear Zhang <Clear.Zhang@ali.com.tw> 12 + * Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com> 12 13 * 13 14 * (U)DMA capable version of ali 1533/1543(C), 1535(D) 14 15 * ··· 281 280 #endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */ 282 281 283 282 /** 284 - * ali15x3_tune_drive - set up a drive 283 + * ali15x3_tune_pio - set up chipset for PIO mode 285 284 * @drive: drive to tune 286 - * @pio: unused 285 + * @pio: desired mode 287 286 * 288 - * Select the best PIO timing for the drive in question. Then 289 - * program the controller for this drive set up 287 + * Select the best PIO mode for the drive in question. 288 + * Then program the controller for this mode. 289 + * 290 + * Returns the PIO mode programmed. 290 291 */ 291 292 292 - static void ali15x3_tune_drive (ide_drive_t *drive, u8 pio) 293 + static u8 ali15x3_tune_pio (ide_drive_t *drive, u8 pio) 293 294 { 294 295 ide_pio_data_t d; 295 296 ide_hwif_t *hwif = HWIF(drive); ··· 359 356 * { 20, 50, 30 } PIO Mode 5 with IORDY (nonstandard) 360 357 */ 361 358 359 + return pio; 360 + } 361 + 362 + /** 363 + * ali15x3_tune_drive - set up drive for PIO mode 364 + * @drive: drive to tune 365 + * @pio: desired mode 366 + * 367 + * Program the controller with the best PIO timing for the given drive. 368 + * Then set up the drive itself. 369 + */ 370 + 371 + static void ali15x3_tune_drive (ide_drive_t *drive, u8 pio) 372 + { 373 + pio = ali15x3_tune_pio(drive, pio); 374 + (void) ide_config_drive_speed(drive, XFER_PIO_0 + pio); 362 375 } 363 376 364 377 /** ··· 449 430 } 450 431 451 432 /** 452 - * ali15x3_tune_chipset - set up chiset for new speed 433 + * ali15x3_tune_chipset - set up chipset/drive for new speed 453 434 * @drive: drive to configure for 454 435 * @xferspeed: desired speed 455 436 * ··· 480 461 pci_write_config_byte(dev, m5229_udma, tmpbyte); 481 462 482 463 if (speed < XFER_SW_DMA_0) 483 - ali15x3_tune_drive(drive, speed); 464 + (void) ali15x3_tune_pio(drive, speed - XFER_PIO_0); 484 465 } else { 485 466 pci_read_config_byte(dev, m5229_udma, &tmpbyte); 486 467 tmpbyte &= (0x0f << ((1-unit) << 2));
-1
drivers/ide/pci/cmd640.c
··· 98 98 * (patch courtesy of Zoltan Hidvegi) 99 99 */ 100 100 101 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 102 101 #define CMD640_PREFETCH_MASKS 1 103 102 104 103 //#define CMD640_DUMP_REGS
+43 -65
drivers/ide/pci/cmd64x.c
··· 1 1 /* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16 2 2 * 3 - * linux/drivers/ide/pci/cmd64x.c Version 1.30 Sept 10, 2002 3 + * linux/drivers/ide/pci/cmd64x.c Version 1.41 Feb 3, 2007 4 4 * 5 5 * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines. 6 6 * Note, this driver is not used at all on other systems because ··· 12 12 * Copyright (C) 1998 David S. Miller (davem@redhat.com) 13 13 * 14 14 * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> 15 + * Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com> 15 16 */ 16 17 17 18 #include <linux/module.h> ··· 263 262 } 264 263 265 264 /* 266 - * Attempts to set the interface PIO mode. 267 - * The preferred method of selecting PIO modes (e.g. mode 4) is 268 - * "echo 'piomode:4' > /proc/ide/hdx/settings". Special cases are 269 - * 8: prefetch off, 9: prefetch on, 255: auto-select best mode. 270 - * Called with 255 at boot time. 265 + * This routine selects drive's best PIO mode, calculates setup/active/recovery 266 + * counts, and then writes them into the chipset registers. 271 267 */ 272 - 273 - static void cmd64x_tuneproc (ide_drive_t *drive, u8 mode_wanted) 268 + static u8 cmd64x_tune_pio (ide_drive_t *drive, u8 mode_wanted) 274 269 { 275 270 int setup_time, active_time, recovery_time; 276 271 int clock_time, pio_mode, cycle_time; 277 272 u8 recovery_count2, cycle_count; 278 273 int setup_count, active_count, recovery_count; 279 274 int bus_speed = system_bus_clock(); 280 - /*byte b;*/ 281 275 ide_pio_data_t d; 282 276 283 - switch (mode_wanted) { 284 - case 8: /* set prefetch off */ 285 - case 9: /* set prefetch on */ 286 - mode_wanted &= 1; 287 - /*set_prefetch_mode(index, mode_wanted);*/ 288 - cmdprintk("%s: %sabled cmd640 prefetch\n", 289 - drive->name, mode_wanted ? "en" : "dis"); 290 - return; 291 - } 292 - 293 - mode_wanted = ide_get_best_pio_mode (drive, mode_wanted, 5, &d); 294 - pio_mode = d.pio_mode; 277 + pio_mode = ide_get_best_pio_mode(drive, mode_wanted, 5, &d); 295 278 cycle_time = d.cycle_time; 296 279 297 280 /* 298 281 * I copied all this complicated stuff from cmd640.c and made a few 299 282 * minor changes. For now I am just going to pray that it is correct. 300 283 */ 301 - if (pio_mode > 5) 302 - pio_mode = 5; 303 284 setup_time = ide_pio_timings[pio_mode].setup_time; 304 285 active_time = ide_pio_timings[pio_mode].active_time; 305 286 recovery_time = cycle_time - (setup_time + active_time); ··· 303 320 if (active_count > 16) 304 321 active_count = 16; /* maximum allowed by cmd646 */ 305 322 306 - /* 307 - * In a perfect world, we might set the drive pio mode here 308 - * (using WIN_SETFEATURE) before continuing. 309 - * 310 - * But we do not, because: 311 - * 1) this is the wrong place to do it 312 - * (proper is do_special() in ide.c) 313 - * 2) in practice this is rarely, if ever, necessary 314 - */ 315 323 program_drive_counts (drive, setup_count, active_count, recovery_count); 316 324 317 - cmdprintk("%s: selected cmd646 PIO mode%d : %d (%dns)%s, " 325 + cmdprintk("%s: PIO mode wanted %d, selected %d (%dns)%s, " 318 326 "clocks=%d/%d/%d\n", 319 - drive->name, pio_mode, mode_wanted, cycle_time, 327 + drive->name, mode_wanted, pio_mode, cycle_time, 320 328 d.overridden ? " (overriding vendor mode)" : "", 321 329 setup_count, active_count, recovery_count); 330 + 331 + return pio_mode; 332 + } 333 + 334 + /* 335 + * Attempts to set drive's PIO mode. 336 + * Special cases are 8: prefetch off, 9: prefetch on (both never worked), 337 + * and 255: auto-select best mode (used at boot time). 338 + */ 339 + static void cmd64x_tune_drive (ide_drive_t *drive, u8 pio) 340 + { 341 + /* 342 + * Filter out the prefetch control values 343 + * to prevent PIO5 from being programmed 344 + */ 345 + if (pio == 8 || pio == 9) 346 + return; 347 + 348 + pio = cmd64x_tune_pio(drive, pio); 349 + (void) ide_config_drive_speed(drive, XFER_PIO_0 + pio); 322 350 } 323 351 324 352 static u8 cmd64x_ratemask (ide_drive_t *drive) ··· 381 387 return mode; 382 388 } 383 389 384 - static void config_cmd64x_chipset_for_pio (ide_drive_t *drive, u8 set_speed) 385 - { 386 - u8 speed = 0x00; 387 - u8 set_pio = ide_get_best_pio_mode(drive, 4, 5, NULL); 388 - 389 - cmd64x_tuneproc(drive, set_pio); 390 - speed = XFER_PIO_0 + set_pio; 391 - if (set_speed) 392 - (void) ide_config_drive_speed(drive, speed); 393 - } 394 - 395 - static void config_chipset_for_pio (ide_drive_t *drive, u8 set_speed) 396 - { 397 - config_cmd64x_chipset_for_pio(drive, set_speed); 398 - } 399 - 400 390 static int cmd64x_tune_chipset (ide_drive_t *drive, u8 xferspeed) 401 391 { 402 392 ide_hwif_t *hwif = HWIF(drive); ··· 392 414 393 415 u8 speed = ide_rate_filter(cmd64x_ratemask(drive), xferspeed); 394 416 395 - if (speed > XFER_PIO_4) { 417 + if (speed >= XFER_SW_DMA_0) { 396 418 (void) pci_read_config_byte(dev, pciD, &regD); 397 419 (void) pci_read_config_byte(dev, pciU, &regU); 398 420 regD &= ~(unit ? 0x40 : 0x20); ··· 416 438 case XFER_SW_DMA_2: regD |= (unit ? 0x40 : 0x10); break; 417 439 case XFER_SW_DMA_1: regD |= (unit ? 0x80 : 0x20); break; 418 440 case XFER_SW_DMA_0: regD |= (unit ? 0xC0 : 0x30); break; 419 - case XFER_PIO_4: cmd64x_tuneproc(drive, 4); break; 420 - case XFER_PIO_3: cmd64x_tuneproc(drive, 3); break; 421 - case XFER_PIO_2: cmd64x_tuneproc(drive, 2); break; 422 - case XFER_PIO_1: cmd64x_tuneproc(drive, 1); break; 423 - case XFER_PIO_0: cmd64x_tuneproc(drive, 0); break; 441 + case XFER_PIO_5: 442 + case XFER_PIO_4: 443 + case XFER_PIO_3: 444 + case XFER_PIO_2: 445 + case XFER_PIO_1: 446 + case XFER_PIO_0: 447 + (void) cmd64x_tune_pio(drive, speed - XFER_PIO_0); 448 + break; 424 449 425 450 default: 426 451 return 1; 427 452 } 428 453 429 - if (speed > XFER_PIO_4) { 454 + if (speed >= XFER_SW_DMA_0) { 430 455 (void) pci_write_config_byte(dev, pciU, regU); 431 456 regD |= (unit ? 0x40 : 0x20); 432 457 (void) pci_write_config_byte(dev, pciD, regD); ··· 441 460 static int config_chipset_for_dma (ide_drive_t *drive) 442 461 { 443 462 u8 speed = ide_dma_speed(drive, cmd64x_ratemask(drive)); 444 - 445 - config_chipset_for_pio(drive, !speed); 446 463 447 464 if (!speed) 448 465 return 0; ··· 457 478 return 0; 458 479 459 480 if (ide_use_fast_pio(drive)) 460 - config_chipset_for_pio(drive, 1); 481 + cmd64x_tune_drive(drive, 255); 461 482 462 483 return -1; 463 484 } ··· 658 679 pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); 659 680 class_rev &= 0xff; 660 681 661 - hwif->tuneproc = &cmd64x_tuneproc; 682 + hwif->tuneproc = &cmd64x_tune_drive; 662 683 hwif->speedproc = &cmd64x_tune_chipset; 663 684 664 - if (!hwif->dma_base) { 665 - hwif->drives[0].autotune = 1; 666 - hwif->drives[1].autotune = 1; 685 + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; 686 + 687 + if (!hwif->dma_base) 667 688 return; 668 - } 669 689 670 690 hwif->atapi_dma = 1; 671 691
+1 -1
drivers/ide/pci/delkin_cb.c
··· 122 122 static int 123 123 delkin_cb_init (void) 124 124 { 125 - return pci_module_init(&driver); 125 + return pci_register_driver(&driver); 126 126 } 127 127 128 128 static void
-2
drivers/ide/pci/generic.c
··· 21 21 * are deemed to be part of the source code. 22 22 */ 23 23 24 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 25 - 26 24 #include <linux/types.h> 27 25 #include <linux/module.h> 28 26 #include <linux/kernel.h>
+1 -2
drivers/ide/pci/opti621.c
··· 57 57 * There is a 25/33MHz switch in configuration 58 58 * register, but driver is written for use at any frequency which get 59 59 * (use idebus=xx to select PCI bus speed). 60 - * Use ide0=autotune for automatical tune of the PIO modes. 60 + * Use hda=autotune and hdb=autotune for automatical tune of the PIO modes. 61 61 * If you get strange results, do not use this and set PIO manually 62 62 * by hdparm. 63 63 * ··· 87 87 * 0.5 doesn't work. 88 88 */ 89 89 90 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 91 90 #define OPTI621_DEBUG /* define for debug messages */ 92 91 93 92 #include <linux/types.h>
+30 -19
drivers/ide/pci/piix.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/piix.c Version 0.46 December 3, 2006 2 + * linux/drivers/ide/pci/piix.c Version 0.47 February 8, 2007 3 3 * 4 4 * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer 5 5 * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org> 6 6 * Copyright (C) 2003 Red Hat Inc <alan@redhat.com> 7 - * Copyright (C) 2006 MontaVista Software, Inc. <source@mvista.com> 7 + * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com> 8 8 * 9 9 * May be copied or modified under the terms of the GNU General Public License 10 10 * ··· 205 205 } 206 206 207 207 /** 208 - * piix_tune_drive - tune a drive attached to a PIIX 208 + * piix_tune_pio - tune PIIX for PIO mode 209 209 * @drive: drive to tune 210 210 * @pio: desired PIO mode 211 211 * 212 - * Set the interface PIO mode based upon the settings done by AMI BIOS 213 - * (might be useful if drive is not registered in CMOS for any reason). 212 + * Set the interface PIO mode based upon the settings done by AMI BIOS. 214 213 */ 215 - static void piix_tune_drive (ide_drive_t *drive, u8 pio) 214 + static void piix_tune_pio (ide_drive_t *drive, u8 pio) 216 215 { 217 216 ide_hwif_t *hwif = HWIF(drive); 218 217 struct pci_dev *dev = hwif->pci_dev; ··· 232 233 { 2, 1 }, 233 234 { 2, 3 }, }; 234 235 235 - pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 236 - 237 236 /* 238 237 * Master vs slave is synchronized above us but the slave register is 239 238 * shared by the two hwifs so the corner case of two slave timeouts in ··· 250 253 master_data |= 0x4000; 251 254 master_data &= ~0x0070; 252 255 if (pio > 1) { 253 - /* enable PPE, IE and TIME */ 254 - master_data = master_data | (control << 4); 256 + /* Set PPE, IE and TIME */ 257 + master_data |= control << 4; 255 258 } 256 259 pci_read_config_byte(dev, slave_port, &slave_data); 257 - slave_data = slave_data & (hwif->channel ? 0x0f : 0xf0); 258 - slave_data = slave_data | (((timings[pio][0] << 2) | timings[pio][1]) << (hwif->channel ? 4 : 0)); 260 + slave_data &= hwif->channel ? 0x0f : 0xf0; 261 + slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << 262 + (hwif->channel ? 4 : 0); 259 263 } else { 260 264 master_data &= ~0x3307; 261 265 if (pio > 1) { 262 266 /* enable PPE, IE and TIME */ 263 - master_data = master_data | control; 267 + master_data |= control; 264 268 } 265 - master_data = master_data | (timings[pio][0] << 12) | (timings[pio][1] << 8); 269 + master_data |= (timings[pio][0] << 12) | (timings[pio][1] << 8); 266 270 } 267 271 pci_write_config_word(dev, master_port, master_data); 268 272 if (is_slave) 269 273 pci_write_config_byte(dev, slave_port, slave_data); 270 274 spin_unlock_irqrestore(&tune_lock, flags); 275 + } 276 + 277 + /** 278 + * piix_tune_drive - tune a drive attached to PIIX 279 + * @drive: drive to tune 280 + * @pio: desired PIO mode 281 + * 282 + * Set the drive's PIO mode (might be useful if drive is not registered 283 + * in CMOS for any reason). 284 + */ 285 + static void piix_tune_drive (ide_drive_t *drive, u8 pio) 286 + { 287 + pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 288 + piix_tune_pio(drive, pio); 289 + (void) ide_config_drive_speed(drive, XFER_PIO_0 + pio); 271 290 } 272 291 273 292 /** ··· 361 348 pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); 362 349 } 363 350 364 - piix_tune_drive(drive, piix_dma_2_pio(speed)); 365 - return (ide_config_drive_speed(drive, speed)); 351 + piix_tune_pio(drive, piix_dma_2_pio(speed)); 352 + return ide_config_drive_speed(drive, speed); 366 353 } 367 354 368 355 /** ··· 405 392 return 0; 406 393 407 394 if (ide_use_fast_pio(drive)) 408 - /* Find best PIO mode. */ 409 - piix_tune_chipset(drive, XFER_PIO_0 + 410 - ide_get_best_pio_mode(drive, 255, 4, NULL)); 395 + piix_tune_drive(drive, 255); 411 396 412 397 return -1; 413 398 }
-2
drivers/ide/pci/rz1000.c
··· 15 15 * Dunno if this fixes both ports, or only the primary port (?). 16 16 */ 17 17 18 - #undef REALLY_SLOW_IO /* most systems can safely undef this */ 19 - 20 18 #include <linux/types.h> 21 19 #include <linux/module.h> 22 20 #include <linux/kernel.h>
+5
drivers/ide/pci/siimage.c
··· 26 26 * If you have strange problems with nVidia chipset systems please 27 27 * see the SI support documentation and update your system BIOS 28 28 * if neccessary 29 + * 30 + * The Dell DRAC4 has some interesting features including effectively hot 31 + * unplugging/replugging the virtual CD interface when the DRAC is reset. 32 + * This often causes drivers/ide/siimage to panic but is ok with the rather 33 + * smarter code in libata. 29 34 */ 30 35 31 36 #include <linux/types.h>
+20 -18
drivers/ide/pci/slc90e66.c
··· 1 1 /* 2 - * linux/drivers/ide/pci/slc90e66.c Version 0.13 December 30, 2006 2 + * linux/drivers/ide/pci/slc90e66.c Version 0.14 February 8, 2007 3 3 * 4 4 * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org> 5 - * Copyright (C) 2006 MontaVista Software, Inc. <source@mvista.com> 5 + * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com> 6 6 * 7 7 * This is a look-alike variation of the ICH0 PIIX4 Ultra-66, 8 8 * but this keeps the ISA-Bridge and slots alive. ··· 57 57 } 58 58 } 59 59 60 - /* 61 - * Based on settings done by AMI BIOS 62 - * (might be useful if drive is not registered in CMOS for any reason). 63 - */ 64 - static void slc90e66_tune_drive (ide_drive_t *drive, u8 pio) 60 + static void slc90e66_tune_pio (ide_drive_t *drive, u8 pio) 65 61 { 66 62 ide_hwif_t *hwif = HWIF(drive); 67 63 struct pci_dev *dev = hwif->pci_dev; ··· 76 80 { 2, 1 }, 77 81 { 2, 3 }, }; 78 82 79 - pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 80 83 spin_lock_irqsave(&ide_lock, flags); 81 84 pci_read_config_word(dev, master_port, &master_data); 82 85 ··· 89 94 master_data |= 0x4000; 90 95 master_data &= ~0x0070; 91 96 if (pio > 1) { 92 - /* enable PPE, IE and TIME */ 93 - master_data = master_data | (control << 4); 97 + /* Set PPE, IE and TIME */ 98 + master_data |= control << 4; 94 99 } 95 100 pci_read_config_byte(dev, slave_port, &slave_data); 96 - slave_data = slave_data & (hwif->channel ? 0x0f : 0xf0); 97 - slave_data = slave_data | (((timings[pio][0] << 2) | timings[pio][1]) << (hwif->channel ? 4 : 0)); 101 + slave_data &= hwif->channel ? 0x0f : 0xf0; 102 + slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << 103 + (hwif->channel ? 4 : 0); 98 104 } else { 99 105 master_data &= ~0x3307; 100 106 if (pio > 1) { 101 107 /* enable PPE, IE and TIME */ 102 - master_data = master_data | control; 108 + master_data |= control; 103 109 } 104 - master_data = master_data | (timings[pio][0] << 12) | (timings[pio][1] << 8); 110 + master_data |= (timings[pio][0] << 12) | (timings[pio][1] << 8); 105 111 } 106 112 pci_write_config_word(dev, master_port, master_data); 107 113 if (is_slave) 108 114 pci_write_config_byte(dev, slave_port, slave_data); 109 115 spin_unlock_irqrestore(&ide_lock, flags); 116 + } 117 + 118 + static void slc90e66_tune_drive (ide_drive_t *drive, u8 pio) 119 + { 120 + pio = ide_get_best_pio_mode(drive, pio, 4, NULL); 121 + slc90e66_tune_pio(drive, pio); 122 + (void) ide_config_drive_speed(drive, XFER_PIO_0 + pio); 110 123 } 111 124 112 125 static int slc90e66_tune_chipset (ide_drive_t *drive, u8 xferspeed) ··· 165 162 pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); 166 163 } 167 164 168 - slc90e66_tune_drive(drive, slc90e66_dma_2_pio(speed)); 169 - return (ide_config_drive_speed(drive, speed)); 165 + slc90e66_tune_pio(drive, slc90e66_dma_2_pio(speed)); 166 + return ide_config_drive_speed(drive, speed); 170 167 } 171 168 172 169 static int slc90e66_config_drive_for_dma (ide_drive_t *drive) ··· 188 185 return 0; 189 186 190 187 if (ide_use_fast_pio(drive)) 191 - (void)slc90e66_tune_chipset(drive, XFER_PIO_0 + 192 - ide_get_best_pio_mode(drive, 255, 4, NULL)); 188 + slc90e66_tune_drive(drive, 255); 193 189 194 190 return -1; 195 191 }
+24 -9
drivers/ide/ppc/pmac.c
··· 48 48 #include <asm/mediabay.h> 49 49 #endif 50 50 51 - #include "ide-timing.h" 51 + #include "../ide-timing.h" 52 52 53 53 #undef IDE_PMAC_DEBUG 54 54 ··· 1551 1551 }; 1552 1552 MODULE_DEVICE_TABLE(pci, pmac_ide_pci_match); 1553 1553 1554 - void __init 1555 - pmac_ide_probe(void) 1554 + int __init pmac_ide_probe(void) 1556 1555 { 1556 + int error; 1557 + 1557 1558 if (!machine_is(powermac)) 1558 - return; 1559 + return -ENODEV; 1559 1560 1560 1561 #ifdef CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST 1561 - pci_register_driver(&pmac_ide_pci_driver); 1562 - macio_register_driver(&pmac_ide_macio_driver); 1562 + error = pci_register_driver(&pmac_ide_pci_driver); 1563 + if (error) 1564 + goto out; 1565 + error = macio_register_driver(&pmac_ide_macio_driver); 1566 + if (error) { 1567 + pci_unregister_driver(&pmac_ide_pci_driver); 1568 + goto out; 1569 + } 1563 1570 #else 1564 - macio_register_driver(&pmac_ide_macio_driver); 1565 - pci_register_driver(&pmac_ide_pci_driver); 1571 + error = macio_register_driver(&pmac_ide_macio_driver); 1572 + if (error) 1573 + goto out; 1574 + error = pci_register_driver(&pmac_ide_pci_driver); 1575 + if (error) { 1576 + macio_unregister_driver(&pmac_ide_macio_driver); 1577 + goto out; 1578 + } 1566 1579 #endif 1580 + out: 1581 + return error; 1567 1582 } 1568 1583 1569 1584 #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC ··· 1998 1983 { 1999 1984 } 2000 1985 2001 - static int pmac_ide_dma_host_on(ide_drive_t *drive) 1986 + static void pmac_ide_dma_host_on(ide_drive_t *drive) 2002 1987 { 2003 1988 } 2004 1989
+27
drivers/ide/ppc/scc_pata.c
··· 509 509 return __ide_dma_end(drive); 510 510 } 511 511 512 + /* returns 1 if dma irq issued, 0 otherwise */ 513 + static int scc_dma_test_irq(ide_drive_t *drive) 514 + { 515 + ide_hwif_t *hwif = HWIF(drive); 516 + u8 dma_stat = hwif->INB(hwif->dma_status); 517 + 518 + /* return 1 if INTR asserted */ 519 + if ((dma_stat & 4) == 4) 520 + return 1; 521 + 522 + /* Workaround for PTERADD: emulate DMA_INTR when 523 + * - IDE_STATUS[ERR] = 1 524 + * - INT_STATUS[INTRQ] = 1 525 + * - DMA_STATUS[IORACTA] = 1 526 + */ 527 + if (in_be32((void __iomem *)IDE_ALTSTATUS_REG) & ERR_STAT && 528 + in_be32((void __iomem *)(hwif->dma_base + 0x014)) & INTSTS_INTRQ && 529 + dma_stat & 1) 530 + return 1; 531 + 532 + if (!drive->waiting_for_dma) 533 + printk(KERN_WARNING "%s: (%s) called while not waiting\n", 534 + drive->name, __FUNCTION__); 535 + return 0; 536 + } 537 + 512 538 /** 513 539 * setup_mmio_scc - map CTRL/BMID region 514 540 * @dev: PCI device we are configuring ··· 738 712 hwif->speedproc = scc_tune_chipset; 739 713 hwif->tuneproc = scc_tuneproc; 740 714 hwif->ide_dma_check = scc_config_drive_for_dma; 715 + hwif->ide_dma_test_irq = scc_dma_test_irq; 741 716 742 717 hwif->drives[0].autotune = IDE_TUNE_AUTO; 743 718 hwif->drives[1].autotune = IDE_TUNE_AUTO;
+32 -13
drivers/pci/probe.c
··· 682 682 dev->irq = irq; 683 683 } 684 684 685 - #define LEGACY_IO_RESOURCE (IORESOURCE_IO | IORESOURCE_PCI_FIXED) 685 + static void change_legacy_io_resource(struct pci_dev * dev, unsigned index, 686 + unsigned start, unsigned end) 687 + { 688 + unsigned base = start & PCI_BASE_ADDRESS_IO_MASK; 689 + unsigned len = (end | ~PCI_BASE_ADDRESS_IO_MASK) - base + 1; 690 + 691 + /* 692 + * Some X versions get confused when the BARs reported through 693 + * /sys or /proc differ from those seen in config space, thus 694 + * try to update the config space values, too. 695 + */ 696 + if (!(pci_resource_flags(dev, index) & IORESOURCE_IO)) 697 + printk(KERN_WARNING "%s: cannot adjust BAR%u (not I/O)\n", 698 + pci_name(dev), index); 699 + else if (pci_resource_len(dev, index) != len) 700 + printk(KERN_WARNING "%s: cannot adjust BAR%u (size %04X)\n", 701 + pci_name(dev), index, (unsigned)pci_resource_len(dev, index)); 702 + else { 703 + printk(KERN_INFO "%s: trying to change BAR%u from %04X to %04X\n", 704 + pci_name(dev), index, 705 + (unsigned)pci_resource_start(dev, index), base); 706 + pci_write_config_dword(dev, PCI_BASE_ADDRESS_0 + index * 4, base); 707 + } 708 + pci_resource_start(dev, index) = start; 709 + pci_resource_end(dev, index) = end; 710 + pci_resource_flags(dev, index) = 711 + IORESOURCE_IO | IORESOURCE_PCI_FIXED | PCI_BASE_ADDRESS_SPACE_IO; 712 + } 686 713 687 714 /** 688 715 * pci_setup_device - fill in class and map information of a device ··· 762 735 u8 progif; 763 736 pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); 764 737 if ((progif & 1) == 0) { 765 - dev->resource[0].start = 0x1F0; 766 - dev->resource[0].end = 0x1F7; 767 - dev->resource[0].flags = LEGACY_IO_RESOURCE; 768 - dev->resource[1].start = 0x3F6; 769 - dev->resource[1].end = 0x3F6; 770 - dev->resource[1].flags = LEGACY_IO_RESOURCE; 738 + change_legacy_io_resource(dev, 0, 0x1F0, 0x1F7); 739 + change_legacy_io_resource(dev, 1, 0x3F6, 0x3F6); 771 740 } 772 741 if ((progif & 4) == 0) { 773 - dev->resource[2].start = 0x170; 774 - dev->resource[2].end = 0x177; 775 - dev->resource[2].flags = LEGACY_IO_RESOURCE; 776 - dev->resource[3].start = 0x376; 777 - dev->resource[3].end = 0x376; 778 - dev->resource[3].flags = LEGACY_IO_RESOURCE; 742 + change_legacy_io_resource(dev, 2, 0x170, 0x177); 743 + change_legacy_io_resource(dev, 3, 0x376, 0x376); 779 744 } 780 745 } 781 746 break;
+2 -1
include/linux/ide.h
··· 1359 1359 typedef struct ide_pio_timings_s { 1360 1360 int setup_time; /* Address setup (ns) minimum */ 1361 1361 int active_time; /* Active pulse (ns) minimum */ 1362 - int cycle_time; /* Cycle time (ns) minimum = (setup + active + recovery) */ 1362 + int cycle_time; /* Cycle time (ns) minimum = */ 1363 + /* active + recovery (+ setup for some chips) */ 1363 1364 } ide_pio_timings_t; 1364 1365 1365 1366 typedef struct ide_pio_data_s {