Skip to content

Commit c3c5819

Browse files
matnymangregkh
authored andcommitted
xhci: call BIOS workaround to enable runtime suspend on Intel Braswell
Intel xhci hw that require XHCI_PME_STUCK quirk have as default disabled xhci from going to D3 state in runtime suspend. Driver needs to verify it can deal with the hw by calling an ACPI _DSM method to get D3 enabled. Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ed877b1 commit c3c5819

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

drivers/usb/host/xhci-pci.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <linux/pci.h>
2424
#include <linux/slab.h>
2525
#include <linux/module.h>
26+
#include <linux/acpi.h>
2627

2728
#include "xhci.h"
2829
#include "xhci-trace.h"
@@ -190,6 +191,19 @@ static void xhci_pme_quirk(struct xhci_hcd *xhci)
190191
readl(reg);
191192
}
192193

194+
#ifdef CONFIG_ACPI
195+
static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev)
196+
{
197+
static const u8 intel_dsm_uuid[] = {
198+
0xb7, 0x0c, 0x34, 0xac, 0x01, 0xe9, 0xbf, 0x45,
199+
0xb7, 0xe6, 0x2b, 0x34, 0xec, 0x93, 0x1e, 0x23,
200+
};
201+
acpi_evaluate_dsm(ACPI_HANDLE(&dev->dev), intel_dsm_uuid, 3, 1, NULL);
202+
}
203+
#else
204+
static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { }
205+
#endif /* CONFIG_ACPI */
206+
193207
/* called during probe() after chip reset completes */
194208
static int xhci_pci_setup(struct usb_hcd *hcd)
195209
{
@@ -263,6 +277,9 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
263277
HCC_MAX_PSA(xhci->hcc_params) >= 4)
264278
xhci->shared_hcd->can_do_streams = 1;
265279

280+
if (xhci->quirks & XHCI_PME_STUCK_QUIRK)
281+
xhci_pme_acpi_rtd3_enable(dev);
282+
266283
/* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */
267284
pm_runtime_put_noidle(&dev->dev);
268285

0 commit comments

Comments
 (0)