From: Peter Wu <peter-VTkQYDcBqhK7DlmcbJSQ7g@public.gmane.org>
To: Mika Westerberg
<mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Cc: linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"Rafael J. Wysocki"
<rafael.j.wysocki-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Bjorn Helgaas <helgaas-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Dave Airlie <airlied-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 4/4] drm/nouveau/acpi: fix lockup with PCIe runtime PM
Date: Mon, 30 May 2016 18:13:51 +0200 [thread overview]
Message-ID: <20160530161351.GA1355@al> (raw)
In-Reply-To: <20160530130909.GA1743-3PARRvDOhMZrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
On Mon, May 30, 2016 at 04:09:09PM +0300, Mika Westerberg wrote:
...
> > > > > > +
> > > > > > + if (!parent_pdev)
> > > > > > + return false;
> > > > > > +
> > > > > > + ad = ACPI_COMPANION(&parent_pdev->dev);
> > > > > > + if (!ad)
> > > > > > + return false;
> > > > > > +
> > > > > > + return ad->power.flags.power_resources;
> > > > >
> > > > > Is this sufficient to tell if the parent device has _PR3? I thought it
> > > > > returns true if it has power resources in general, not necessarily _PR3.
> > > > >
> > > > > Otherwise this looks okay to me.
> > > >
> > > > It is indeed set whenever there is any _PRx method. I wonder if it is
> > > > appropriate to access fields directly like this, perhaps this would be
> > > > more accurate (based on device_pm.c):
> > > >
> > > > /* Check whether the _PR3 method is available. */
> > > > return adev->power.states[ACPI_STATE_D3_COLD].flags.valid;
> > > >
> > > > I am also considering adding a check in case the pcieport driver does
> > > > not support D3cold via runtime PM, what do you think of this?
> > > >
> > > > if (!parent_pdev)
> > > > return false;
> > > > /* If the PCIe port does not support D3cold via runtime PM, allow a
> > > > * fallback to the Optimus DSM method to put the device in D3cold. */
> > > > if (parent_pdev->no_d3cold)
> > > > return false;
> > > >
> > > > This is needed to avoid the regression reported in the cover letter, but
> > > > also allows pre-2015 systems to (still) have the D3cold possibility.
> > >
> > > The _DSM method with 0 as index parameter should return a bit field
> > > telling which functions are supported. Sane BIOS disables that
> > > particular function if it detects Windows 8 and newer. Have you checked
> > > if that's the case?
> > >
> > > Then you can call _DSM only if it is supported and otherwise expect the
> > > parent device's power resources to turn off power when runtime
> > > suspended.
> >
> > The _DSM methods (for the Nvidia device) are often still included and
> > functions are reported as supported. I guess that vendors just check
> > whether it is working and do not bother removing legacy functions. The
> > Acer case below seems exceptional.
> >
> > I suggested the no_d3cold check such that DSM can still be called even
> > though the runtime PM on the PCIe port does nothing.
>
> Somehow it does not feel right to poke parent device's fields directly.
>
> What if you just check if it has the method like:
>
> bool no_dsm = acpi_has_method(parent_adev->handle, "_PR3");
>
> That should follow what Windows is doing.
Checking for _PR3 was the intention, but it seems that the ACPI core
does not really store it somewhere. Your check should be simple enough,
I'll use that in the next version.
Do you have any suggestions for the case where the pcieport driver
refuses to put the bridge in D3 (because the BIOS is too old)? In that
case the nouveau driver needs to fallback to the DSM method (but not
when runtime PM is deliberately disabled by writing control=on).
--
Kind regards,
Peter Wu
https://lekensteyn.nl
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
next prev parent reply other threads:[~2016-05-30 16:13 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-24 22:52 [PATCH 0/4] nouveau fixes for RPM/Optimus-related hangs Peter Wu
[not found] ` <1464130381-4797-1-git-send-email-peter-VTkQYDcBqhK7DlmcbJSQ7g@public.gmane.org>
2016-05-24 22:53 ` [PATCH 4/4] drm/nouveau/acpi: fix lockup with PCIe runtime PM Peter Wu
2016-05-25 13:55 ` Mika Westerberg
[not found] ` <20160525135535.GN1789-3PARRvDOhMZrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2016-05-27 11:10 ` Peter Wu
2016-05-27 11:55 ` [Nouveau] " Hans de Goede
2016-05-30 9:57 ` Mika Westerberg
[not found] ` <20160530095709.GK1789-3PARRvDOhMZrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2016-05-30 12:20 ` Peter Wu
2016-05-30 13:09 ` Mika Westerberg
[not found] ` <20160530130909.GA1743-3PARRvDOhMZrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2016-05-30 16:13 ` Peter Wu [this message]
2016-05-31 8:43 ` Mika Westerberg
[not found] ` <20160531084356.GH1743-3PARRvDOhMZrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2016-05-31 11:02 ` Peter Wu
2016-06-01 9:28 ` Mika Westerberg
[not found] ` <20160601092847.GQ1743-3PARRvDOhMZrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2016-06-01 17:21 ` Peter Wu
2016-05-31 12:20 ` Lukas Wunner
[not found] ` <20160531122026.GA14129-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-06-01 16:51 ` Peter Wu
2016-06-01 17:40 ` [Nouveau] " Lukas Wunner
2016-05-27 13:01 ` Emil Velikov
[not found] ` <CACvgo514AB=rkRGWrwmPHTX=hhEF8Jhzdg1hQkX1_C4A_zYkzg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-05-27 21:31 ` Peter Wu
2016-05-28 12:27 ` Lukas Wunner
2016-05-30 10:48 ` [Nouveau] " Emil Velikov
[not found] ` <CACvgo50db1KEuH3yZ75K-MtCeKAsQKXJbQQxiXm+82qkjZsvDA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-05-30 11:23 ` Peter Wu
2016-05-30 12:41 ` Emil Velikov
2016-05-25 9:08 ` [Nouveau] [PATCH 0/4] nouveau fixes for RPM/Optimus-related hangs Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160530161351.GA1355@al \
--to=peter-vtkqydcbqhk7dlmcbjsq7g@public.gmane.org \
--cc=airlied-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=helgaas-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=rafael.j.wysocki-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).