Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Lowne Onema <lowneonema@gmail.com>
Cc: bhelgaas@google.com, rafael.j.wysocki@intel.com,
	alexander.deucher@amd.com, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI: quirks: Prevent D3 for Acer Swift SF515-51T Root Port to fix audio
Date: Sun, 2 Aug 2026 10:42:56 +0200	[thread overview]
Message-ID: <am8DEH0wfphdAX0n@wunner.de> (raw)
In-Reply-To: <CA+1pjEmQgcfhjj56yjuXWVshBM+soFC7RZHaGwaaF=ZFCr1Lyg@mail.gmail.com>

On Sat, Aug 01, 2026 at 08:10:25PM +0200, Lowne Onema wrote:
> commit c6e331312ebf ("PCI/ACPI: Whitelist hotplug ports for D3 if
> power managed by ACPI") made Root Ports newly eligible for D3 when
> ACPI reports the port as power-manageable. On my Acer Swift
> SF515-51T, this Root Port (Intel Cannon Point-LP PCI Express Root
> Port #9, 8086:9db0, always empty on this SKU) is put into D3 as a
> result, and doing so permanently silences the internal speakers
> until the machine is rebooted.
> 
> Disassembly of this board's ACPI tables shows the Root Port's power
> resource (RP09.PXP) and the SATA port SAT0.PRT1 share GPIO pin
> 0x0402000D as their power enable line. That GPIO also gates a
> rail the internal speaker amplifier depends on, but this dependency
> is not expressed anywhere in ACPI -- HDAS._PR0 only references
> PAUD, so the kernel has no way to know that putting the Root Port in D3
> cuts power the audio codec/amp circuitry needs.
[...]
> I went with a DMI-matched PCI_DEV_FLAGS_NO_D3 quirk since that seems to
> be the go-to pattern in this file for "device breaks in D3" cases (I saw
> quirk_no_ata_d3 above it). Is that the right mechanism here, or would
> you prefer something scoped differently?

It is *one* option.  An alternative approach we've used in similar
cases is to create a device link.  It allows expressing a power
dependency of one device on another device.  E.g. GPUs frequently
expose an HDA controller as Function 1 of a PCI device which is
only accessible if Function 0 (the actual GPU) is powered on.
See quirk_gpu_hda() in drivers/pci/quirks.c.  For this approach
you need two struct device (the supplier and the consumer) and
I'm not sure if the speaker or speaker amplifier is represented
as a struct device.  If it's not, then this approach is not viable.
A workaround might be to use the HDA controller as supplier (to which
the speaker is attached), but that's not perfect.

Another option would be to patch the ACPI tables.  There are several
ways to do this via the initrd, via EFI etc.  See:

admin-guide/acpi/initrd_table_override.rst
https://github.com/xCuri0/ReBarUEFI/wiki/DSDT-Patching
https://wiki.archlinux.org/title/DSDT

Using a DSDT patch benefits other OSes you might have installed,
but doesn't benefit other Linux users who encounter the same problem.

In drivers/acpi/x86/ we carry a number of ACPI quirks for problematic
devices.  Amending that would be a third option to overcome the issue.
The kernel enumerates power resources and the dependencies of devices
on them, basically you'd have to add a quirk to amend those data
structures.  At the bottom of drivers/acpi/power.c, you'll find
existing quirks for products with broken power resource descriptions.
I don't know why these live in power.c, they're x86-specific and
everything in this file is also compiled into kernels for other
ACPI-supporting arches such as arm64.  Generally we try to move such
quirks to files that are only compiled on x86 (such as everything
under drivers/acpi/x86) or at least #ifdef them to CONFIG_X86.

The fourth and best option would be if the vendor would provide
a BIOS update to fix the ACPI table.  Often vendors are loathe
to do this for older products and then a workaround at the OS level
is the only solution, but please double-check that you've got the
latest BIOS version installed.

> Fixes: c6e331312ebf ("PCI/ACPI: Whitelist hotplug ports for D3 if
> power managed by ACPI")
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=212463
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=214125
> Signed-off-by: paasshme <lowneonema@gmail.com>

A minor nit, you should use your real name in the Signed-off-by tag,
you may want to use "Closes:" instead of "Link:" and you may also
want to add a tag "Cc: stable@vger.kernel.org # v5.10+".

> Apologies in advance for any formatting/process mistakes,
> that's my first patch.

You're doing great!  I am sorry for the breakage caused by my commit!

Thanks,

Lukas

      reply	other threads:[~2026-08-02  8:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-01 18:10 [PATCH] PCI: quirks: Prevent D3 for Acer Swift SF515-51T Root Port to fix audio Lowne Onema
2026-08-02  8:42 ` Lukas Wunner [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=am8DEH0wfphdAX0n@wunner.de \
    --to=lukas@wunner.de \
    --cc=alexander.deucher@amd.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lowneonema@gmail.com \
    --cc=rafael.j.wysocki@intel.com \
    /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