Peter Wu
2016-Oct-28 23:40 UTC
[Nouveau] [PATCH] 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). Link: https://bugs.freedesktop.org/show_bug.cgi?id=98398 Fixes: 692a17dcc292 ("drm/nouveau/acpi: fix lockup with PCIe runtime PM") Signed-off-by: Peter Wu <peter at lekensteyn.nl> --- 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(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c index dc57b62..193573d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_acpi.c +++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c @@ -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
Rick Kerkhof
2016-Oct-29 22:45 UTC
[Nouveau] [PATCH] drm/nouveau/acpi: fix check for power resources support
Op za 29 okt. 2016 om 01:40 schreef Peter Wu <peter at lekensteyn.nl>:> 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). > > Link: https://bugs.freedesktop.org/show_bug.cgi?id=98398 > Fixes: 692a17dcc292 ("drm/nouveau/acpi: fix lockup with PCIe runtime PM") > Signed-off-by: Peter Wu <peter at lekensteyn.nl> > --- > 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(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c > b/drivers/gpu/drm/nouveau/nouveau_acpi.c > index dc57b62..193573d 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_acpi.c > +++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c > @@ -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 > > Hi Peter,This patch indeed does fix the issue for me, thank you. Kind regards, Rick Tested-by: Rick Kerkhof <rick.2889 at gmail.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/nouveau/attachments/20161029/577c7cfb/attachment-0001.html>
Mika Westerberg
2016-Oct-31 09:05 UTC
[Nouveau] [PATCH] drm/nouveau/acpi: fix check for power resources support
On Sat, Oct 29, 2016 at 01:40:03AM +0200, Peter Wu wrote:> 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). > > Link: https://bugs.freedesktop.org/show_bug.cgi?id=98398 > Fixes: 692a17dcc292 ("drm/nouveau/acpi: fix lockup with PCIe runtime PM") > Signed-off-by: Peter Wu <peter at lekensteyn.nl> > --- > 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(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c > index dc57b62..193573d 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_acpi.c > +++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c > @@ -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 Reviewed-by: Mika Westerberg <mika.westerberg at linux.intel.com>> + 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
Apparently Analagous Threads
- [PATCH 1/1] drm/nouveau: Use generic helper to check _PR3 presence
- [PATCH v2] drm/nouveau/acpi: fix check for power resources support
- [PATCH v2 0/4] nouveau RPM fixes for Optimus
- [PATCH v3 0/4] nouveau RPM fixes for Optimus (final)
- [PATCH 4/4] drm/nouveau/acpi: fix lockup with PCIe runtime PM