The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] PCI: quirks: Prevent D3 for Acer Swift SF515-51T Root Port to fix audio
@ 2026-08-01 18:10 Lowne Onema
  2026-08-02  8:42 ` Lukas Wunner
  0 siblings, 1 reply; 2+ messages in thread
From: Lowne Onema @ 2026-08-01 18:10 UTC (permalink / raw)
  To: bhelgaas
  Cc: lukas, rafael.j.wysocki, alexander.deucher, linux-pci,
	linux-kernel

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.

Prior to commit c6e331312ebf ("PCI/ACPI: Whitelist hotplug ports for
D3 if power managed by ACPI") this Root Port was never trusted for D3,
so the missing dependency had no observable effect. Confirmed on
hardware: forcing the port to stay in D0 (via
/sys/.../power/control) restores audio immediately, and letting it
re-enter D3 reliably kills it again.

Use PCI_DEV_FLAGS_NO_D3, matched to this exact model via DMI, to
keep the Root Port in D0, following the same pattern already used
for other model-specific D3 breakage in this file.

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>
---

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?
Apologies in advance for any formatting/process mistakes, that's my first patch.
Thanks for taking a look

 drivers/pci/quirks.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index b09f27f78..feb83a84b 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1471,6 +1471,41 @@ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_AL,
PCI_ANY_ID,
 DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_VIA, PCI_ANY_ID,
                              PCI_CLASS_STORAGE_IDE, 8, quirk_no_ata_d3);

+/*
+ * The Root Port that the Acer Swift SF515-51T's internal, always-empty PCIe
+ * slot is wired to (Intel Cannon Point-LP PCI Express Root Port #9) shares a
+ * GPIO power-good/enable line (0x0402000D) with SAT0.PRT1, a SATA port, per
+ * this board's own ACPI tables -- confirmed via DSDT/SSDT disassembly, not a
+ * naming coincidence. That GPIO gates a physical rail that isn't documented
+ * as a dependency anywhere else in ACPI, but real-world testing on this
+ * exact hardware shows it also feeds circuitry the internal speaker
+ * amplifier depends on: forcing this Root Port to stay out of D3 restores
+ * audio, and putting it back into D3 reliably kills it again.
+ *
+ * Before commit c6e331312ebf ("PCI/ACPI: Whitelist hotplug ports for D3 if
+ * power managed by ACPI"), this Root Port was never trusted for D3 at all,
+ * so the missing dependency was invisible -- the shared rail just stayed on
+ * incidentally. That commit's broadened trust condition lets this specific,
+ * always-empty port enter D3, silently cutting the rail and killing the
+ * internal speakers.
+ */
+static const struct dmi_system_id acer_sf515_rp_d3_dmi_table[] = {
+     {
+             .matches = {
+                     DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Acer"),
+                     DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Swift SF515-51T"),
+             },
+     },
+     {}
+};
+
+static void quirk_acer_sf515_rp09_no_d3(struct pci_dev *pdev)
+{
+     if (dmi_check_system(acer_sf515_rp_d3_dmi_table))
+             pdev->dev_flags |= PCI_DEV_FLAGS_NO_D3;
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x9db0,
quirk_acer_sf515_rp09_no_d3);
+
 /*
  * This was originally an Alpha-specific thing, but it really fits here.
  * The i82375 PCI/EISA bridge appears as non-classified. Fix that.
--
2.34.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI: quirks: Prevent D3 for Acer Swift SF515-51T Root Port to fix audio
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Lukas Wunner @ 2026-08-02  8:42 UTC (permalink / raw)
  To: Lowne Onema
  Cc: bhelgaas, rafael.j.wysocki, alexander.deucher, linux-pci,
	linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-02  8:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox