+ pm-usb-hcds-use-pm_event_prethaw.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     PM: USB HCDs use PM_EVENT_PRETHAW

has been added to the -mm tree.  Its filename is

     pm-usb-hcds-use-pm_event_prethaw.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: PM: USB HCDs use PM_EVENT_PRETHAW
From: David Brownell <david-b@xxxxxxxxxxx>


This teaches several USB host controller drivers to treat PRETHAW as a chip
reset since the controller, and all devices connected to it, are no longer in
states compatible with how the snapshotted suspend() left them.

Signed-off-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>
Cc: Greg KH <greg@xxxxxxxxx>
Cc: "Rafael J. Wysocki" <rjw@xxxxxxx>
Cc: Pavel Machek <pavel@xxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/usb/core/hcd-pci.c   |    2 +-
 drivers/usb/core/usb.c       |    2 +-
 drivers/usb/host/ehci-pci.c  |    6 ++++++
 drivers/usb/host/ohci-pci.c  |    5 +++++
 drivers/usb/host/sl811-hcd.c |    9 +++++++--
 drivers/usb/host/uhci-hcd.c  |    4 ++++
 6 files changed, 24 insertions(+), 4 deletions(-)

diff -puN drivers/usb/core/hcd-pci.c~pm-usb-hcds-use-pm_event_prethaw drivers/usb/core/hcd-pci.c
--- 25/drivers/usb/core/hcd-pci.c~pm-usb-hcds-use-pm_event_prethaw	Tue Jun 27 14:35:54 2006
+++ 25-akpm/drivers/usb/core/hcd-pci.c	Tue Jun 27 14:35:54 2006
@@ -282,7 +282,7 @@ int usb_hcd_pci_suspend (struct pci_dev 
 			(void) usb_hcd_pci_resume (dev);
 		}
 
-	} else {
+	} else if (hcd->state != HC_STATE_HALT) {
 		dev_dbg (hcd->self.controller, "hcd state %d; not suspended\n",
 			hcd->state);
 		WARN_ON(1);
diff -puN drivers/usb/core/usb.c~pm-usb-hcds-use-pm_event_prethaw drivers/usb/core/usb.c
--- 25/drivers/usb/core/usb.c~pm-usb-hcds-use-pm_event_prethaw	Tue Jun 27 14:35:54 2006
+++ 25-akpm/drivers/usb/core/usb.c	Tue Jun 27 14:35:54 2006
@@ -1007,7 +1007,7 @@ static int usb_generic_suspend(struct de
 	 * But those semantics are useless, so we equate the two (sigh).
 	 */
 	if (dev->driver == &usb_generic_driver) {
-		if (dev->power.power_state.event == message.event)
+		if (dev->power.power_state.event != PM_EVENT_ON)
 			return 0;
 		/* we need to rule out bogus requests through sysfs */
 		status = device_for_each_child(dev, NULL, verify_suspended);
diff -puN drivers/usb/host/ehci-pci.c~pm-usb-hcds-use-pm_event_prethaw drivers/usb/host/ehci-pci.c
--- 25/drivers/usb/host/ehci-pci.c~pm-usb-hcds-use-pm_event_prethaw	Tue Jun 27 14:35:54 2006
+++ 25-akpm/drivers/usb/host/ehci-pci.c	Tue Jun 27 14:35:54 2006
@@ -238,6 +238,12 @@ static int ehci_pci_suspend(struct usb_h
 	writel (0, &ehci->regs->intr_enable);
 	(void)readl(&ehci->regs->intr_enable);
 
+	/* make sure snapshot being resumed re-enumerates everything */
+	if (message.event == PM_EVENT_PRETHAW) {
+		ehci_halt(ehci);
+		ehci_reset(ehci);
+	}
+
 	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
  bail:
 	spin_unlock_irqrestore (&ehci->lock, flags);
diff -puN drivers/usb/host/ohci-pci.c~pm-usb-hcds-use-pm_event_prethaw drivers/usb/host/ohci-pci.c
--- 25/drivers/usb/host/ohci-pci.c~pm-usb-hcds-use-pm_event_prethaw	Tue Jun 27 14:35:54 2006
+++ 25-akpm/drivers/usb/host/ohci-pci.c	Tue Jun 27 14:35:54 2006
@@ -135,6 +135,11 @@ static int ohci_pci_suspend (struct usb_
 	}
 	ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
 	(void)ohci_readl(ohci, &ohci->regs->intrdisable);
+
+	/* make sure snapshot being resumed re-enumerates everything */
+	if (message.event == PM_EVENT_PRETHAW)
+		ohci_usb_reset(ohci);
+
 	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
  bail:
 	spin_unlock_irqrestore (&ohci->lock, flags);
diff -puN drivers/usb/host/sl811-hcd.c~pm-usb-hcds-use-pm_event_prethaw drivers/usb/host/sl811-hcd.c
--- 25/drivers/usb/host/sl811-hcd.c~pm-usb-hcds-use-pm_event_prethaw	Tue Jun 27 14:35:54 2006
+++ 25-akpm/drivers/usb/host/sl811-hcd.c	Tue Jun 27 14:35:54 2006
@@ -1784,10 +1784,15 @@ sl811h_suspend(struct platform_device *d
 	struct sl811	*sl811 = hcd_to_sl811(hcd);
 	int		retval = 0;
 
-	if (state.event == PM_EVENT_FREEZE)
+	switch (state.event) {
+	case PM_EVENT_FREEZE:
 		retval = sl811h_bus_suspend(hcd);
-	else if (state.event == PM_EVENT_SUSPEND)
+		break;
+	case PM_EVENT_SUSPEND:
+	case PM_EVENT_PRETHAW:		/* explicitly discard hw state */
 		port_power(sl811, 0);
+		break;
+	}
 	if (retval == 0)
 		dev->dev.power.power_state = state;
 	return retval;
diff -puN drivers/usb/host/uhci-hcd.c~pm-usb-hcds-use-pm_event_prethaw drivers/usb/host/uhci-hcd.c
--- 25/drivers/usb/host/uhci-hcd.c~pm-usb-hcds-use-pm_event_prethaw	Tue Jun 27 14:35:54 2006
+++ 25-akpm/drivers/usb/host/uhci-hcd.c	Tue Jun 27 14:35:54 2006
@@ -735,6 +735,10 @@ static int uhci_suspend(struct usb_hcd *
 
 	/* FIXME: Enable non-PME# remote wakeup? */
 
+	/* make sure snapshot being resumed re-enumerates everything */
+	if (message.event == PM_EVENT_PRETHAW)
+		hc_died(uhci);
+
 done_okay:
 	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
 done:
_

Patches currently in -mm which might be from david-b@xxxxxxxxxxx are

origin.patch
git-pcmcia.patch
ehci-fix-bogus-alteration-of-a-local-variable.patch
fix-broken-dubious-driver-suspend-methods.patch
pm-define-pm_event_prethaw.patch
pm-pci-and-ide-handle-pm_event_prethaw.patch
pm-video-drivers-and-pm_event_prethaw.patch
pm-usb-hcds-use-pm_event_prethaw.patch
pm-issue-pm_event_prethaw.patch
rtc-add-rtc-rs5c348-driver.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux