|
23 | 23 | #include <linux/pci.h> |
24 | 24 | #include <linux/slab.h> |
25 | 25 | #include <linux/module.h> |
| 26 | +#include <linux/acpi.h> |
26 | 27 |
|
27 | 28 | #include "xhci.h" |
28 | 29 | #include "xhci-trace.h" |
@@ -190,6 +191,19 @@ static void xhci_pme_quirk(struct xhci_hcd *xhci) |
190 | 191 | readl(reg); |
191 | 192 | } |
192 | 193 |
|
| 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 | + |
193 | 207 | /* called during probe() after chip reset completes */ |
194 | 208 | static int xhci_pci_setup(struct usb_hcd *hcd) |
195 | 209 | { |
@@ -263,6 +277,9 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) |
263 | 277 | HCC_MAX_PSA(xhci->hcc_params) >= 4) |
264 | 278 | xhci->shared_hcd->can_do_streams = 1; |
265 | 279 |
|
| 280 | + if (xhci->quirks & XHCI_PME_STUCK_QUIRK) |
| 281 | + xhci_pme_acpi_rtd3_enable(dev); |
| 282 | + |
266 | 283 | /* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */ |
267 | 284 | pm_runtime_put_noidle(&dev->dev); |
268 | 285 |
|
|
0 commit comments