dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
To: Peter Wu <peter-VTkQYDcBqhK7DlmcbJSQ7g@public.gmane.org>
Cc: linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ML nouveau
	<nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	Emil Velikov
	<emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	ML dri-devel
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	Bjorn Helgaas <helgaas-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Dave Airlie <airlied-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Mika Westerberg
	<mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Subject: Re: [PATCH 4/4] drm/nouveau/acpi: fix lockup with PCIe runtime PM
Date: Sat, 28 May 2016 14:27:01 +0200	[thread overview]
Message-ID: <20160528122701.GA11464@wunner.de> (raw)
In-Reply-To: <20160527213123.GB1777@al>

Hi Peter,

On Fri, May 27, 2016 at 11:31:23PM +0200, Peter Wu wrote:
> On Fri, May 27, 2016 at 02:01:39PM +0100, Emil Velikov wrote:
> > On 24 May 2016 at 23:53, Peter Wu <peter@lekensteyn.nl> wrote:
[snip]
> > > @@ -273,14 +296,14 @@ static bool nouveau_dsm_detect(void)
> > >                 vga_count++;
> > >
> > >                 nouveau_dsm_pci_probe(pdev, &has_mux, &has_optimus,
> > > -                                     &has_optimus_flags);
> > > +                                     &has_optimus_flags, &has_power_resources);
> > >         }
> > >
> > >         while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_3D << 8, pdev)) != NULL) {
> > >                 vga_count++;
> > >
> > >                 nouveau_dsm_pci_probe(pdev, &has_mux, &has_optimus,
> > > -                                     &has_optimus_flags);
> > > +                                     &has_optimus_flags, &has_power_resources);
> > >         }
> > >
> > This and earlier patch break things in a subtle way.
> > 
> > Namely: upon the second (and any later) call into the
> > nouveau_dsm_pci_probe() function, the had_foo flags are reset. Thus
> > only the specifics of the _final_ device are being used (at a later
> > stage). IMHO one should change that to "_any_ device", which will
> > match the original code and the actual intent further down in the
> > file.
> 
> The flags are only reset if any of the MUX or Optimus handles are found.
> If both are missing, the flags are not overridden. This is from patch 1:
> 
> +       /* Does not look like a Nvidia device. */
> +       if (!supports_mux && !supports_opt)
> +               return;
> 
> The reason why later calls override early ones is because some Optimus
> laptops have the _DSM method on both the Intel GPU (00:02.0) and the
> Nvidia one (01:00.0).

Sounds like you may want to check for pdev->vendor == PCI_VENDOR_ID_NVIDIA
or export pci_get_dev_by_id() and use that to match for class and vendor.

Best regards,

Lukas
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

  reply	other threads:[~2016-05-28 12:27 UTC|newest]

Thread overview: 26+ 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:52   ` [PATCH 1/4] drm/nouveau/acpi: ensure matching ACPI handle and supported functions Peter Wu
2016-05-24 22:52   ` [PATCH 2/4] drm/nouveau/acpi: return supported DSM functions Peter Wu
2016-05-24 22:53   ` [PATCH 3/4] drm/nouveau/acpi: check for function 0x1B before using it Peter Wu
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
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 [this message]
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=20160528122701.GA11464@wunner.de \
    --to=lukas-jfq808j9c/izqb+pc5nmwq@public.gmane.org \
    --cc=airlied-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@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=peter-VTkQYDcBqhK7DlmcbJSQ7g@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