All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Wu <peter-VTkQYDcBqhK7DlmcbJSQ7g@public.gmane.org>
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Nicolas Mercier
	<mercier.nicolas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Tobias Klausmann
	<tobias.johannes.klausmann-AqjdNwhu20eELgA04lAiVw@public.gmane.org>
Subject: Re: Nouveau: kernel hang on Optimus+Intel+NVidia GeForce	1060m
Date: Mon, 18 Sep 2017 00:37:01 +0100	[thread overview]
Message-ID: <CC3EAE9B-175B-47EA-9286-A543C9357DAD@lekensteyn.nl> (raw)
In-Reply-To: <CAKyUnMVKNHkYa9TMf9_MFXEfLV-qx42Vg5eKh1ReT03Eo+3xJQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Nicholas,

Increasing the timeout won't help as the dGPU is not powered/available. If you have an external monitor connected, the dGPU will stay powered on and not suspend (with a (temporary) effect similar to booting with nouveau.runpm=0).

The reason for the failure to restore power is still unknown, it seems related to the PCI core.

Kind regards,
Peter
https://lekensteyn.nl
(pardon my brevity, top-posting and formatting, sent from my phone)


On 13 September 2017 23:13:59 BST, Nicolas Mercier <mercier.nicolas@gmail.com> wrote:
>Thanks Tobias, I tried this but unfortunately the only effect was thta
>the
>boot was delayed by an additional 4 seconds :(
>The original timeout is at
>drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c
>I tried to increase that timeout, but it did not seem to make a
>difference
>either.
>
>I think I get this error less often when I have a cable plugged in the
>output of that card at boot, whereas I always get this error when I
>boot
>without a monitor attached to the card.
>
>On Wed, Sep 13, 2017 at 2:28 PM, Tobias Klausmann <
>tobias.johannes.klausmann@mni.thm.de> wrote:
>
>> Hi,
>>
>> the system fails to initialize your vbios using secureboot (i had a
>rare
>> chance to on my system to witness it again), for now i traced it to
>> acr_boot_falcon() in
>> "linux/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0148cdec.c" where
>it
>> throws -110 which is -ETIMEDOUT. You could try to increase the
>timeout
>> and see if it helps something, similar to the following:
>>
>>
>> diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue.c
>> b/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue.c
>> index 77273b53672c..fc0cb187d80d 100644
>> --- a/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue.c
>> +++ b/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue.c
>> @@ -326,7 +326,7 @@ nvkm_msgqueue_post(struct nvkm_msgqueue *priv,
>enum
>> msgqueue_msg_priority prio,
>>         int ret;
>>
>>         if (wait_init &&
>!wait_for_completion_timeout(&priv->init_done,
>> -                                        msecs_to_jiffies(1000)))
>> +                                        msecs_to_jiffies(5000)))
>>                 return -ETIMEDOUT;
>>
>>         queue = priv->func->cmd_queue(priv, prio);
>>
>> diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c
>> b/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c
>> index fec0273158f6..c2ae525a0780 100644
>> --- a/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c
>> +++ b/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c
>> @@ -279,6 +279,7 @@ acr_boot_falcon(struct nvkm_msgqueue *priv, enum
>> nvkm_secboot_falcon falcon)
>>                 u32 flags;
>>                 u32 falcon_id;
>>         } cmd;
>> +       const struct nvkm_subdev *subdev = priv->falcon->owner;
>>
>>         memset(&cmd, 0, sizeof(cmd));
>>
>> @@ -290,7 +291,8 @@ acr_boot_falcon(struct nvkm_msgqueue *priv, enum
>> nvkm_secboot_falcon falcon)
>>         nvkm_msgqueue_post(priv, MSGQUEUE_MSG_PRIORITY_HIGH,
>&cmd.hdr,
>>                         acr_boot_falcon_callback, &completed, true);
>>
>> -       if (!wait_for_completion_timeout(&completed,
>> msecs_to_jiffies(1000)))
>> +       nvkm_error(subdev, "waiting for timeout in acr_boot_falcon
>> (msgqueue_0137bca5)\n");
>> +       if (!wait_for_completion_timeout(&completed,
>> msecs_to_jiffies(5000)))
>>                 return -ETIMEDOUT;
>>
>>         return 0;
>>
>>
>>
>> On 9/13/17 11:37 AM, Nicolas Mercier wrote:
>> > I am still looking for a solution. I have hacked around in the code
>> > and found out the following:
>> > - Nouveau prefers using PCIE power managemet over ACPI Optimus
>calls.
>> > I tried to force it to use Optimus ACPI calls, but there was an
>error
>> > calling the ACPI method so it bails out and uses PCIE PM anyway.
>> > - I tried to debug the PCIE pm states which internally uses ACPI to
>> > turn power on/off. I could print different statuses here and there.
>> > When the power is switched off, ACPI calls turn the power off then
>the
>> > kernel successfully puts the device in state D3Cold (also turning
>off
>> > power to the PCI Express port). When waking up, ACPI turns the
>power
>> > on, apparently successfully (Device [PEGP] transitioned to D0). But
>a
>> > read from the PCI bus to get the power state & other flags return
>> > 65535 (~0) and the kernel fails to set the device in D0 (although
>ACPI
>> > claims it is in D0)
>> > The call to pci_raw_set_power_state (in drivers/pci/pci.c) seems to
>> > fail because pci_read_config_word returns "~0" (and does not return
>> > any error code)
>> >
>> > I have tried different things; if I use pcie_port_pm=off, the
>NVidia
>> > card goes to state D3Hot (if I am not mistaken, its PCIE port is
>still
>> > powered) but that did not fix it. I tried to turn on or off
>different
>> > PCI/PCIexpress features such as hotplug, PM and so on. The only
>thing
>> > that works is that PM is fully disabled, which equals to the device
>> > not being powered off, so that would be equivalent to
>nouveau.runpm=0,
>> > which is not helping a lot. I have tried to force pcie aspm by
>> > recompiling the ACPI table, still no luck.
>> >
>> > I am still taking a look, but it seems like the problem comes from
>the
>> > PCIExpress PM functions and ACPI, not directly from Nouveau
>> >
>> > /n
>>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

      parent reply	other threads:[~2017-09-17 23:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 14:54 Nouveau: kernel hang on Optimus+Intel+NVidia GeForce 1060m Nicolas Mercier
2017-09-11 18:49 ` Tobias Klausmann
     [not found]   ` <cb794e03-6ca8-7e80-9277-ea780ee0bbd2-AqjdNwhu20eELgA04lAiVw@public.gmane.org>
2017-09-11 19:52     ` Nicolas Mercier
     [not found]       ` <CAKyUnMVeWzgptcN0CVLg4SYriY7+29wXcdaAH4Xig7tXSuXBtA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-13  9:37         ` Nicolas Mercier
     [not found]           ` <CAKyUnMW-OUpMtXoVgP0xz-LawgtewPGQEcu5P=CgYU_Bi9pqaQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-13 12:28             ` Tobias Klausmann
     [not found]               ` <e3e5a763-4a54-0b62-2151-d3f123ab5067-AqjdNwhu20eELgA04lAiVw@public.gmane.org>
2017-09-13 22:13                 ` Nicolas Mercier
     [not found]                   ` <CAKyUnMVKNHkYa9TMf9_MFXEfLV-qx42Vg5eKh1ReT03Eo+3xJQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-17 23:37                     ` Peter Wu [this message]

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=CC3EAE9B-175B-47EA-9286-A543C9357DAD@lekensteyn.nl \
    --to=peter-vtkqydcbqhk7dlmcbjsq7g@public.gmane.org \
    --cc=mercier.nicolas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=tobias.johannes.klausmann-AqjdNwhu20eELgA04lAiVw@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.