dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Wu <peter-VTkQYDcBqhK7DlmcbJSQ7g@public.gmane.org>
To: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Dave Airlie <airlied-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 1/9] drm/nouveau: Don't leak runtime pm ref on driver unload
Date: Tue, 31 May 2016 13:41:51 +0200	[thread overview]
Message-ID: <20160531114151.GC1308@al> (raw)
In-Reply-To: <20160531113443.GA14098-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>

On Tue, May 31, 2016 at 01:34:43PM +0200, Lukas Wunner wrote:
> On Mon, May 30, 2016 at 07:03:46PM +0200, Peter Wu wrote:
> > On Sun, May 29, 2016 at 05:50:06PM +0200, Lukas Wunner wrote:
> > > How exactly did you reach the situation where the root port didn't wake
> > > up when you tried to load nouveau again? (IRC conversation this week.)
> > 
> > Ensure that the pci/pm patches are applied, then:
> > 
> >  0. Unload nouveau (I have blacklisted it for testing).
> >  1. Enable rpm for the root port and children (control = auto).
> >  2. Verify in the kernel logs that the devices are sleeping:
> >         pcieport 0000:00:01.0: power state changed by ACPI to D3cold
> >  3. (Optional, to rule out issues with delays:) Disable rpm for the
> >     Nvidia device (control = on).
> >  4. modprobe nouveau.
> > 
> > The above test with v4.6 + 4 pci/pm patches (8b71f565) gives:
> > 
> >     50.245795 MXM: GUID detected in BIOS
> >     50.245948    nseval-0227 ns_evaluate           : **** Execute method [\_SB.PCI0.GFX0._DSM] at AML address ffffc90000013b11 length 492
> >     50.246016 ACPI Warning: \_SB.PCI0.GFX0._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20160108/nsarguments-95)
> >     50.246044    nseval-0227 ns_evaluate           : **** Execute method [\_SB.PCI0.GFX0._DSM] at AML address ffffc90000013b11 length 492
> >     50.246110    nseval-0227 ns_evaluate           : **** Execute method [\_SB.PCI0.PEG0.PEGP._DSM] at AML address ffffc90000018297 length 1F
> >     50.246256 ACPI Warning: \_SB.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20160108/nsarguments-95)
> >     50.246289    nseval-0227 ns_evaluate           : **** Execute method [\_SB.PCI0.PEG0.PEGP._DSM] at AML address ffffc90000018297 length 1F
> >     50.246443 ACPI Warning: \_SB.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20160108/nsarguments-95)
> >     50.246457    nseval-0227 ns_evaluate           : **** Execute method [\_SB.PCI0.PEG0.PEGP._DSM] at AML address ffffc90000018297 length 1F
> >     50.246932 pci 0000:01:00.0: optimus capabilities: enabled, status dynamic power, hda bios codec supported
> >     50.247005 VGA switcheroo: detected Optimus DSM method \_SB_.PCI0.PEG0.PEGP handle
> >     50.247084    nseval-0227 ns_evaluate           : **** Execute method [\_SB.PCI0.PEG0.PG00._ON] at AML address ffffc9000001086e length 11D
> >     50.390140 pcieport 0000:00:01.0: power state changed by ACPI to D0
> >     50.491893    nseval-0227 ns_evaluate           : **** Execute method [\_SB.PCI0.PEG0._DSW] at AML address ffffc90000010a2d length 1D
> >     50.492285 pcieport 0000:00:01.0: PME# disabled
> >     50.492583 nouveau 0000:01:00.0: unknown chipset (ffffffff)
> >     50.492687 nouveau: probe of 0000:01:00.0 failed with error -12
> 
> I've tested this on a MacBook Pro, which does not have ACPI _PR3
> methods for the root port to which the discrete GPU is attached.
> The port can thus only suspend to D3hot, not D3cold.
> 
> Even without patch [2/9], when unloading nouveau and letting the
> root port go to D3hot, the port is subsequently correctly resumed
> to D0 when reloading nouveau.
> 
> So the issue that you're seeing without patch [2/9] seems to be
> specific to Optimus/_PR3 machines. If possible you should try to
> get it working without patch [2/9] because that patch is really
> optional (as I've written in the commit message). I'm totally
> unfamiliar with Optimus but maybe lspci could help to debug this?

Without 2/9 I can prevent the issue by writing "on" to
/sys/bus/pci/devices/0000:00:01.0/power/control (the PCIe port), but
that effectively gives the same result as applying 2/9.

The problem occurs when the power is lost (by putting the PCIe port in
D3cold). Maybe it is a bug in the PCI core that does not re-initialize
devices under the port, but since a workaround is available (2/9), I
will focus on other issues first. Maybe it is worth to mention this
issue in the commit message for 2/9 though.
-- 
Kind regards,
Peter Wu
https://lekensteyn.nl
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

  parent reply	other threads:[~2016-05-31 11:41 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24 16:03 [PATCH 0/9] Fix runtime pm ref leaks Lukas Wunner
2016-05-24 16:03 ` [PATCH 7/9] drm/amdgpu: Don't leak runtime pm ref on driver load Lukas Wunner
2016-05-24 16:03 ` [PATCH 6/9] drm/amdgpu: Don't leak runtime pm ref on driver unload Lukas Wunner
2016-05-24 16:03 ` [PATCH 5/9] drm/radeon: Forbid runtime pm " Lukas Wunner
2016-05-24 16:03 ` [PATCH 8/9] drm/amdgpu: " Lukas Wunner
2016-05-24 16:03 ` [PATCH 3/9] drm/radeon: Don't leak runtime pm ref " Lukas Wunner
2016-05-24 16:03 ` [PATCH 4/9] drm/radeon: Don't leak runtime pm ref on driver load Lukas Wunner
     [not found] ` <cover.1464103767.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-05-24 16:03   ` [PATCH 1/9] drm/nouveau: Don't leak runtime pm ref on driver unload Lukas Wunner
     [not found]     ` <dd120a30cb769c93af8973cae41f61831d17e04b.1464103767.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-05-27  1:07       ` Peter Wu
2016-05-29 15:50         ` Lukas Wunner
     [not found]           ` <20160529155006.GA12909-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-05-30 17:03             ` Peter Wu
2016-05-31 11:34               ` Lukas Wunner
     [not found]                 ` <20160531113443.GA14098-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-05-31 11:41                   ` Peter Wu [this message]
2016-05-24 16:03   ` [PATCH 9/9] drm: Turn off crtc before tearing down its data structure Lukas Wunner
2016-05-24 21:30     ` [Nouveau] " Daniel Vetter
2016-05-24 22:07       ` Lukas Wunner
     [not found]         ` <20160524220753.GA5941-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-05-24 22:30           ` Daniel Vetter
     [not found]       ` <20160524213042.GC27098-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2016-05-25 10:51         ` Lukas Wunner
2016-05-25 13:43           ` [Nouveau] " Daniel Vetter
     [not found]             ` <CAKMK7uGFb9ihRtjeK7s0ezPPv-C6S9GKbE4h9MLoPyHyN=9W5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-01 12:36               ` Lukas Wunner
     [not found]                 ` <20160601123641.GA15243-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-06-01 14:40                   ` Daniel Vetter
2016-06-03  7:30                     ` [Nouveau] " Lukas Wunner
2016-06-03 18:21                       ` Daniel Vetter
2016-06-08 16:55                         ` Lukas Wunner
2016-05-24 16:03   ` [PATCH 2/9] drm/nouveau: Forbid runtime pm on driver unload Lukas Wunner

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=20160531114151.GC1308@al \
    --to=peter-vtkqydcbqhk7dlmcbjsq7g@public.gmane.org \
    --cc=airlied-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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