Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
libata: add CONFIG_PM to libata core layer
libata: add missing CONFIG_PM in LLDs
libata: add missing PM callbacks
pata_qdi: Fix initialisation
[libata] pata_cmd64x: fix driver description in comments
[libata] pata_{legacy,sc1200,sl82c105}: add missing hooks
[libata] change master/slave IDENTIFY order
libata-core: Fix simplex handling

+299 -14
+14
drivers/ata/ahci.c
··· 219 219 static void ahci_error_handler(struct ata_port *ap); 220 220 static void ahci_vt8251_error_handler(struct ata_port *ap); 221 221 static void ahci_post_internal_cmd(struct ata_queued_cmd *qc); 222 + #ifdef CONFIG_PM 222 223 static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg); 223 224 static int ahci_port_resume(struct ata_port *ap); 224 225 static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); 225 226 static int ahci_pci_device_resume(struct pci_dev *pdev); 227 + #endif 226 228 227 229 static struct scsi_host_template ahci_sht = { 228 230 .module = THIS_MODULE, ··· 243 241 .slave_configure = ata_scsi_slave_config, 244 242 .slave_destroy = ata_scsi_slave_destroy, 245 243 .bios_param = ata_std_bios_param, 244 + #ifdef CONFIG_PM 246 245 .suspend = ata_scsi_device_suspend, 247 246 .resume = ata_scsi_device_resume, 247 + #endif 248 248 }; 249 249 250 250 static const struct ata_port_operations ahci_ops = { ··· 275 271 .error_handler = ahci_error_handler, 276 272 .post_internal_cmd = ahci_post_internal_cmd, 277 273 274 + #ifdef CONFIG_PM 278 275 .port_suspend = ahci_port_suspend, 279 276 .port_resume = ahci_port_resume, 277 + #endif 280 278 281 279 .port_start = ahci_port_start, 282 280 .port_stop = ahci_port_stop, ··· 310 304 .error_handler = ahci_vt8251_error_handler, 311 305 .post_internal_cmd = ahci_post_internal_cmd, 312 306 307 + #ifdef CONFIG_PM 313 308 .port_suspend = ahci_port_suspend, 314 309 .port_resume = ahci_port_resume, 310 + #endif 315 311 316 312 .port_start = ahci_port_start, 317 313 .port_stop = ahci_port_stop, ··· 444 436 .id_table = ahci_pci_tbl, 445 437 .probe = ahci_init_one, 446 438 .remove = ata_pci_remove_one, 439 + #ifdef CONFIG_PM 447 440 .suspend = ahci_pci_device_suspend, 448 441 .resume = ahci_pci_device_resume, 442 + #endif 449 443 }; 450 444 451 445 ··· 587 577 writel(cmd | PORT_CMD_ICC_ACTIVE, port_mmio + PORT_CMD); 588 578 } 589 579 580 + #ifdef CONFIG_PM 590 581 static void ahci_power_down(void __iomem *port_mmio, u32 cap) 591 582 { 592 583 u32 cmd, scontrol; ··· 605 594 cmd &= ~PORT_CMD_SPIN_UP; 606 595 writel(cmd, port_mmio + PORT_CMD); 607 596 } 597 + #endif 608 598 609 599 static void ahci_init_port(void __iomem *port_mmio, u32 cap, 610 600 dma_addr_t cmd_slot_dma, dma_addr_t rx_fis_dma) ··· 1347 1335 } 1348 1336 } 1349 1337 1338 + #ifdef CONFIG_PM 1350 1339 static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg) 1351 1340 { 1352 1341 struct ahci_host_priv *hpriv = ap->host->private_data; ··· 1426 1413 1427 1414 return 0; 1428 1415 } 1416 + #endif 1429 1417 1430 1418 static int ahci_port_start(struct ata_port *ap) 1431 1419 {
+4
drivers/ata/ata_generic.c
··· 119 119 .slave_configure = ata_scsi_slave_config, 120 120 .slave_destroy = ata_scsi_slave_destroy, 121 121 .bios_param = ata_std_bios_param, 122 + #ifdef CONFIG_PM 122 123 .resume = ata_scsi_device_resume, 123 124 .suspend = ata_scsi_device_suspend, 125 + #endif 124 126 }; 125 127 126 128 static struct ata_port_operations generic_port_ops = { ··· 232 230 .id_table = ata_generic, 233 231 .probe = ata_generic_init_one, 234 232 .remove = ata_pci_remove_one, 233 + #ifdef CONFIG_PM 235 234 .suspend = ata_pci_device_suspend, 236 235 .resume = ata_pci_device_resume, 236 + #endif 237 237 }; 238 238 239 239 static int __init ata_generic_init(void)
+4
drivers/ata/ata_piix.c
··· 253 253 .id_table = piix_pci_tbl, 254 254 .probe = piix_init_one, 255 255 .remove = ata_pci_remove_one, 256 + #ifdef CONFIG_PM 256 257 .suspend = ata_pci_device_suspend, 257 258 .resume = ata_pci_device_resume, 259 + #endif 258 260 }; 259 261 260 262 static struct scsi_host_template piix_sht = { ··· 275 273 .slave_configure = ata_scsi_slave_config, 276 274 .slave_destroy = ata_scsi_slave_destroy, 277 275 .bios_param = ata_std_bios_param, 276 + #ifdef CONFIG_PM 278 277 .resume = ata_scsi_device_resume, 279 278 .suspend = ata_scsi_device_suspend, 279 + #endif 280 280 }; 281 281 282 282 static const struct ata_port_operations piix_pata_ops = {
+27 -5
drivers/ata/libata-core.c
··· 1850 1850 for (i = 0; i < ATA_MAX_DEVICES; i++) 1851 1851 ap->device[i].pio_mode = XFER_PIO_0; 1852 1852 1853 - /* read IDENTIFY page and configure devices */ 1854 - for (i = 0; i < ATA_MAX_DEVICES; i++) { 1853 + /* read IDENTIFY page and configure devices. We have to do the identify 1854 + specific sequence bass-ackwards so that PDIAG- is released by 1855 + the slave device */ 1856 + 1857 + for (i = ATA_MAX_DEVICES - 1; i >= 0; i--) { 1855 1858 dev = &ap->device[i]; 1856 1859 1857 1860 if (tries[i]) ··· 1867 1864 dev->id); 1868 1865 if (rc) 1869 1866 goto fail; 1867 + } 1868 + 1869 + /* After the identify sequence we can now set up the devices. We do 1870 + this in the normal order so that the user doesn't get confused */ 1871 + 1872 + for(i = 0; i < ATA_MAX_DEVICES; i++) { 1873 + dev = &ap->device[i]; 1874 + if (!ata_dev_enabled(dev)) 1875 + continue; 1870 1876 1871 1877 ap->eh_context.i.flags |= ATA_EHI_PRINTINFO; 1872 1878 rc = ata_dev_configure(dev); ··· 2568 2556 * host channels are not permitted to do so. 2569 2557 */ 2570 2558 if (used_dma && (ap->host->flags & ATA_HOST_SIMPLEX)) 2571 - ap->host->simplex_claimed = 1; 2559 + ap->host->simplex_claimed = ap; 2572 2560 2573 2561 /* step5: chip specific finalisation */ 2574 2562 if (ap->ops->post_set_mode) 2575 2563 ap->ops->post_set_mode(ap); 2576 - 2577 2564 out: 2578 2565 if (rc) 2579 2566 *r_failed_dev = dev; ··· 3455 3444 "device is on DMA blacklist, disabling DMA\n"); 3456 3445 } 3457 3446 3458 - if ((host->flags & ATA_HOST_SIMPLEX) && host->simplex_claimed) { 3447 + if ((host->flags & ATA_HOST_SIMPLEX) && host->simplex_claimed != ap) { 3459 3448 xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); 3460 3449 ata_dev_printk(dev, KERN_WARNING, "simplex DMA is claimed by " 3461 3450 "other device, disabling DMA\n"); ··· 5354 5343 return 0; 5355 5344 } 5356 5345 5346 + #ifdef CONFIG_PM 5357 5347 static int ata_host_request_pm(struct ata_host *host, pm_message_t mesg, 5358 5348 unsigned int action, unsigned int ehi_flags, 5359 5349 int wait) ··· 5470 5458 ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, 0); 5471 5459 host->dev->power.power_state = PMSG_ON; 5472 5460 } 5461 + #endif 5473 5462 5474 5463 /** 5475 5464 * ata_port_start - Set port up for dma. ··· 6106 6093 return (tmp == bits->val) ? 1 : 0; 6107 6094 } 6108 6095 6096 + #ifdef CONFIG_PM 6109 6097 void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg) 6110 6098 { 6111 6099 pci_save_state(pdev); ··· 6158 6144 ata_host_resume(host); 6159 6145 return rc; 6160 6146 } 6147 + #endif /* CONFIG_PM */ 6148 + 6161 6149 #endif /* CONFIG_PCI */ 6162 6150 6163 6151 ··· 6368 6352 EXPORT_SYMBOL_GPL(sata_scr_write_flush); 6369 6353 EXPORT_SYMBOL_GPL(ata_port_online); 6370 6354 EXPORT_SYMBOL_GPL(ata_port_offline); 6355 + #ifdef CONFIG_PM 6371 6356 EXPORT_SYMBOL_GPL(ata_host_suspend); 6372 6357 EXPORT_SYMBOL_GPL(ata_host_resume); 6358 + #endif /* CONFIG_PM */ 6373 6359 EXPORT_SYMBOL_GPL(ata_id_string); 6374 6360 EXPORT_SYMBOL_GPL(ata_id_c_string); 6375 6361 EXPORT_SYMBOL_GPL(ata_id_to_dma_mode); ··· 6387 6369 EXPORT_SYMBOL_GPL(ata_pci_init_native_mode); 6388 6370 EXPORT_SYMBOL_GPL(ata_pci_init_one); 6389 6371 EXPORT_SYMBOL_GPL(ata_pci_remove_one); 6372 + #ifdef CONFIG_PM 6390 6373 EXPORT_SYMBOL_GPL(ata_pci_device_do_suspend); 6391 6374 EXPORT_SYMBOL_GPL(ata_pci_device_do_resume); 6392 6375 EXPORT_SYMBOL_GPL(ata_pci_device_suspend); 6393 6376 EXPORT_SYMBOL_GPL(ata_pci_device_resume); 6377 + #endif /* CONFIG_PM */ 6394 6378 EXPORT_SYMBOL_GPL(ata_pci_default_filter); 6395 6379 EXPORT_SYMBOL_GPL(ata_pci_clear_simplex); 6396 6380 #endif /* CONFIG_PCI */ 6397 6381 6382 + #ifdef CONFIG_PM 6398 6383 EXPORT_SYMBOL_GPL(ata_scsi_device_suspend); 6399 6384 EXPORT_SYMBOL_GPL(ata_scsi_device_resume); 6385 + #endif /* CONFIG_PM */ 6400 6386 6401 6387 EXPORT_SYMBOL_GPL(ata_eng_timeout); 6402 6388 EXPORT_SYMBOL_GPL(ata_port_schedule_eh);
+29
drivers/ata/libata-eh.c
··· 52 52 53 53 static void __ata_port_freeze(struct ata_port *ap); 54 54 static void ata_eh_finish(struct ata_port *ap); 55 + #ifdef CONFIG_PM 55 56 static void ata_eh_handle_port_suspend(struct ata_port *ap); 56 57 static void ata_eh_handle_port_resume(struct ata_port *ap); 58 + static int ata_eh_suspend(struct ata_port *ap, 59 + struct ata_device **r_failed_dev); 60 + static void ata_eh_prep_resume(struct ata_port *ap); 61 + static int ata_eh_resume(struct ata_port *ap, struct ata_device **r_failed_dev); 62 + #else /* CONFIG_PM */ 63 + static void ata_eh_handle_port_suspend(struct ata_port *ap) 64 + { } 65 + 66 + static void ata_eh_handle_port_resume(struct ata_port *ap) 67 + { } 68 + 69 + static int ata_eh_suspend(struct ata_port *ap, struct ata_device **r_failed_dev) 70 + { 71 + return 0; 72 + } 73 + 74 + static void ata_eh_prep_resume(struct ata_port *ap) 75 + { } 76 + 77 + static int ata_eh_resume(struct ata_port *ap, struct ata_device **r_failed_dev) 78 + { 79 + return 0; 80 + } 81 + #endif /* CONFIG_PM */ 57 82 58 83 static void ata_ering_record(struct ata_ering *ering, int is_io, 59 84 unsigned int err_mask) ··· 1815 1790 return rc; 1816 1791 } 1817 1792 1793 + #ifdef CONFIG_PM 1818 1794 /** 1819 1795 * ata_eh_suspend - handle suspend EH action 1820 1796 * @ap: target host port ··· 1973 1947 DPRINTK("EXIT\n"); 1974 1948 return 0; 1975 1949 } 1950 + #endif /* CONFIG_PM */ 1976 1951 1977 1952 static int ata_port_nr_enabled(struct ata_port *ap) 1978 1953 { ··· 2276 2249 ata_eh_finish(ap); 2277 2250 } 2278 2251 2252 + #ifdef CONFIG_PM 2279 2253 /** 2280 2254 * ata_eh_handle_port_suspend - perform port suspend operation 2281 2255 * @ap: port to suspend ··· 2392 2364 } 2393 2365 spin_unlock_irqrestore(ap->lock, flags); 2394 2366 } 2367 + #endif /* CONFIG_PM */
+2
drivers/ata/libata-scsi.c
··· 510 510 } 511 511 } 512 512 513 + #ifdef CONFIG_PM 513 514 /** 514 515 * ata_scsi_device_suspend - suspend ATA device associated with sdev 515 516 * @sdev: the SCSI device to suspend ··· 635 634 sdev->sdev_gendev.power.power_state = PMSG_ON; 636 635 return 0; 637 636 } 637 + #endif /* CONFIG_PM */ 638 638 639 639 /** 640 640 * ata_to_sense_error - convert ATA error to SCSI error
+6
drivers/ata/pata_ali.c
··· 345 345 .slave_configure = ata_scsi_slave_config, 346 346 .slave_destroy = ata_scsi_slave_destroy, 347 347 .bios_param = ata_std_bios_param, 348 + #ifdef CONFIG_PM 348 349 .resume = ata_scsi_device_resume, 349 350 .suspend = ata_scsi_device_suspend, 351 + #endif 350 352 }; 351 353 352 354 /* ··· 669 667 return ata_pci_init_one(pdev, port_info, 2); 670 668 } 671 669 670 + #ifdef CONFIG_PM 672 671 static int ali_reinit_one(struct pci_dev *pdev) 673 672 { 674 673 ali_init_chipset(pdev); 675 674 return ata_pci_device_resume(pdev); 676 675 } 676 + #endif 677 677 678 678 static const struct pci_device_id ali[] = { 679 679 { PCI_VDEVICE(AL, PCI_DEVICE_ID_AL_M5228), }, ··· 689 685 .id_table = ali, 690 686 .probe = ali_init_one, 691 687 .remove = ata_pci_remove_one, 688 + #ifdef CONFIG_PM 692 689 .suspend = ata_pci_device_suspend, 693 690 .resume = ali_reinit_one, 691 + #endif 694 692 }; 695 693 696 694 static int __init ali_init(void)
+6
drivers/ata/pata_amd.c
··· 334 334 .slave_configure = ata_scsi_slave_config, 335 335 .slave_destroy = ata_scsi_slave_destroy, 336 336 .bios_param = ata_std_bios_param, 337 + #ifdef CONFIG_PM 337 338 .resume = ata_scsi_device_resume, 338 339 .suspend = ata_scsi_device_suspend, 340 + #endif 339 341 }; 340 342 341 343 static struct ata_port_operations amd33_port_ops = { ··· 665 663 return ata_pci_init_one(pdev, port_info, 2); 666 664 } 667 665 666 + #ifdef CONFIG_PM 668 667 static int amd_reinit_one(struct pci_dev *pdev) 669 668 { 670 669 if (pdev->vendor == PCI_VENDOR_ID_AMD) { ··· 682 679 } 683 680 return ata_pci_device_resume(pdev); 684 681 } 682 + #endif 685 683 686 684 static const struct pci_device_id amd[] = { 687 685 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 }, ··· 712 708 .id_table = amd, 713 709 .probe = amd_init_one, 714 710 .remove = ata_pci_remove_one, 711 + #ifdef CONFIG_PM 715 712 .suspend = ata_pci_device_suspend, 716 713 .resume = amd_reinit_one, 714 + #endif 717 715 }; 718 716 719 717 static int __init amd_init(void)
+4
drivers/ata/pata_atiixp.c
··· 224 224 .slave_configure = ata_scsi_slave_config, 225 225 .slave_destroy = ata_scsi_slave_destroy, 226 226 .bios_param = ata_std_bios_param, 227 + #ifdef CONFIG_PM 227 228 .resume = ata_scsi_device_resume, 228 229 .suspend = ata_scsi_device_suspend, 230 + #endif 229 231 }; 230 232 231 233 static struct ata_port_operations atiixp_port_ops = { ··· 292 290 .id_table = atiixp, 293 291 .probe = atiixp_init_one, 294 292 .remove = ata_pci_remove_one, 293 + #ifdef CONFIG_PM 295 294 .resume = ata_pci_device_resume, 296 295 .suspend = ata_pci_device_suspend, 296 + #endif 297 297 }; 298 298 299 299 static int __init atiixp_init(void)
+7 -1
drivers/ata/pata_cmd64x.c
··· 1 1 /* 2 - * pata_cmd64x.c - ATI PATA for new ATA layer 2 + * pata_cmd64x.c - CMD64x PATA for new ATA layer 3 3 * (C) 2005 Red Hat Inc 4 4 * Alan Cox <alan@redhat.com> 5 5 * ··· 285 285 .slave_configure = ata_scsi_slave_config, 286 286 .slave_destroy = ata_scsi_slave_destroy, 287 287 .bios_param = ata_std_bios_param, 288 + #ifdef CONFIG_PM 288 289 .resume = ata_scsi_device_resume, 289 290 .suspend = ata_scsi_device_suspend, 291 + #endif 290 292 }; 291 293 292 294 static struct ata_port_operations cmd64x_port_ops = { ··· 481 479 return ata_pci_init_one(pdev, port_info, 2); 482 480 } 483 481 482 + #ifdef CONFIG_PM 484 483 static int cmd64x_reinit_one(struct pci_dev *pdev) 485 484 { 486 485 u8 mrdmode; ··· 495 492 #endif 496 493 return ata_pci_device_resume(pdev); 497 494 } 495 + #endif 498 496 499 497 static const struct pci_device_id cmd64x[] = { 500 498 { PCI_VDEVICE(CMD, PCI_DEVICE_ID_CMD_643), 0 }, ··· 511 507 .id_table = cmd64x, 512 508 .probe = cmd64x_init_one, 513 509 .remove = ata_pci_remove_one, 510 + #ifdef CONFIG_PM 514 511 .suspend = ata_pci_device_suspend, 515 512 .resume = cmd64x_reinit_one, 513 + #endif 516 514 }; 517 515 518 516 static int __init cmd64x_init(void)
+6
drivers/ata/pata_cs5520.c
··· 167 167 .slave_configure = ata_scsi_slave_config, 168 168 .slave_destroy = ata_scsi_slave_destroy, 169 169 .bios_param = ata_std_bios_param, 170 + #ifdef CONFIG_PM 170 171 .resume = ata_scsi_device_resume, 171 172 .suspend = ata_scsi_device_suspend, 173 + #endif 172 174 }; 173 175 174 176 static struct ata_port_operations cs5520_port_ops = { ··· 310 308 ata_host_detach(host); 311 309 } 312 310 311 + #ifdef CONFIG_PM 313 312 /** 314 313 * cs5520_reinit_one - device resume 315 314 * @pdev: PCI device ··· 350 347 pci_save_state(pdev); 351 348 return 0; 352 349 } 350 + #endif /* CONFIG_PM */ 353 351 354 352 /* For now keep DMA off. We can set it for all but A rev CS5510 once the 355 353 core ATA code can handle it */ ··· 367 363 .id_table = pata_cs5520, 368 364 .probe = cs5520_init_one, 369 365 .remove = cs5520_remove_one, 366 + #ifdef CONFIG_PM 370 367 .suspend = cs5520_pci_device_suspend, 371 368 .resume = cs5520_reinit_one, 369 + #endif 372 370 }; 373 371 374 372 static int __init cs5520_init(void)
+6
drivers/ata/pata_cs5530.c
··· 188 188 .slave_configure = ata_scsi_slave_config, 189 189 .slave_destroy = ata_scsi_slave_destroy, 190 190 .bios_param = ata_std_bios_param, 191 + #ifdef CONFIG_PM 191 192 .resume = ata_scsi_device_resume, 192 193 .suspend = ata_scsi_device_suspend, 194 + #endif 193 195 }; 194 196 195 197 static struct ata_port_operations cs5530_port_ops = { ··· 378 376 return ata_pci_init_one(pdev, port_info, 2); 379 377 } 380 378 379 + #ifdef CONFIG_PM 381 380 static int cs5530_reinit_one(struct pci_dev *pdev) 382 381 { 383 382 /* If we fail on resume we are doomed */ ··· 386 383 BUG(); 387 384 return ata_pci_device_resume(pdev); 388 385 } 386 + #endif /* CONFIG_PM */ 389 387 390 388 static const struct pci_device_id cs5530[] = { 391 389 { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5530_IDE), }, ··· 399 395 .id_table = cs5530, 400 396 .probe = cs5530_init_one, 401 397 .remove = ata_pci_remove_one, 398 + #ifdef CONFIG_PM 402 399 .suspend = ata_pci_device_suspend, 403 400 .resume = cs5530_reinit_one, 401 + #endif 404 402 }; 405 403 406 404 static int __init cs5530_init(void)
+4
drivers/ata/pata_cs5535.c
··· 185 185 .slave_configure = ata_scsi_slave_config, 186 186 .slave_destroy = ata_scsi_slave_destroy, 187 187 .bios_param = ata_std_bios_param, 188 + #ifdef CONFIG_PM 188 189 .resume = ata_scsi_device_resume, 189 190 .suspend = ata_scsi_device_suspend, 191 + #endif 190 192 }; 191 193 192 194 static struct ata_port_operations cs5535_port_ops = { ··· 272 270 .id_table = cs5535, 273 271 .probe = cs5535_init_one, 274 272 .remove = ata_pci_remove_one, 273 + #ifdef CONFIG_PM 275 274 .suspend = ata_pci_device_suspend, 276 275 .resume = ata_pci_device_resume, 276 + #endif 277 277 }; 278 278 279 279 static int __init cs5535_init(void)
+4
drivers/ata/pata_cypress.c
··· 136 136 .slave_configure = ata_scsi_slave_config, 137 137 .slave_destroy = ata_scsi_slave_destroy, 138 138 .bios_param = ata_std_bios_param, 139 + #ifdef CONFIG_PM 139 140 .resume = ata_scsi_device_resume, 140 141 .suspend = ata_scsi_device_suspend, 142 + #endif 141 143 }; 142 144 143 145 static struct ata_port_operations cy82c693_port_ops = { ··· 208 206 .id_table = cy82c693, 209 207 .probe = cy82c693_init_one, 210 208 .remove = ata_pci_remove_one, 209 + #ifdef CONFIG_PM 211 210 .suspend = ata_pci_device_suspend, 212 211 .resume = ata_pci_device_resume, 212 + #endif 213 213 }; 214 214 215 215 static int __init cy82c693_init(void)
+4
drivers/ata/pata_efar.c
··· 234 234 .slave_configure = ata_scsi_slave_config, 235 235 .slave_destroy = ata_scsi_slave_destroy, 236 236 .bios_param = ata_std_bios_param, 237 + #ifdef CONFIG_PM 237 238 .resume = ata_scsi_device_resume, 238 239 .suspend = ata_scsi_device_suspend, 240 + #endif 239 241 }; 240 242 241 243 static const struct ata_port_operations efar_ops = { ··· 319 317 .id_table = efar_pci_tbl, 320 318 .probe = efar_init_one, 321 319 .remove = ata_pci_remove_one, 320 + #ifdef CONFIG_PM 322 321 .suspend = ata_pci_device_suspend, 323 322 .resume = ata_pci_device_resume, 323 + #endif 324 324 }; 325 325 326 326 static int __init efar_init(void)
+6 -1
drivers/ata/pata_hpt366.c
··· 328 328 .slave_configure = ata_scsi_slave_config, 329 329 .slave_destroy = ata_scsi_slave_destroy, 330 330 .bios_param = ata_std_bios_param, 331 + #ifdef CONFIG_PM 331 332 .resume = ata_scsi_device_resume, 332 333 .suspend = ata_scsi_device_suspend, 334 + #endif 333 335 }; 334 336 335 337 /* ··· 459 457 return ata_pci_init_one(dev, port_info, 2); 460 458 } 461 459 460 + #ifdef CONFIG_PM 462 461 static int hpt36x_reinit_one(struct pci_dev *dev) 463 462 { 464 463 hpt36x_init_chipset(dev); 465 464 return ata_pci_device_resume(dev); 466 465 } 467 - 466 + #endif 468 467 469 468 static const struct pci_device_id hpt36x[] = { 470 469 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT366), }, ··· 477 474 .id_table = hpt36x, 478 475 .probe = hpt36x_init_one, 479 476 .remove = ata_pci_remove_one, 477 + #ifdef CONFIG_PM 480 478 .suspend = ata_pci_device_suspend, 481 479 .resume = hpt36x_reinit_one, 480 + #endif 482 481 }; 483 482 484 483 static int __init hpt36x_init(void)
+6
drivers/ata/pata_hpt3x3.c
··· 119 119 .slave_configure = ata_scsi_slave_config, 120 120 .slave_destroy = ata_scsi_slave_destroy, 121 121 .bios_param = ata_std_bios_param, 122 + #ifdef CONFIG_PM 122 123 .resume = ata_scsi_device_resume, 123 124 .suspend = ata_scsi_device_suspend, 125 + #endif 124 126 }; 125 127 126 128 static struct ata_port_operations hpt3x3_port_ops = { ··· 208 206 return ata_pci_init_one(dev, port_info, 2); 209 207 } 210 208 209 + #ifdef CONFIG_PM 211 210 static int hpt3x3_reinit_one(struct pci_dev *dev) 212 211 { 213 212 hpt3x3_init_chipset(dev); 214 213 return ata_pci_device_resume(dev); 215 214 } 215 + #endif 216 216 217 217 static const struct pci_device_id hpt3x3[] = { 218 218 { PCI_VDEVICE(TTI, PCI_DEVICE_ID_TTI_HPT343), }, ··· 227 223 .id_table = hpt3x3, 228 224 .probe = hpt3x3_init_one, 229 225 .remove = ata_pci_remove_one, 226 + #ifdef CONFIG_PM 230 227 .suspend = ata_pci_device_suspend, 231 228 .resume = hpt3x3_reinit_one, 229 + #endif 232 230 }; 233 231 234 232 static int __init hpt3x3_init(void)
+4
drivers/ata/pata_it8213.c
··· 246 246 .dma_boundary = ATA_DMA_BOUNDARY, 247 247 .slave_configure = ata_scsi_slave_config, 248 248 .bios_param = ata_std_bios_param, 249 + #ifdef CONFIG_PM 249 250 .resume = ata_scsi_device_resume, 250 251 .suspend = ata_scsi_device_suspend, 252 + #endif 251 253 }; 252 254 253 255 static const struct ata_port_operations it8213_ops = { ··· 332 330 .id_table = it8213_pci_tbl, 333 331 .probe = it8213_init_one, 334 332 .remove = ata_pci_remove_one, 333 + #ifdef CONFIG_PM 335 334 .suspend = ata_pci_device_suspend, 336 335 .resume = ata_pci_device_resume, 336 + #endif 337 337 }; 338 338 339 339 static int __init it8213_init(void)
+6
drivers/ata/pata_it821x.c
··· 646 646 .slave_configure = ata_scsi_slave_config, 647 647 .slave_destroy = ata_scsi_slave_destroy, 648 648 .bios_param = ata_std_bios_param, 649 + #ifdef CONFIG_PM 649 650 .resume = ata_scsi_device_resume, 650 651 .suspend = ata_scsi_device_suspend, 652 + #endif 651 653 }; 652 654 653 655 static struct ata_port_operations it821x_smart_port_ops = { ··· 782 780 return ata_pci_init_one(pdev, port_info, 2); 783 781 } 784 782 783 + #ifdef CONFIG_PM 785 784 static int it821x_reinit_one(struct pci_dev *pdev) 786 785 { 787 786 /* Resume - turn raid back off if need be */ ··· 790 787 it821x_disable_raid(pdev); 791 788 return ata_pci_device_resume(pdev); 792 789 } 790 + #endif 793 791 794 792 static const struct pci_device_id it821x[] = { 795 793 { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8211), }, ··· 804 800 .id_table = it821x, 805 801 .probe = it821x_init_one, 806 802 .remove = ata_pci_remove_one, 803 + #ifdef CONFIG_PM 807 804 .suspend = ata_pci_device_suspend, 808 805 .resume = it821x_reinit_one, 806 + #endif 809 807 }; 810 808 811 809 static int __init it821x_init(void)
+7
drivers/ata/pata_jmicron.c
··· 137 137 .slave_destroy = ata_scsi_slave_destroy, 138 138 /* Use standard CHS mapping rules */ 139 139 .bios_param = ata_std_bios_param, 140 + #ifdef CONFIG_PM 141 + .suspend = ata_scsi_device_suspend, 142 + .resume = ata_scsi_device_resume, 143 + #endif 140 144 }; 141 145 142 146 static const struct ata_port_operations jmicron_ops = { ··· 229 225 .id_table = jmicron_pci_tbl, 230 226 .probe = jmicron_init_one, 231 227 .remove = ata_pci_remove_one, 228 + #ifdef CONFIG_PM 232 229 .suspend = ata_pci_device_suspend, 233 230 .resume = ata_pci_device_resume, 231 + #endif 234 232 }; 235 233 236 234 static int __init jmicron_init(void) ··· 244 238 { 245 239 pci_unregister_driver(&jmicron_pci_driver); 246 240 } 241 + #endif 247 242 248 243 module_init(jmicron_init); 249 244 module_exit(jmicron_exit);
+18
drivers/ata/pata_legacy.c
··· 186 186 .exec_command = ata_exec_command, 187 187 .dev_select = ata_std_dev_select, 188 188 189 + .freeze = ata_bmdma_freeze, 190 + .thaw = ata_bmdma_thaw, 189 191 .error_handler = ata_bmdma_error_handler, 192 + .post_internal_cmd = ata_bmdma_post_internal_cmd, 190 193 191 194 .qc_prep = ata_qc_prep, 192 195 .qc_issue = ata_qc_issue_prot, ··· 301 298 .exec_command = ata_exec_command, 302 299 .dev_select = ata_std_dev_select, 303 300 301 + .freeze = ata_bmdma_freeze, 302 + .thaw = ata_bmdma_thaw, 304 303 .error_handler = ata_bmdma_error_handler, 304 + .post_internal_cmd = ata_bmdma_post_internal_cmd, 305 305 306 306 .qc_prep = ata_qc_prep, 307 307 .qc_issue = ata_qc_issue_prot, ··· 356 350 .exec_command = ata_exec_command, 357 351 .dev_select = ata_std_dev_select, 358 352 353 + .freeze = ata_bmdma_freeze, 354 + .thaw = ata_bmdma_thaw, 359 355 .error_handler = ata_bmdma_error_handler, 356 + .post_internal_cmd = ata_bmdma_post_internal_cmd, 360 357 361 358 .qc_prep = ata_qc_prep, 362 359 .qc_issue = ata_qc_issue_prot, ··· 422 413 .exec_command = ata_exec_command, 423 414 .dev_select = ata_std_dev_select, 424 415 416 + .freeze = ata_bmdma_freeze, 417 + .thaw = ata_bmdma_thaw, 425 418 .error_handler = ata_bmdma_error_handler, 419 + .post_internal_cmd = ata_bmdma_post_internal_cmd, 426 420 427 421 .qc_prep = ata_qc_prep, 428 422 .qc_issue = ata_qc_issue_prot, ··· 543 531 .exec_command = ata_exec_command, 544 532 .dev_select = ata_std_dev_select, 545 533 534 + .freeze = ata_bmdma_freeze, 535 + .thaw = ata_bmdma_thaw, 546 536 .error_handler = ata_bmdma_error_handler, 537 + .post_internal_cmd = ata_bmdma_post_internal_cmd, 547 538 548 539 .qc_prep = ata_qc_prep, 549 540 .qc_issue = ata_qc_issue_prot, ··· 676 661 .exec_command = ata_exec_command, 677 662 .dev_select = ata_std_dev_select, 678 663 664 + .freeze = ata_bmdma_freeze, 665 + .thaw = ata_bmdma_thaw, 679 666 .error_handler = ata_bmdma_error_handler, 667 + .post_internal_cmd = ata_bmdma_post_internal_cmd, 680 668 681 669 .qc_prep = ata_qc_prep, 682 670 .qc_issue = opti82c46x_qc_issue_prot,
+4
drivers/ata/pata_marvell.c
··· 103 103 .slave_destroy = ata_scsi_slave_destroy, 104 104 /* Use standard CHS mapping rules */ 105 105 .bios_param = ata_std_bios_param, 106 + #ifdef CONFIG_PM 106 107 .resume = ata_scsi_device_resume, 107 108 .suspend = ata_scsi_device_suspend, 109 + #endif 108 110 }; 109 111 110 112 static const struct ata_port_operations marvell_ops = { ··· 201 199 .id_table = marvell_pci_tbl, 202 200 .probe = marvell_init_one, 203 201 .remove = ata_pci_remove_one, 202 + #ifdef CONFIG_PM 204 203 .suspend = ata_pci_device_suspend, 205 204 .resume = ata_pci_device_resume, 205 + #endif 206 206 }; 207 207 208 208 static int __init marvell_init(void)
+4
drivers/ata/pata_mpc52xx.c
··· 280 280 .dma_boundary = ATA_DMA_BOUNDARY, 281 281 .slave_configure = ata_scsi_slave_config, 282 282 .bios_param = ata_std_bios_param, 283 + #ifdef CONFIG_PM 284 + .suspend = ata_scsi_device_suspend, 285 + .resume = ata_scsi_device_resume, 286 + #endif 283 287 }; 284 288 285 289 static struct ata_port_operations mpc52xx_ata_port_ops = {
+4
drivers/ata/pata_mpiix.c
··· 165 165 .slave_configure = ata_scsi_slave_config, 166 166 .slave_destroy = ata_scsi_slave_destroy, 167 167 .bios_param = ata_std_bios_param, 168 + #ifdef CONFIG_PM 168 169 .resume = ata_scsi_device_resume, 169 170 .suspend = ata_scsi_device_suspend, 171 + #endif 170 172 }; 171 173 172 174 static struct ata_port_operations mpiix_port_ops = { ··· 272 270 .id_table = mpiix, 273 271 .probe = mpiix_init_one, 274 272 .remove = ata_pci_remove_one, 273 + #ifdef CONFIG_PM 275 274 .suspend = ata_pci_device_suspend, 276 275 .resume = ata_pci_device_resume, 276 + #endif 277 277 }; 278 278 279 279 static int __init mpiix_init(void)
+4
drivers/ata/pata_netcell.c
··· 63 63 .slave_destroy = ata_scsi_slave_destroy, 64 64 /* Use standard CHS mapping rules */ 65 65 .bios_param = ata_std_bios_param, 66 + #ifdef CONFIG_PM 66 67 .resume = ata_scsi_device_resume, 67 68 .suspend = ata_scsi_device_suspend, 69 + #endif 68 70 }; 69 71 70 72 static const struct ata_port_operations netcell_ops = { ··· 155 153 .id_table = netcell_pci_tbl, 156 154 .probe = netcell_init_one, 157 155 .remove = ata_pci_remove_one, 156 + #ifdef CONFIG_PM 158 157 .suspend = ata_pci_device_suspend, 159 158 .resume = ata_pci_device_resume, 159 + #endif 160 160 }; 161 161 162 162 static int __init netcell_init(void)
+4
drivers/ata/pata_ns87410.c
··· 157 157 .slave_configure = ata_scsi_slave_config, 158 158 .slave_destroy = ata_scsi_slave_destroy, 159 159 .bios_param = ata_std_bios_param, 160 + #ifdef CONFIG_PM 160 161 .resume = ata_scsi_device_resume, 161 162 .suspend = ata_scsi_device_suspend, 163 + #endif 162 164 }; 163 165 164 166 static struct ata_port_operations ns87410_port_ops = { ··· 214 212 .id_table = ns87410, 215 213 .probe = ns87410_init_one, 216 214 .remove = ata_pci_remove_one, 215 + #ifdef CONFIG_PM 217 216 .suspend = ata_pci_device_suspend, 218 217 .resume = ata_pci_device_resume, 218 + #endif 219 219 }; 220 220 221 221 static int __init ns87410_init(void)
+4
drivers/ata/pata_oldpiix.c
··· 233 233 .slave_configure = ata_scsi_slave_config, 234 234 .slave_destroy = ata_scsi_slave_destroy, 235 235 .bios_param = ata_std_bios_param, 236 + #ifdef CONFIG_PM 236 237 .resume = ata_scsi_device_resume, 237 238 .suspend = ata_scsi_device_suspend, 239 + #endif 238 240 }; 239 241 240 242 static const struct ata_port_operations oldpiix_pata_ops = { ··· 318 316 .id_table = oldpiix_pci_tbl, 319 317 .probe = oldpiix_init_one, 320 318 .remove = ata_pci_remove_one, 319 + #ifdef CONFIG_PM 321 320 .suspend = ata_pci_device_suspend, 322 321 .resume = ata_pci_device_resume, 322 + #endif 323 323 }; 324 324 325 325 static int __init oldpiix_init(void)
+4
drivers/ata/pata_opti.c
··· 179 179 .slave_configure = ata_scsi_slave_config, 180 180 .slave_destroy = ata_scsi_slave_destroy, 181 181 .bios_param = ata_std_bios_param, 182 + #ifdef CONFIG_PM 182 183 .resume = ata_scsi_device_resume, 183 184 .suspend = ata_scsi_device_suspend, 185 + #endif 184 186 }; 185 187 186 188 static struct ata_port_operations opti_port_ops = { ··· 246 244 .id_table = opti, 247 245 .probe = opti_init_one, 248 246 .remove = ata_pci_remove_one, 247 + #ifdef CONFIG_PM 249 248 .suspend = ata_pci_device_suspend, 250 249 .resume = ata_pci_device_resume, 250 + #endif 251 251 }; 252 252 253 253 static int __init opti_init(void)
+4
drivers/ata/pata_optidma.c
··· 360 360 .slave_configure = ata_scsi_slave_config, 361 361 .slave_destroy = ata_scsi_slave_destroy, 362 362 .bios_param = ata_std_bios_param, 363 + #ifdef CONFIG_PM 363 364 .resume = ata_scsi_device_resume, 364 365 .suspend = ata_scsi_device_suspend, 366 + #endif 365 367 }; 366 368 367 369 static struct ata_port_operations optidma_port_ops = { ··· 526 524 .id_table = optidma, 527 525 .probe = optidma_init_one, 528 526 .remove = ata_pci_remove_one, 527 + #ifdef CONFIG_PM 529 528 .suspend = ata_pci_device_suspend, 530 529 .resume = ata_pci_device_resume, 530 + #endif 531 531 }; 532 532 533 533 static int __init optidma_init(void)
+4
drivers/ata/pata_pdc202xx_old.c
··· 267 267 .slave_configure = ata_scsi_slave_config, 268 268 .slave_destroy = ata_scsi_slave_destroy, 269 269 .bios_param = ata_std_bios_param, 270 + #ifdef CONFIG_PM 270 271 .resume = ata_scsi_device_resume, 271 272 .suspend = ata_scsi_device_suspend, 273 + #endif 272 274 }; 273 275 274 276 static struct ata_port_operations pdc2024x_port_ops = { ··· 401 399 .id_table = pdc202xx, 402 400 .probe = pdc202xx_init_one, 403 401 .remove = ata_pci_remove_one, 402 + #ifdef CONFIG_PM 404 403 .suspend = ata_pci_device_suspend, 405 404 .resume = ata_pci_device_resume, 405 + #endif 406 406 }; 407 407 408 408 static int __init pdc202xx_init(void)
+8 -4
drivers/ata/pata_qdi.c
··· 363 363 release_region(port, 2); 364 364 continue; 365 365 } 366 - ct += qdi_init_one(port, 6500, ide_port[r & 0x01], ide_irq[r & 0x01], r & 0x04); 366 + if (qdi_init_one(port, 6500, ide_port[r & 0x01], ide_irq[r & 0x01], r & 0x04) == 0) 367 + ct++; 367 368 } 368 369 if (((r & 0xF0) == 0xA0) || (r & 0xF0) == 0x50) { 369 370 /* QD6580: dual channel */ ··· 376 375 res = inb(port + 3); 377 376 if (res & 1) { 378 377 /* Single channel mode */ 379 - ct += qdi_init_one(port, 6580, ide_port[r & 0x01], ide_irq[r & 0x01], r & 0x04); 378 + if (qdi_init_one(port, 6580, ide_port[r & 0x01], ide_irq[r & 0x01], r & 0x04)) 379 + ct++; 380 380 } else { 381 381 /* Dual channel mode */ 382 - ct += qdi_init_one(port, 6580, 0x1F0, 14, r & 0x04); 383 - ct += qdi_init_one(port + 2, 6580, 0x170, 15, r & 0x04); 382 + if (qdi_init_one(port, 6580, 0x1F0, 14, r & 0x04) == 0) 383 + ct++; 384 + if (qdi_init_one(port + 2, 6580, 0x170, 15, r & 0x04) == 0) 385 + ct++; 384 386 } 385 387 } 386 388 }
+4
drivers/ata/pata_radisys.c
··· 228 228 .slave_configure = ata_scsi_slave_config, 229 229 .slave_destroy = ata_scsi_slave_destroy, 230 230 .bios_param = ata_std_bios_param, 231 + #ifdef CONFIG_PM 231 232 .resume = ata_scsi_device_resume, 232 233 .suspend = ata_scsi_device_suspend, 234 + #endif 233 235 }; 234 236 235 237 static const struct ata_port_operations radisys_pata_ops = { ··· 314 312 .id_table = radisys_pci_tbl, 315 313 .probe = radisys_init_one, 316 314 .remove = ata_pci_remove_one, 315 + #ifdef CONFIG_PM 317 316 .suspend = ata_pci_device_suspend, 318 317 .resume = ata_pci_device_resume, 318 + #endif 319 319 }; 320 320 321 321 static int __init radisys_init(void)
+6
drivers/ata/pata_rz1000.c
··· 94 94 .slave_configure = ata_scsi_slave_config, 95 95 .slave_destroy = ata_scsi_slave_destroy, 96 96 .bios_param = ata_std_bios_param, 97 + #ifdef CONFIG_PM 97 98 .resume = ata_scsi_device_resume, 98 99 .suspend = ata_scsi_device_suspend, 100 + #endif 99 101 }; 100 102 101 103 static struct ata_port_operations rz1000_port_ops = { ··· 180 178 return -ENODEV; 181 179 } 182 180 181 + #ifdef CONFIG_PM 183 182 static int rz1000_reinit_one(struct pci_dev *pdev) 184 183 { 185 184 /* If this fails on resume (which is a "cant happen" case), we ··· 189 186 panic("rz1000 fifo"); 190 187 return ata_pci_device_resume(pdev); 191 188 } 189 + #endif 192 190 193 191 static const struct pci_device_id pata_rz1000[] = { 194 192 { PCI_VDEVICE(PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000), }, ··· 203 199 .id_table = pata_rz1000, 204 200 .probe = rz1000_init_one, 205 201 .remove = ata_pci_remove_one, 202 + #ifdef CONFIG_PM 206 203 .suspend = ata_pci_device_suspend, 207 204 .resume = rz1000_reinit_one, 205 + #endif 208 206 }; 209 207 210 208 static int __init rz1000_init(void)
+7
drivers/ata/pata_sc1200.c
··· 194 194 .slave_configure = ata_scsi_slave_config, 195 195 .slave_destroy = ata_scsi_slave_destroy, 196 196 .bios_param = ata_std_bios_param, 197 + #ifdef CONFIG_PM 197 198 .resume = ata_scsi_device_resume, 198 199 .suspend = ata_scsi_device_suspend, 200 + #endif 199 201 }; 200 202 201 203 static struct ata_port_operations sc1200_port_ops = { ··· 212 210 .exec_command = ata_exec_command, 213 211 .dev_select = ata_std_dev_select, 214 212 213 + .freeze = ata_bmdma_freeze, 214 + .thaw = ata_bmdma_thaw, 215 215 .error_handler = ata_bmdma_error_handler, 216 + .post_internal_cmd = ata_bmdma_post_internal_cmd, 216 217 217 218 .bmdma_setup = ata_bmdma_setup, 218 219 .bmdma_start = ata_bmdma_start, ··· 271 266 .id_table = sc1200, 272 267 .probe = sc1200_init_one, 273 268 .remove = ata_pci_remove_one, 269 + #ifdef CONFIG_PM 274 270 .suspend = ata_pci_device_suspend, 275 271 .resume = ata_pci_device_resume, 272 + #endif 276 273 }; 277 274 278 275 static int __init sc1200_init(void)
+2
drivers/ata/pata_scc.c
··· 984 984 .slave_configure = ata_scsi_slave_config, 985 985 .slave_destroy = ata_scsi_slave_destroy, 986 986 .bios_param = ata_std_bios_param, 987 + #ifdef CONFIG_PM 987 988 .resume = ata_scsi_device_resume, 988 989 .suspend = ata_scsi_device_suspend, 990 + #endif 989 991 }; 990 992 991 993 static const struct ata_port_operations scc_pata_ops = {
+6
drivers/ata/pata_serverworks.c
··· 319 319 .slave_configure = ata_scsi_slave_config, 320 320 .slave_destroy = ata_scsi_slave_destroy, 321 321 .bios_param = ata_std_bios_param, 322 + #ifdef CONFIG_PM 322 323 .resume = ata_scsi_device_resume, 323 324 .suspend = ata_scsi_device_suspend, 325 + #endif 324 326 }; 325 327 326 328 static struct ata_port_operations serverworks_osb4_port_ops = { ··· 550 548 return ata_pci_init_one(pdev, port_info, ports); 551 549 } 552 550 551 + #ifdef CONFIG_PM 553 552 static int serverworks_reinit_one(struct pci_dev *pdev) 554 553 { 555 554 /* Force master latency timer to 64 PCI clocks */ ··· 574 571 } 575 572 return ata_pci_device_resume(pdev); 576 573 } 574 + #endif 577 575 578 576 static const struct pci_device_id serverworks[] = { 579 577 { PCI_VDEVICE(SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4IDE), 0}, ··· 591 587 .id_table = serverworks, 592 588 .probe = serverworks_init_one, 593 589 .remove = ata_pci_remove_one, 590 + #ifdef CONFIG_PM 594 591 .suspend = ata_pci_device_suspend, 595 592 .resume = serverworks_reinit_one, 593 + #endif 596 594 }; 597 595 598 596 static int __init serverworks_init(void)
+8
drivers/ata/pata_sil680.c
··· 236 236 .slave_configure = ata_scsi_slave_config, 237 237 .slave_destroy = ata_scsi_slave_destroy, 238 238 .bios_param = ata_std_bios_param, 239 + #ifdef CONFIG_PM 240 + .suspend = ata_scsi_device_suspend, 241 + .resume = ata_scsi_device_resume, 242 + #endif 239 243 }; 240 244 241 245 static struct ata_port_operations sil680_port_ops = { ··· 381 377 return ata_pci_init_one(pdev, port_info, 2); 382 378 } 383 379 380 + #ifdef CONFIG_PM 384 381 static int sil680_reinit_one(struct pci_dev *pdev) 385 382 { 386 383 sil680_init_chip(pdev); 387 384 return ata_pci_device_resume(pdev); 388 385 } 386 + #endif 389 387 390 388 static const struct pci_device_id sil680[] = { 391 389 { PCI_VDEVICE(CMD, PCI_DEVICE_ID_SII_680), }, ··· 400 394 .id_table = sil680, 401 395 .probe = sil680_init_one, 402 396 .remove = ata_pci_remove_one, 397 + #ifdef CONFIG_PM 403 398 .suspend = ata_pci_device_suspend, 404 399 .resume = sil680_reinit_one, 400 + #endif 405 401 }; 406 402 407 403 static int __init sil680_init(void)
+4
drivers/ata/pata_sis.c
··· 575 575 .slave_configure = ata_scsi_slave_config, 576 576 .slave_destroy = ata_scsi_slave_destroy, 577 577 .bios_param = ata_std_bios_param, 578 + #ifdef CONFIG_PM 578 579 .resume = ata_scsi_device_resume, 579 580 .suspend = ata_scsi_device_suspend, 581 + #endif 580 582 }; 581 583 582 584 static const struct ata_port_operations sis_133_ops = { ··· 1034 1032 .id_table = sis_pci_tbl, 1035 1033 .probe = sis_init_one, 1036 1034 .remove = ata_pci_remove_one, 1035 + #ifdef CONFIG_PM 1037 1036 .suspend = ata_pci_device_suspend, 1038 1037 .resume = ata_pci_device_resume, 1038 + #endif 1039 1039 }; 1040 1040 1041 1041 static int __init sis_init(void)
+3
drivers/ata/pata_sl82c105.c
··· 234 234 .exec_command = ata_exec_command, 235 235 .dev_select = ata_std_dev_select, 236 236 237 + .freeze = ata_bmdma_freeze, 238 + .thaw = ata_bmdma_thaw, 237 239 .error_handler = sl82c105_error_handler, 240 + .post_internal_cmd = ata_bmdma_post_internal_cmd, 238 241 239 242 .bmdma_setup = ata_bmdma_setup, 240 243 .bmdma_start = sl82c105_bmdma_start,
+4
drivers/ata/pata_triflex.c
··· 193 193 .slave_configure = ata_scsi_slave_config, 194 194 .slave_destroy = ata_scsi_slave_destroy, 195 195 .bios_param = ata_std_bios_param, 196 + #ifdef CONFIG_PM 196 197 .resume = ata_scsi_device_resume, 197 198 .suspend = ata_scsi_device_suspend, 199 + #endif 198 200 }; 199 201 200 202 static struct ata_port_operations triflex_port_ops = { ··· 262 260 .id_table = triflex, 263 261 .probe = triflex_init_one, 264 262 .remove = ata_pci_remove_one, 263 + #ifdef CONFIG_PM 265 264 .suspend = ata_pci_device_suspend, 266 265 .resume = ata_pci_device_resume, 266 + #endif 267 267 }; 268 268 269 269 static int __init triflex_init(void)
+6
drivers/ata/pata_via.c
··· 305 305 .slave_configure = ata_scsi_slave_config, 306 306 .slave_destroy = ata_scsi_slave_destroy, 307 307 .bios_param = ata_std_bios_param, 308 + #ifdef CONFIG_PM 308 309 .resume = ata_scsi_device_resume, 309 310 .suspend = ata_scsi_device_suspend, 311 + #endif 310 312 }; 311 313 312 314 static struct ata_port_operations via_port_ops = { ··· 562 560 return ata_pci_init_one(pdev, port_info, 2); 563 561 } 564 562 563 + #ifdef CONFIG_PM 565 564 /** 566 565 * via_reinit_one - reinit after resume 567 566 * @pdev; PCI device ··· 595 592 } 596 593 return ata_pci_device_resume(pdev); 597 594 } 595 + #endif 598 596 599 597 static const struct pci_device_id via[] = { 600 598 { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C576_1), }, ··· 611 607 .id_table = via, 612 608 .probe = via_init_one, 613 609 .remove = ata_pci_remove_one, 610 + #ifdef CONFIG_PM 614 611 .suspend = ata_pci_device_suspend, 615 612 .resume = via_reinit_one, 613 + #endif 616 614 }; 617 615 618 616 static int __init via_init(void)
+6 -1
drivers/ata/sata_inic162x.c
··· 135 135 .slave_configure = inic_slave_config, 136 136 .slave_destroy = ata_scsi_slave_destroy, 137 137 .bios_param = ata_std_bios_param, 138 + #ifdef CONFIG_PM 138 139 .suspend = ata_scsi_device_suspend, 139 140 .resume = ata_scsi_device_resume, 141 + #endif 140 142 }; 141 143 142 144 static const int scr_map[] = { ··· 634 632 return 0; 635 633 } 636 634 635 + #ifdef CONFIG_PM 637 636 static int inic_pci_device_resume(struct pci_dev *pdev) 638 637 { 639 638 struct ata_host *host = dev_get_drvdata(&pdev->dev); ··· 645 642 ata_pci_device_do_resume(pdev); 646 643 647 644 if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) { 648 - printk("XXX\n"); 649 645 rc = init_controller(mmio_base, hpriv->cached_hctl); 650 646 if (rc) 651 647 return rc; ··· 654 652 655 653 return 0; 656 654 } 655 + #endif 657 656 658 657 static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 659 658 { ··· 758 755 static struct pci_driver inic_pci_driver = { 759 756 .name = DRV_NAME, 760 757 .id_table = inic_pci_tbl, 758 + #ifdef CONFIG_PM 761 759 .suspend = ata_pci_device_suspend, 762 760 .resume = inic_pci_device_resume, 761 + #endif 763 762 .probe = inic_init_one, 764 763 .remove = ata_pci_remove_one, 765 764 };
+16
drivers/ata/sata_nv.c
··· 230 230 231 231 static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); 232 232 static void nv_remove_one (struct pci_dev *pdev); 233 + #ifdef CONFIG_PM 233 234 static int nv_pci_device_resume(struct pci_dev *pdev); 235 + #endif 234 236 static void nv_ck804_host_stop(struct ata_host *host); 235 237 static irqreturn_t nv_generic_interrupt(int irq, void *dev_instance); 236 238 static irqreturn_t nv_nf2_interrupt(int irq, void *dev_instance); ··· 253 251 static void nv_adma_irq_clear(struct ata_port *ap); 254 252 static int nv_adma_port_start(struct ata_port *ap); 255 253 static void nv_adma_port_stop(struct ata_port *ap); 254 + #ifdef CONFIG_PM 256 255 static int nv_adma_port_suspend(struct ata_port *ap, pm_message_t mesg); 257 256 static int nv_adma_port_resume(struct ata_port *ap); 257 + #endif 258 258 static void nv_adma_error_handler(struct ata_port *ap); 259 259 static void nv_adma_host_stop(struct ata_host *host); 260 260 static void nv_adma_post_internal_cmd(struct ata_queued_cmd *qc); ··· 299 295 .name = DRV_NAME, 300 296 .id_table = nv_pci_tbl, 301 297 .probe = nv_init_one, 298 + #ifdef CONFIG_PM 302 299 .suspend = ata_pci_device_suspend, 303 300 .resume = nv_pci_device_resume, 301 + #endif 304 302 .remove = nv_remove_one, 305 303 }; 306 304 ··· 322 316 .slave_configure = ata_scsi_slave_config, 323 317 .slave_destroy = ata_scsi_slave_destroy, 324 318 .bios_param = ata_std_bios_param, 319 + #ifdef CONFIG_PM 325 320 .suspend = ata_scsi_device_suspend, 326 321 .resume = ata_scsi_device_resume, 322 + #endif 327 323 }; 328 324 329 325 static struct scsi_host_template nv_adma_sht = { ··· 344 336 .slave_configure = nv_adma_slave_config, 345 337 .slave_destroy = ata_scsi_slave_destroy, 346 338 .bios_param = ata_std_bios_param, 339 + #ifdef CONFIG_PM 347 340 .suspend = ata_scsi_device_suspend, 348 341 .resume = ata_scsi_device_resume, 342 + #endif 349 343 }; 350 344 351 345 static const struct ata_port_operations nv_generic_ops = { ··· 459 449 .scr_write = nv_scr_write, 460 450 .port_start = nv_adma_port_start, 461 451 .port_stop = nv_adma_port_stop, 452 + #ifdef CONFIG_PM 462 453 .port_suspend = nv_adma_port_suspend, 463 454 .port_resume = nv_adma_port_resume, 455 + #endif 464 456 .host_stop = nv_adma_host_stop, 465 457 }; 466 458 ··· 1015 1003 writew(0, mmio + NV_ADMA_CTL); 1016 1004 } 1017 1005 1006 + #ifdef CONFIG_PM 1018 1007 static int nv_adma_port_suspend(struct ata_port *ap, pm_message_t mesg) 1019 1008 { 1020 1009 struct nv_adma_port_priv *pp = ap->private_data; ··· 1066 1053 1067 1054 return 0; 1068 1055 } 1056 + #endif 1069 1057 1070 1058 static void nv_adma_setup_port(struct ata_probe_ent *probe_ent, unsigned int port) 1071 1059 { ··· 1569 1555 kfree(hpriv); 1570 1556 } 1571 1557 1558 + #ifdef CONFIG_PM 1572 1559 static int nv_pci_device_resume(struct pci_dev *pdev) 1573 1560 { 1574 1561 struct ata_host *host = dev_get_drvdata(&pdev->dev); ··· 1617 1602 1618 1603 return 0; 1619 1604 } 1605 + #endif 1620 1606 1621 1607 static void nv_ck804_host_stop(struct ata_host *host) 1622 1608 {
+2
drivers/ata/sata_sil.c
··· 183 183 .slave_configure = ata_scsi_slave_config, 184 184 .slave_destroy = ata_scsi_slave_destroy, 185 185 .bios_param = ata_std_bios_param, 186 + #ifdef CONFIG_PM 186 187 .suspend = ata_scsi_device_suspend, 187 188 .resume = ata_scsi_device_resume, 189 + #endif 188 190 }; 189 191 190 192 static const struct ata_port_operations sil_ops = {
+2
drivers/ata/sata_sil24.c
··· 380 380 .slave_configure = ata_scsi_slave_config, 381 381 .slave_destroy = ata_scsi_slave_destroy, 382 382 .bios_param = ata_std_bios_param, 383 + #ifdef CONFIG_PM 383 384 .suspend = ata_scsi_device_suspend, 384 385 .resume = ata_scsi_device_resume, 386 + #endif 385 387 }; 386 388 387 389 static const struct ata_port_operations sil24_ops = {
+5 -2
include/linux/libata.h
··· 403 403 void *private_data; 404 404 const struct ata_port_operations *ops; 405 405 unsigned long flags; 406 - int simplex_claimed; /* Keep seperate in case we 407 - ever need to do this locked */ 406 + struct ata_port *simplex_claimed; /* channel owning the DMA */ 408 407 struct ata_port *ports[0]; 409 408 }; 410 409 ··· 718 719 extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, 719 720 unsigned int n_ports); 720 721 extern void ata_pci_remove_one (struct pci_dev *pdev); 722 + #ifdef CONFIG_PM 721 723 extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg); 722 724 extern int __must_check ata_pci_device_do_resume(struct pci_dev *pdev); 723 725 extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); 724 726 extern int ata_pci_device_resume(struct pci_dev *pdev); 727 + #endif 725 728 extern int ata_pci_clear_simplex(struct pci_dev *pdev); 726 729 #endif /* CONFIG_PCI */ 727 730 extern int ata_device_add(const struct ata_probe_ent *ent); ··· 749 748 extern int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val); 750 749 extern int ata_port_online(struct ata_port *ap); 751 750 extern int ata_port_offline(struct ata_port *ap); 751 + #ifdef CONFIG_PM 752 752 extern int ata_scsi_device_resume(struct scsi_device *); 753 753 extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t mesg); 754 754 extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); 755 755 extern void ata_host_resume(struct ata_host *host); 756 + #endif 756 757 extern int ata_ratelimit(void); 757 758 extern int ata_busy_sleep(struct ata_port *ap, 758 759 unsigned long timeout_pat, unsigned long timeout);