From: Maarten Lankhorst <m.b.lankhorst@gmail.com>
To: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: linux-usb@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] xhci: Add reset on resume quirk for asrock p67 host
Date: Wed, 15 Jun 2011 22:29:01 +0200 [thread overview]
Message-ID: <4DF9160D.8090109@gmail.com> (raw)
In-Reply-To: <20110615195928.GD5382@xanatos>
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 as far back as 2.6.34.
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Cc: stable@kernel.org
---
I have no idea if the vendor name is correct. lspci didn't list it.
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..42fd032 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 = 0;
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 */
next prev parent reply other threads:[~2011-06-15 20:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-15 7:07 device plugged into xhci port not detected after a resume Maarten Lankhorst
2011-06-15 15:38 ` Greg KH
2011-06-15 16:17 ` Maarten Lankhorst
2011-06-15 16:58 ` Sarah Sharp
2011-06-15 17:29 ` Maarten Lankhorst
2011-06-15 17:39 ` Maarten Lankhorst
2011-06-15 19:59 ` Sarah Sharp
2011-06-15 20:19 ` Sarah Sharp
2011-06-15 20:29 ` Maarten Lankhorst [this message]
2011-06-15 20:36 ` [PATCH] xhci: Add reset on resume quirk for asrock p67 host Sarah Sharp
2011-06-15 20:38 ` Maarten Lankhorst
2011-06-15 20:39 ` Sarah Sharp
2011-06-15 21:00 ` Alan Stern
2011-06-15 21:21 ` Sarah Sharp
2011-06-15 21:41 ` Maarten Lankhorst
2011-06-15 22:15 ` Maarten Lankhorst
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DF9160D.8090109@gmail.com \
--to=m.b.lankhorst@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sarah.a.sharp@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox