linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] xhci: Add reset on resume quirk for asrock p67 host
@ 2011-06-15 21:47 Maarten Lankhorst
  2011-06-15 22:43 ` Sarah Sharp
  0 siblings, 1 reply; 3+ messages in thread
From: Maarten Lankhorst @ 2011-06-15 21:47 UTC (permalink / raw)
  To: Sarah Sharp; +Cc: Linux Kernel Mailing List, linux-usb, Alan Stern

[-- Attachment #1: Type: text/plain, Size: 2037 bytes --]

The asrock p67 xhci controller completely dies on resume, add a
quirk for this, to bring the host back online after a suspend.

This should be backported to stable kernels up until 2.6.37.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Cc: stable@kernel.org
---
V2: Fix inversed logic, and correct kernel version

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 17541d0..cb16de2 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -29,6 +29,9 @@
 #define PCI_VENDOR_ID_FRESCO_LOGIC	0x1b73
 #define PCI_DEVICE_ID_FRESCO_LOGIC_PDK	0x1000
 
+#define PCI_VENDOR_ID_ETRON		0x1b6f
+#define PCI_DEVICE_ID_ASROCK_P67	0x7023
+
 static const char hcd_name[] = "xhci_hcd";
 
 /* called after powerup, by probe or system-pm "wakeup" */
@@ -134,6 +137,11 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
 		xhci->quirks |= XHCI_EP_LIMIT_QUIRK;
 		xhci->limit_active_eps = 64;
 	}
+	if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
+			pdev->device == PCI_DEVICE_ID_ASROCK_P67) {
+		xhci->quirks |= XHCI_RESET_ON_RESUME;
+		xhci_dbg(xhci, "QUIRK: Resetting on resume\n");
+	}
 
 	/* Make sure the HC is halted. */
 	retval = xhci_halt(xhci);
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 06e7023..17a0a08 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -759,6 +759,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
 		msleep(100);
 
 	spin_lock_irq(&xhci->lock);
+	if (xhci->quirks & XHCI_RESET_ON_RESUME)
+		hibernated = true;
 
 	if (!hibernated) {
 		/* step 1: restore register */
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 7d1ea3b..b769a75 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1308,6 +1308,7 @@ struct xhci_hcd {
  */
 #define XHCI_EP_LIMIT_QUIRK	(1 << 5)
 #define XHCI_BROKEN_MSI		(1 << 6)
+#define XHCI_RESET_ON_RESUME	(1 << 7)
 	unsigned int		num_active_eps;
 	unsigned int		limit_active_eps;
 	/* There are two roothubs to keep track of bus suspend info for */



[-- Attachment #2: xhci.patch --]
[-- Type: application/mbox, Size: 1708 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] xhci: Add reset on resume quirk for asrock p67 host
  2011-06-15 21:47 [PATCH v2] xhci: Add reset on resume quirk for asrock p67 host Maarten Lankhorst
@ 2011-06-15 22:43 ` Sarah Sharp
  2011-06-16  7:26   ` Maarten Lankhorst
  0 siblings, 1 reply; 3+ messages in thread
From: Sarah Sharp @ 2011-06-15 22:43 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: Linux Kernel Mailing List, linux-usb, Alan Stern

No attached patches, just inline ones please. :)  I've fixed this up for
now, since your first patch was inline.

Sarah Sharp

On Wed, Jun 15, 2011 at 11:47:21PM +0200, Maarten Lankhorst wrote:
> The asrock p67 xhci controller completely dies on resume, add a
> quirk for this, to bring the host back online after a suspend.
> 
> This should be backported to stable kernels up until 2.6.37.
> 
> Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
> Cc: stable@kernel.org
> ---
> V2: Fix inversed logic, and correct kernel version
> 
> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index 17541d0..cb16de2 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c
> @@ -29,6 +29,9 @@
>  #define PCI_VENDOR_ID_FRESCO_LOGIC	0x1b73
>  #define PCI_DEVICE_ID_FRESCO_LOGIC_PDK	0x1000
>  
> +#define PCI_VENDOR_ID_ETRON		0x1b6f
> +#define PCI_DEVICE_ID_ASROCK_P67	0x7023
> +
>  static const char hcd_name[] = "xhci_hcd";
>  
>  /* called after powerup, by probe or system-pm "wakeup" */
> @@ -134,6 +137,11 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
>  		xhci->quirks |= XHCI_EP_LIMIT_QUIRK;
>  		xhci->limit_active_eps = 64;
>  	}
> +	if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
> +			pdev->device == PCI_DEVICE_ID_ASROCK_P67) {
> +		xhci->quirks |= XHCI_RESET_ON_RESUME;
> +		xhci_dbg(xhci, "QUIRK: Resetting on resume\n");
> +	}
>  
>  	/* Make sure the HC is halted. */
>  	retval = xhci_halt(xhci);
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 06e7023..17a0a08 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -759,6 +759,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
>  		msleep(100);
>  
>  	spin_lock_irq(&xhci->lock);
> +	if (xhci->quirks & XHCI_RESET_ON_RESUME)
> +		hibernated = true;
>  
>  	if (!hibernated) {
>  		/* step 1: restore register */
> diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
> index 7d1ea3b..b769a75 100644
> --- a/drivers/usb/host/xhci.h
> +++ b/drivers/usb/host/xhci.h
> @@ -1308,6 +1308,7 @@ struct xhci_hcd {
>   */
>  #define XHCI_EP_LIMIT_QUIRK	(1 << 5)
>  #define XHCI_BROKEN_MSI		(1 << 6)
> +#define XHCI_RESET_ON_RESUME	(1 << 7)
>  	unsigned int		num_active_eps;
>  	unsigned int		limit_active_eps;
>  	/* There are two roothubs to keep track of bus suspend info for */
> 
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] xhci: Add reset on resume quirk for asrock p67 host
  2011-06-15 22:43 ` Sarah Sharp
@ 2011-06-16  7:26   ` Maarten Lankhorst
  0 siblings, 0 replies; 3+ messages in thread
From: Maarten Lankhorst @ 2011-06-16  7:26 UTC (permalink / raw)
  To: Sarah Sharp; +Cc: Linux Kernel Mailing List, linux-usb, Alan Stern

Hi Sarah,

Op 16-06-11 00:43, Sarah Sharp schreef:
> No attached patches, just inline ones please. :)  I've fixed this up for
> now, since your first patch was inline.
Actually, it seems I did it both ways by accident. Testing patch -Np1
with that message still worked. Sorry about that. Sent it right before
falling asleep.


~Maarten

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-16  7:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-15 21:47 [PATCH v2] xhci: Add reset on resume quirk for asrock p67 host Maarten Lankhorst
2011-06-15 22:43 ` Sarah Sharp
2011-06-16  7:26   ` Maarten Lankhorst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).