diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2009-04-27 13:33:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:44:44 -0400 |
commit | 6ec4beb5c701f728548b587082c83ef62eb36035 (patch) | |
tree | c5450f6e40f3656b5e27a0ca30adda2a16ad303f /drivers/usb/host/uhci-hcd.c | |
parent | abb306416a7ec2386678de0da6b632a6cb068af0 (diff) |
USB: new flag for resume-from-hibernation
This patch (as1237) changes the way the PCI host controller drivers
avoid retaining bogus hardware states during resume-from-hibernation.
Previously we had reset the hardware as part of preparing to reinstate
the memory image. But we can do better now with the new PM framework,
since we know exactly which resume operations are from hibernation.
The pci_resume method is changed to accept a flag indicating whether
the system is resuming from hibernation. When this flag is set, the
drivers will reset the hardware to get rid of any existing state.
Similarly, the pci_suspend method is changed to remove the
pm_message_t argument. It's no longer needed, since no special action
has to be taken when preparing to reinstate the memory image.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/uhci-hcd.c')
-rw-r--r-- | drivers/usb/host/uhci-hcd.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c index c0133211e3ec..274751b4409c 100644 --- a/drivers/usb/host/uhci-hcd.c +++ b/drivers/usb/host/uhci-hcd.c | |||
@@ -769,7 +769,7 @@ static int uhci_rh_resume(struct usb_hcd *hcd) | |||
769 | return rc; | 769 | return rc; |
770 | } | 770 | } |
771 | 771 | ||
772 | static int uhci_pci_suspend(struct usb_hcd *hcd, pm_message_t message) | 772 | static int uhci_pci_suspend(struct usb_hcd *hcd) |
773 | { | 773 | { |
774 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); | 774 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); |
775 | int rc = 0; | 775 | int rc = 0; |
@@ -795,10 +795,6 @@ static int uhci_pci_suspend(struct usb_hcd *hcd, pm_message_t message) | |||
795 | 795 | ||
796 | /* FIXME: Enable non-PME# remote wakeup? */ | 796 | /* FIXME: Enable non-PME# remote wakeup? */ |
797 | 797 | ||
798 | /* make sure snapshot being resumed re-enumerates everything */ | ||
799 | if (message.event == PM_EVENT_PRETHAW) | ||
800 | uhci_hc_died(uhci); | ||
801 | |||
802 | done_okay: | 798 | done_okay: |
803 | clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); | 799 | clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); |
804 | done: | 800 | done: |
@@ -806,7 +802,7 @@ done: | |||
806 | return rc; | 802 | return rc; |
807 | } | 803 | } |
808 | 804 | ||
809 | static int uhci_pci_resume(struct usb_hcd *hcd) | 805 | static int uhci_pci_resume(struct usb_hcd *hcd, bool hibernated) |
810 | { | 806 | { |
811 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); | 807 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); |
812 | 808 | ||
@@ -820,6 +816,10 @@ static int uhci_pci_resume(struct usb_hcd *hcd) | |||
820 | 816 | ||
821 | spin_lock_irq(&uhci->lock); | 817 | spin_lock_irq(&uhci->lock); |
822 | 818 | ||
819 | /* Make sure resume from hibernation re-enumerates everything */ | ||
820 | if (hibernated) | ||
821 | uhci_hc_died(uhci); | ||
822 | |||
823 | /* FIXME: Disable non-PME# remote wakeup? */ | 823 | /* FIXME: Disable non-PME# remote wakeup? */ |
824 | 824 | ||
825 | /* The firmware or a boot kernel may have changed the controller | 825 | /* The firmware or a boot kernel may have changed the controller |