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