Commit ec4e4a6
amd64-agp: convert to generic power management
Convert amd64-agp from legacy PCI power management to the generic power
management framework.
Previously, amd64-agp used legacy PCI power management, and
agp_amd64_suspend() and agp_amd64_resume() were responsible for both
device-specific things and generic PCI things:
agp_amd64_suspend
pci_save_state(pdev) <-- generic PCI
pci_set_power_state(pdev, pci_choose_state(pdev, state)) <-- generic PCI
agp_amd64_resume
pci_set_power_state(pdev, PCI_D0) <-- generic PCI
pci_restore_state(pdev) <-- generic PCI
nforce3_agp_init() <-- device-specific
amd_8151_configure() <-- device-specific
With generic power management, the PCI bus PM methods do the generic PCI
things, and the driver needs only the device-specific part, i.e.,
suspend_devices_and_enter
dpm_suspend_start(PMSG_SUSPEND)
pci_pm_suspend # PCI bus .suspend() method
agp_amd64_suspend <-- not needed at all; removed
suspend_enter
dpm_suspend_noirq(PMSG_SUSPEND)
pci_pm_suspend_noirq # PCI bus .suspend_noirq() method
pci_save_state <-- generic PCI
pci_prepare_to_sleep <-- generic PCI
pci_set_power_state
...
dpm_resume_end(PMSG_RESUME)
pci_pm_resume # PCI bus .resume() method
pci_restore_standard_config
pci_set_power_state(PCI_D0) <-- generic PCI
pci_restore_state <-- generic PCI
agp_amd64_resume # dev->driver->pm->resume
nforce3_agp_init() <-- device-specific
amd_8151_configure() <-- device-specific
[bhelgaas: commit log]
Link: https://lore.kernel.org/r/20211208193305.147072-2-helgaas@kernel.org
Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Dave Airlie <airlied@redhat.com>1 parent fa55b7d commit ec4e4a6
1 file changed
Lines changed: 6 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
591 | | - | |
| 591 | + | |
592 | 592 | | |
593 | | - | |
| 593 | + | |
594 | 594 | | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
| 595 | + | |
605 | 596 | | |
606 | 597 | | |
607 | 598 | | |
608 | 599 | | |
609 | 600 | | |
610 | 601 | | |
611 | 602 | | |
612 | | - | |
613 | | - | |
614 | 603 | | |
615 | 604 | | |
616 | 605 | | |
| |||
738 | 727 | | |
739 | 728 | | |
740 | 729 | | |
| 730 | + | |
| 731 | + | |
741 | 732 | | |
742 | 733 | | |
743 | 734 | | |
744 | 735 | | |
745 | 736 | | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
| 737 | + | |
750 | 738 | | |
751 | 739 | | |
752 | 740 | | |
| |||
0 commit comments