Skip to contentSkip to conversation

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

PATCH Superseded Peter Wu 3 participants 3 messages Oct 28, 2016 – Oct 31, 2016 1 message not in the archive

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Peter Wu

author
#0 lore raw

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

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).

Fixes 692a17dcc292 ("drm/nouveau/acpi: fix lockup with PCIe runtime PM")

---
Hi,

Maybe Cc: stable (4.8+)?

Compile-tested only. Rick, can you test if this patch fixes the problem for you?

This check was actually in the original patch, but it was changed:
https://lists.freedesktop.org/archives/nouveau/2016-May/025125.html
Re-adding the check as suggested by Mika.

Kind regards,
Peter

---
 drivers/gpu/drm/nouveau/nouveau_acpi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_acpi.c +2 -1
index dc57b62..193573d 100644
@@ -240,7 +240,8 @@ static bool nouveau_pr3_present(struct pci_dev *pdev)
 	if (!parent_adev)
 		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,
Signature · 6 lines
2.10.1

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
Tested-by on v1 1/1
#1 lore raw

Op za 29 okt. 2016 om 01:40 schreef Peter Wu <[email protected]>:

Quoted 44 lines

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).

Fixes 692a17dcc292 ("drm/nouveau/acpi: fix lockup with PCIe runtime PM")

---
Hi,

Maybe Cc: stable (4.8+)?

Compile-tested only. Rick, can you test if this patch fixes the problem for you?

This check was actually in the original patch, but it was changed:
https://lists.freedesktop.org/archives/nouveau/2016-May/025125.html
Re-adding the check as suggested by Mika.

Kind regards,
Peter

---
 drivers/gpu/drm/nouveau/nouveau_acpi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_acpi.c +2 -1
index dc57b62..193573d 100644
@@ -240,7 +240,8 @@ static bool nouveau_pr3_present(struct pci_dev *pdev)
        if (!parent_adev)
                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,
--
2.10.1

Quoted 1 line

Hi Peter,

This patch indeed does fix the issue for me, thank you.

Kind regards,
Rick

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): 20161028234003.21152-1-peter-VTkQYDcBqhK7DlmcbJSQ7g@public.gmane.org

Reviewed-by
#3 lore raw
Quoted 29 lines · Peter Wu

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).

Fixes 692a17dcc292 ("drm/nouveau/acpi: fix lockup with PCIe runtime PM")

---
Hi,

Maybe Cc: stable (4.8+)?

Compile-tested only. Rick, can you test if this patch fixes the problem for you?

This check was actually in the original patch, but it was changed:
https://lists.freedesktop.org/archives/nouveau/2016-May/025125.html
Re-adding the check as suggested by Mika.

Kind regards,
Peter

---
 drivers/gpu/drm/nouveau/nouveau_acpi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_acpi.c +0 -0
index dc57b62..193573d 100644

drivers/gpu/drm/nouveau/nouveau_acpi.c static bool nouveau_pr3_present(struct pci_dev *pdev) · line 243

Quoted 4 lines
drivers/gpu/drm/nouveau/nouveau_acpi.c +0 -1
@@ -240,7 +240,8 @@ static bool nouveau_pr3_present(struct pci_dev *pdev)
 	if (!parent_adev)
 		return false;
 
-	return acpi_has_method(parent_adev->handle, "_PR3");

You may want to add comment here telling why we need to check flags.power_resources. Or alternatively explain this in the changelog (along the lines that we fail to find PowerResources because ACPICA does not handle certain conditional things in the same way than Windows 10).

Other than that, looks good

Quoted 7 lines
drivers/gpu/drm/nouveau/nouveau_acpi.c +2 -0
+	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,
Signature · 1 line
2.10.1

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau