mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 01:10:04 +00:00
drm/nouveau/acpi: use DSM if bridge does not support D3cold
Even if PR3 support is available on the bridge, it will not be used if the PCI layer considers it unavailable (i.e. on all laptops from 2013 and 2014). Ensure that this condition is checked to allow a fallback to the Optimus DSM for device poweroff. Initially I wanted to call pci_d3cold_enable before checking bridge_d3 (in case the user changed d3cold_allowed), but that is such an unlikely case and likely fragile anyway. The current patch is suggested by Mika in http://www.spinics.net/lists/linux-pci/msg52599.html Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
3eab887a55
commit
279cf3f238
1 changed files with 11 additions and 0 deletions
|
@ -225,6 +225,17 @@ static bool nouveau_pr3_present(struct pci_dev *pdev)
|
|||
if (!parent_pdev)
|
||||
return false;
|
||||
|
||||
if (!parent_pdev->bridge_d3) {
|
||||
/*
|
||||
* Parent PCI bridge is currently not power managed.
|
||||
* Since userspace can change these afterwards to be on
|
||||
* the safe side we stick with _DSM and prevent usage of
|
||||
* _PR3 from the bridge.
|
||||
*/
|
||||
pci_d3cold_disable(pdev);
|
||||
return false;
|
||||
}
|
||||
|
||||
parent_adev = ACPI_COMPANION(&parent_pdev->dev);
|
||||
if (!parent_adev)
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue