OSDN Git Service

drm/nouveau/acpi: fix lockup with PCIe runtime PM
authorPeter Wu <peter@lekensteyn.nl>
Fri, 15 Jul 2016 13:12:18 +0000 (15:12 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Sat, 30 Jul 2016 08:19:48 +0000 (18:19 +1000)
commit692a17dcc2922a91c6bcf11b3321503a3377b1b1
treeb02ef1a91039968996606fb62e542a0c3e24419a
parentcba97805cb69d5b1a1d3bb108872c73b5bf0e205
drm/nouveau/acpi: fix lockup with PCIe runtime PM

Since "PCI: Add runtime PM support for PCIe ports", the parent PCIe port
can be runtime-suspended which disables power resources via ACPI. This
is incompatible with DSM, resulting in a GPU device which is still in D3
and locks up the kernel on resume (on a Clevo P651RA, GTX965M).

Mirror the behavior of Windows 8 and newer[1] (as observed via an AMLi
debugger trace) and stop using the DSM functions for D3cold when power
resources are available on the parent PCIe port.

pci_d3cold_disable() is not used because on some machines, the old DSM
method is broken. On a Lenovo T440p (GT 730M) memory and disk corruption
would occur, but that is fixed with this patch[2].

 [1]: https://msdn.microsoft.com/windows/hardware/drivers/bringup/firmware-requirements-for-d3cold
 [2]: https://github.com/Bumblebee-Project/bbswitch/issues/78#issuecomment-223549072

 v2: simply check directly for _PR3. Added affected machines.
 v3: fixed block comment coding style.

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Acked-by: Dave Airlie <airlied@redhat.com
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_acpi.c