Commit 7290da41 authored by Peter Wu's avatar Peter Wu Committed by Greg Kroah-Hartman

drm/nouveau/acpi: fix check for power resources support

commit b0a6af8b upstream.

Check whether the kernel really supports power resources for a device,
otherwise the power might not be removed when the device is runtime
suspended (DSM should still work in these cases where PR does not).

This is a workaround for a problem where ACPICA and Windows 10 differ in
behavior. ACPICA does not correctly enumerate power resources within a
conditional block (due to delayed execution of such blocks) and as a
result power_resources is set to false even if _PR3 exists.

Fixes: 692a17dc ("drm/nouveau/acpi: fix lockup with PCIe runtime PM")
Link: https://bugs.freedesktop.org/show_bug.cgi?id=98398Reported-and-tested-by: default avatarRick Kerkhof <rick.2889@gmail.com>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarPeter Wu <peter@lekensteyn.nl>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fd5f9e1e
...@@ -240,7 +240,8 @@ static bool nouveau_pr3_present(struct pci_dev *pdev) ...@@ -240,7 +240,8 @@ static bool nouveau_pr3_present(struct pci_dev *pdev)
if (!parent_adev) if (!parent_adev)
return false; return false;
return acpi_has_method(parent_adev->handle, "_PR3"); return parent_adev->power.flags.power_resources &&
acpi_has_method(parent_adev->handle, "_PR3");
} }
static void nouveau_dsm_pci_probe(struct pci_dev *pdev, acpi_handle *dhandle_out, static void nouveau_dsm_pci_probe(struct pci_dev *pdev, acpi_handle *dhandle_out,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment