All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Rostecki <mrostecki@suse.de>
To: Lukas Wunner <lukas@wunner.de>
Cc: matoro <matoro@airmail.cc>, Michal Rostecki <mrostecki@suse.com>,
	linux-pci@vger.kernel.org,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Arthur Borsboom <arthurborsboom@gmail.com>,
	linux-acpi@vger.kernel.org, Shai Coleman <git@shaicoleman.com>,
	Bjorn Helgaas <helgaas@kernel.org>,
	amd-gfx@lists.freedesktop.org,
	Aaron Zakhrov <aaron.zakhrov@gmail.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Len Brown <lenb@kernel.org>
Subject: Re: [PATCH] PCI/ACPI: Whitelist hotplug ports for D3 if power managed by ACPI
Date: Fri, 02 Oct 2020 21:56:28 +0200	[thread overview]
Message-ID: <86r1qgcsgj.fsf@> (raw)
In-Reply-To: <cea9071dc46025f0d89cdfcec0642b7bfa45968a.1601614985.git.lukas@wunner.de>

Lukas Wunner writes:
> Recent laptops with dual AMD GPUs fail to suspend the discrete GPU, thus
> causing lockups on system sleep and high power consumption at runtime.
> The discrete GPU would normally be suspended to D3cold by turning off
> ACPI _PR3 Power Resources of the Root Port above the GPU.
>
> However on affected systems, the Root Port is hotplug-capable an
> pci_bridge_d3_possible() only allows hotplug ports to go to D3 if they
> belong to a Thunderbolt device or if the Root Port possesses a
> "HotPlugSupportInD3" ACPI property.  Neither is the case on affected
> laptops.  The reason for whitelisting only specific, known to work
> hotplug ports for D3 is that there have been reports of SkyLake Xeon-SP
> systems raising Hardware Error NMIs upon suspending their hotplug ports:
> https://lore.kernel.org/linux-pci/20170503180426.GA4058@otc-nc-03/
>
> But if a hotplug port is power manageable by ACPI (as can be detected
> through presence of Power Resources and corresponding _PS0 and _PS3
> methods) then it ought to be safe to suspend it to D3.  To this end,
> amend acpi_pci_bridge_d3() to whitelist such ports for D3.
>
> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1222
> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1252
> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1304
> Reported-and-tested-by: Arthur Borsboom <arthurborsboom@gmail.com>
> Reported-and-tested-by: matoro <matoro@airmail.cc>
> Reported-by: Aaron Zakhrov <aaron.zakhrov@gmail.com>
> Reported-by: Michal Rostecki <mrostecki@suse.com>
> Reported-by: Shai Coleman <git@shaicoleman.com>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> Cc: stable@vger.kernel.org
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>

Thanks! It fixes the issue for me.

Reported-and-tested-by: Michal Rostecki <mrostecki@suse.com>

> ---
>  drivers/pci/pci-acpi.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
> index d5869a0..d9aa551 100644
> --- a/drivers/pci/pci-acpi.c
> +++ b/drivers/pci/pci-acpi.c
> @@ -944,6 +944,16 @@ static bool acpi_pci_bridge_d3(struct pci_dev *dev)
>  	if (!dev->is_hotplug_bridge)
>  		return false;
>  
> +	/* Assume D3 support if the bridge is power-manageable by ACPI. */
> +	adev = ACPI_COMPANION(&dev->dev);
> +	if (!adev && !pci_dev_is_added(dev)) {
> +		adev = acpi_pci_find_companion(&dev->dev);
> +		ACPI_COMPANION_SET(&dev->dev, adev);
> +	}
> +
> +	if (adev && acpi_device_power_manageable(adev))
> +		return true;
> +
>  	/*
>  	 * Look for a special _DSD property for the root port and if it
>  	 * is set we know the hierarchy behind it supports D3 just fine.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      parent reply	other threads:[~2020-10-02 20:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02  5:10 [PATCH] PCI/ACPI: Whitelist hotplug ports for D3 if power managed by ACPI Lukas Wunner
2020-10-02  5:10 ` Lukas Wunner
2020-10-02 13:15 ` Deucher, Alexander
2020-10-02 13:15   ` Deucher, Alexander
2020-10-02 14:17 ` Rafael J. Wysocki
2020-10-02 14:17   ` Rafael J. Wysocki
2020-10-02 14:20   ` Deucher, Alexander
2020-10-02 14:20     ` Deucher, Alexander
2020-10-02 14:24     ` Rafael J. Wysocki
2020-10-02 14:24       ` Rafael J. Wysocki
2020-10-02 14:30       ` Deucher, Alexander
2020-10-02 14:30         ` Deucher, Alexander
2020-10-02 19:56 ` Michal Rostecki [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=86r1qgcsgj.fsf@ \
    --to=mrostecki@suse.de \
    --cc=aaron.zakhrov@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=arthurborsboom@gmail.com \
    --cc=git@shaicoleman.com \
    --cc=helgaas@kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=matoro@airmail.cc \
    --cc=mika.westerberg@linux.intel.com \
    --cc=mrostecki@suse.com \
    --cc=rjw@rjwysocki.net \
    /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.