Re: problem with resume after s2ram

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

 



On Tue, 29 Apr 2014, Peter Münster wrote:

> On Tue, Apr 29 2014, Alan Stern wrote:
> 
> > It's noticeable that your logs include resets of the affected devices,
> > whereas the older kernels did not need any resets.  This suggests that
> > these OHCI controllers will always have problems with global suspend,
> > and therefore a controller-specific fix is needed.
> 
> Perhaps this is related:
> https://mailman.archlinux.org/pipermail/arch-general/2014-January/034831.html

I can't tell.

> > Can you post the output from "lspci -v -s 12.1"
> 
> 00:12.1 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0 USB OHCI1 Controller (prog-if 10 [OHCI])
>         Subsystem: ASUSTeK Computer Inc. Device 8389
>         Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 16
>         Memory at f8ffd000 (32-bit, non-prefetchable) [size=4K]
>         Kernel driver in use: ohci_hcd

Okay, good.  Below is a patch which I hope will fix your problem.  You 
can leave diag1 in place if you want, but remove all the other patches.

Alan Stern



Index: usb-3.15/drivers/usb/host/ohci-hub.c
===================================================================
--- usb-3.15.orig/drivers/usb/host/ohci-hub.c
+++ usb-3.15/drivers/usb/host/ohci-hub.c
@@ -90,6 +90,24 @@ __acquires(ohci->lock)
 	dl_done_list (ohci);
 	finish_unlinks (ohci, ohci_frame_no(ohci));
 
+	/*
+	 * Some controllers don't handle "global" suspend properly if
+	 * there are unsuspended ports.  For these controllers, put all
+	 * the enabled ports into suspend before suspending the root hub.
+	 */
+	if (ohci->flags & OHCI_QUIRK_GLOBAL_SUSPEND) {
+		__hc32 __iomem	*portstat = ohci->regs->roothub.portstatus;
+		int		i;
+		unsigned	temp;
+
+		for (i = 0; i < ohci->num_ports; (++i, ++portstat)) {
+			temp = ohci_readl(ohci, portstat);
+			if ((temp & (RH_PS_PES | RH_PS_PSS)) ==
+					RH_PS_PES)
+				ohci_writel(ohci, RH_PS_PSS, portstat);
+		}
+	}
+
 	/* maybe resume can wake root hub */
 	if (ohci_to_hcd(ohci)->self.root_hub->do_remote_wakeup || autostop) {
 		ohci->hc_control |= OHCI_CTRL_RWE;
Index: usb-3.15/drivers/usb/host/ohci-pci.c
===================================================================
--- usb-3.15.orig/drivers/usb/host/ohci-pci.c
+++ usb-3.15/drivers/usb/host/ohci-pci.c
@@ -160,6 +160,7 @@ static int ohci_quirk_amd700(struct usb_
 		ohci_dbg(ohci, "enabled AMD prefetch quirk\n");
 	}
 
+	ohci->flags |= OHCI_QUIRK_GLOBAL_SUSPEND;
 	return 0;
 }
 
Index: usb-3.15/drivers/usb/host/ohci.h
===================================================================
--- usb-3.15.orig/drivers/usb/host/ohci.h
+++ usb-3.15/drivers/usb/host/ohci.h
@@ -405,6 +405,8 @@ struct ohci_hcd {
 #define	OHCI_QUIRK_HUB_POWER	0x100			/* distrust firmware power/oc setup */
 #define	OHCI_QUIRK_AMD_PLL	0x200			/* AMD PLL quirk*/
 #define	OHCI_QUIRK_AMD_PREFETCH	0x400			/* pre-fetch for ISO transfer */
+#define	OHCI_QUIRK_GLOBAL_SUSPEND	0x800		/* must suspend ports */
+
 	// there are also chip quirks/bugs in init logic
 
 	struct work_struct	nec_work;	/* Worker for NEC quirk */

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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux