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

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6:
alim15x3: fix sparse warning
ide: remove dead code from drive_is_ready()
ide: fix build for DEBUG_PM
ide: respect current DMA setting during resume
ide: add SAMSUNG SP0822N with firmware WA100-10 to ivb_list[]
amd74xx: workaround unreliable AltStatus register for nVidia controllers
ide: fix the ide_release_lock imbalance

+38 -25
+1 -1
drivers/ide/alim15x3.c
··· 591 592 static void __exit ali15x3_ide_exit(void) 593 { 594 - return pci_unregister_driver(&alim15x3_pci_driver); 595 } 596 597 module_init(ali15x3_ide_init);
··· 591 592 static void __exit ali15x3_ide_exit(void) 593 { 594 + pci_unregister_driver(&alim15x3_pci_driver); 595 } 596 597 module_init(ali15x3_ide_init);
+10 -1
drivers/ide/amd74xx.c
··· 3 * IDE driver for Linux. 4 * 5 * Copyright (c) 2000-2002 Vojtech Pavlik 6 - * Copyright (c) 2007 Bartlomiej Zolnierkiewicz 7 * 8 * Based on the work of: 9 * Andre Hedrick ··· 262 dev->subsystem_device == PCI_DEVICE_ID_AMD_SERENADE) 263 d.udma_mask = ATA_UDMA5; 264 } 265 266 printk(KERN_INFO "%s %s: UDMA%s controller\n", 267 d.name, pci_name(dev), amd_dma[fls(d.udma_mask) - 1]);
··· 3 * IDE driver for Linux. 4 * 5 * Copyright (c) 2000-2002 Vojtech Pavlik 6 + * Copyright (c) 2007-2008 Bartlomiej Zolnierkiewicz 7 * 8 * Based on the work of: 9 * Andre Hedrick ··· 262 dev->subsystem_device == PCI_DEVICE_ID_AMD_SERENADE) 263 d.udma_mask = ATA_UDMA5; 264 } 265 + 266 + /* 267 + * It seems that on some nVidia controllers using AltStatus 268 + * register can be unreliable so default to Status register 269 + * if the device is in Compatibility Mode. 270 + */ 271 + if (dev->vendor == PCI_VENDOR_ID_NVIDIA && 272 + ide_pci_is_in_compatibility_mode(dev)) 273 + d.host_flags |= IDE_HFLAG_BROKEN_ALTSTATUS; 274 275 printk(KERN_INFO "%s %s: UDMA%s controller\n", 276 d.name, pci_name(dev), amd_dma[fls(d.udma_mask) - 1]);
+14 -16
drivers/ide/ide-io.c
··· 132 } 133 EXPORT_SYMBOL(ide_end_request); 134 135 - static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 stat, u8 error) 136 { 137 struct request_pm_state *pm = rq->data; 138 139 if (drive->media != ide_disk) 140 return; 141 ··· 176 /* Not supported? Switch to next step now. */ 177 if (ata_id_flush_enabled(drive->id) == 0 || 178 (drive->dev_flags & IDE_DFLAG_WCACHE) == 0) { 179 - ide_complete_power_step(drive, rq, 0, 0); 180 return ide_stopped; 181 } 182 if (ata_id_flush_ext_enabled(drive->id)) ··· 195 if (drive->media != ide_disk) 196 pm->pm_step = IDE_PM_RESTORE_DMA; 197 else 198 - ide_complete_power_step(drive, rq, 0, 0); 199 return ide_stopped; 200 case IDE_PM_IDLE: /* Resume step 2 (idle) */ 201 args->tf.command = ATA_CMD_IDLEIMMEDIATE; ··· 208 */ 209 if (drive->hwif->dma_ops == NULL) 210 break; 211 - /* 212 - * TODO: respect IDE_DFLAG_USING_DMA 213 - */ 214 - ide_set_dma(drive); 215 break; 216 } 217 ··· 324 } 325 } else if (blk_pm_request(rq)) { 326 struct request_pm_state *pm = rq->data; 327 - #ifdef DEBUG_PM 328 - printk("%s: complete_power_step(step: %d, stat: %x, err: %x)\n", 329 - drive->name, rq->pm->pm_step, stat, err); 330 - #endif 331 - ide_complete_power_step(drive, rq, stat, err); 332 if (pm->pm_step == IDE_PM_COMPLETED) 333 ide_complete_pm_request(drive, rq); 334 return; ··· 803 struct request_pm_state *pm = rq->data; 804 #ifdef DEBUG_PM 805 printk("%s: start_power_step(step: %d)\n", 806 - drive->name, rq->pm->pm_step); 807 #endif 808 startstop = ide_start_power_step(drive, rq); 809 if (startstop == ide_stopped && ··· 966 ide_startstop_t startstop; 967 int loops = 0; 968 969 - /* for atari only: POSSIBLY BROKEN HERE(?) */ 970 - ide_get_lock(ide_intr, hwgroup); 971 - 972 /* caller must own ide_lock */ 973 BUG_ON(!irqs_disabled()); 974 975 while (!hwgroup->busy) { 976 hwgroup->busy = 1; 977 drive = choose_drive(hwgroup); 978 if (drive == NULL) { 979 int sleeping = 0;
··· 132 } 133 EXPORT_SYMBOL(ide_end_request); 134 135 + static void ide_complete_power_step(ide_drive_t *drive, struct request *rq) 136 { 137 struct request_pm_state *pm = rq->data; 138 139 + #ifdef DEBUG_PM 140 + printk(KERN_INFO "%s: complete_power_step(step: %d)\n", 141 + drive->name, pm->pm_step); 142 + #endif 143 if (drive->media != ide_disk) 144 return; 145 ··· 172 /* Not supported? Switch to next step now. */ 173 if (ata_id_flush_enabled(drive->id) == 0 || 174 (drive->dev_flags & IDE_DFLAG_WCACHE) == 0) { 175 + ide_complete_power_step(drive, rq); 176 return ide_stopped; 177 } 178 if (ata_id_flush_ext_enabled(drive->id)) ··· 191 if (drive->media != ide_disk) 192 pm->pm_step = IDE_PM_RESTORE_DMA; 193 else 194 + ide_complete_power_step(drive, rq); 195 return ide_stopped; 196 case IDE_PM_IDLE: /* Resume step 2 (idle) */ 197 args->tf.command = ATA_CMD_IDLEIMMEDIATE; ··· 204 */ 205 if (drive->hwif->dma_ops == NULL) 206 break; 207 + if (drive->dev_flags & IDE_DFLAG_USING_DMA) 208 + ide_set_dma(drive); 209 break; 210 } 211 ··· 322 } 323 } else if (blk_pm_request(rq)) { 324 struct request_pm_state *pm = rq->data; 325 + 326 + ide_complete_power_step(drive, rq); 327 if (pm->pm_step == IDE_PM_COMPLETED) 328 ide_complete_pm_request(drive, rq); 329 return; ··· 804 struct request_pm_state *pm = rq->data; 805 #ifdef DEBUG_PM 806 printk("%s: start_power_step(step: %d)\n", 807 + drive->name, pm->pm_step); 808 #endif 809 startstop = ide_start_power_step(drive, rq); 810 if (startstop == ide_stopped && ··· 967 ide_startstop_t startstop; 968 int loops = 0; 969 970 /* caller must own ide_lock */ 971 BUG_ON(!irqs_disabled()); 972 973 while (!hwgroup->busy) { 974 hwgroup->busy = 1; 975 + /* for atari only */ 976 + ide_get_lock(ide_intr, hwgroup); 977 drive = choose_drive(hwgroup); 978 if (drive == NULL) { 979 int sleeping = 0;
+3 -6
drivers/ide/ide-iops.c
··· 457 if (drive->waiting_for_dma) 458 return hwif->dma_ops->dma_test_irq(drive); 459 460 - #if 0 461 - /* need to guarantee 400ns since last command was issued */ 462 - udelay(1); 463 - #endif 464 - 465 /* 466 * We do a passive status test under shared PCI interrupts on 467 * cards that truly share the ATA side interrupt, but may also share 468 * an interrupt with another pci card/device. We make no assumptions 469 * about possible isa-pnp and pci-pnp issues yet. 470 */ 471 - if (hwif->io_ports.ctl_addr) 472 stat = hwif->tp_ops->read_altstatus(hwif); 473 else 474 /* Note: this may clear a pending IRQ!! */ ··· 606 { "TSSTcorp CDDVDW SH-S202N" , "SB01" }, 607 { "TSSTcorp CDDVDW SH-S202H" , "SB00" }, 608 { "TSSTcorp CDDVDW SH-S202H" , "SB01" }, 609 { NULL , NULL } 610 }; 611
··· 457 if (drive->waiting_for_dma) 458 return hwif->dma_ops->dma_test_irq(drive); 459 460 /* 461 * We do a passive status test under shared PCI interrupts on 462 * cards that truly share the ATA side interrupt, but may also share 463 * an interrupt with another pci card/device. We make no assumptions 464 * about possible isa-pnp and pci-pnp issues yet. 465 */ 466 + if (hwif->io_ports.ctl_addr && 467 + (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) 468 stat = hwif->tp_ops->read_altstatus(hwif); 469 else 470 /* Note: this may clear a pending IRQ!! */ ··· 610 { "TSSTcorp CDDVDW SH-S202N" , "SB01" }, 611 { "TSSTcorp CDDVDW SH-S202H" , "SB00" }, 612 { "TSSTcorp CDDVDW SH-S202H" , "SB01" }, 613 + { "SAMSUNG SP0822N" , "WA100-10" }, 614 { NULL , NULL } 615 }; 616
+2 -1
drivers/ide/ide-probe.c
··· 266 /* take a deep breath */ 267 msleep(50); 268 269 - if (io_ports->ctl_addr) { 270 a = tp_ops->read_altstatus(hwif); 271 s = tp_ops->read_status(hwif); 272 if ((a ^ s) & ~ATA_IDX)
··· 266 /* take a deep breath */ 267 msleep(50); 268 269 + if (io_ports->ctl_addr && 270 + (hwif->host_flags & IDE_HFLAG_BROKEN_ALTSTATUS) == 0) { 271 a = tp_ops->read_altstatus(hwif); 272 s = tp_ops->read_status(hwif); 273 if ((a ^ s) & ~ATA_IDX)
+8
include/linux/ide.h
··· 1296 #define ide_pci_register_driver(d) pci_register_driver(d) 1297 #endif 1298 1299 void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, 1300 hw_regs_t *, hw_regs_t **); 1301 void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); ··· 1382 IDE_HFLAG_IO_32BIT = (1 << 24), 1383 /* unmask IRQs */ 1384 IDE_HFLAG_UNMASK_IRQS = (1 << 25), 1385 /* serialize ports if DMA is possible (for sl82c105) */ 1386 IDE_HFLAG_SERIALIZE_DMA = (1 << 27), 1387 /* force host out of "simplex" mode */
··· 1296 #define ide_pci_register_driver(d) pci_register_driver(d) 1297 #endif 1298 1299 + static inline int ide_pci_is_in_compatibility_mode(struct pci_dev *dev) 1300 + { 1301 + if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 5) != 5) 1302 + return 1; 1303 + return 0; 1304 + } 1305 + 1306 void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, 1307 hw_regs_t *, hw_regs_t **); 1308 void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); ··· 1375 IDE_HFLAG_IO_32BIT = (1 << 24), 1376 /* unmask IRQs */ 1377 IDE_HFLAG_UNMASK_IRQS = (1 << 25), 1378 + IDE_HFLAG_BROKEN_ALTSTATUS = (1 << 26), 1379 /* serialize ports if DMA is possible (for sl82c105) */ 1380 IDE_HFLAG_SERIALIZE_DMA = (1 << 27), 1381 /* force host out of "simplex" mode */