From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev, Yang Wang <kevinyang.wang@amd.com>,
Hawking Zhang <Hawking.Zhang@amd.com>,
Kenneth Feng <kenneth.feng@amd.com>,
Alex Deucher <alexander.deucher@amd.com>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.15 41/76] drm/amdgpu: check ASPM on the dGPU host link
Date: Tue, 25 Aug 2026 15:26:34 +0200 [thread overview]
Message-ID: <20260825132543.178416648@linuxfoundation.org> (raw)
In-Reply-To: <20260825132541.568214149@linuxfoundation.org>
5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Wang <kevinyang.wang@amd.com>
commit 2a9c5154a5650c09ad44ff5e1dff74754e15a3c6 upstream.
dGPUs with an internal PCIe switch expose graphics functions below the
switch downstream port. The automatic ASPM check uses the display
endpoint and evaluates the internal link instead of the host link.
Use the switch upstream port for the check and report the selected
link.
Fixes: 0ab5d711ec74 ("drm/amd: Refactor `amdgpu_aspm` to be evaluated per device")
Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 4e0d6f2876e704fff707b18c40dbd383aea4a1c9)
Cc: stable@vger.kernel.org
[ Dropped the upstream APU and `amdgpu_device_aspm_support_quirk(adev)` context lines, keeping 6.1's old-signature quirk helper untouched. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 50 ++++++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1352,6 +1352,31 @@ bool amdgpu_device_pcie_dynamic_switchin
return true;
}
+/*
+ * Some dGPUs expose their display endpoint below an internal PCIe switch.
+ * Use the switch upstream port to query the host-facing link.
+ */
+static struct pci_dev *amdgpu_device_get_aspm_pdev(struct amdgpu_device *adev)
+{
+ struct pci_dev *swds, *swus;
+
+ swds = pci_upstream_bridge(adev->pdev);
+ if (!swds ||
+ (swds->vendor != PCI_VENDOR_ID_ATI &&
+ swds->vendor != PCI_VENDOR_ID_AMD) ||
+ pci_pcie_type(swds) != PCI_EXP_TYPE_DOWNSTREAM)
+ return adev->pdev;
+
+ swus = pci_upstream_bridge(swds);
+ if (!swus ||
+ (swus->vendor != PCI_VENDOR_ID_ATI &&
+ swus->vendor != PCI_VENDOR_ID_AMD) ||
+ pci_pcie_type(swus) != PCI_EXP_TYPE_UPSTREAM)
+ return adev->pdev;
+
+ return swus;
+}
+
/**
* amdgpu_device_should_use_aspm - check if the device should program ASPM
*
@@ -1364,6 +1389,9 @@ bool amdgpu_device_pcie_dynamic_switchin
*/
bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev)
{
+ struct pci_dev *aspm_pdev, *parent;
+ bool enabled;
+
switch (amdgpu_aspm) {
case -1:
break;
@@ -1374,7 +1402,27 @@ bool amdgpu_device_should_use_aspm(struc
default:
return false;
}
- return pcie_aspm_enabled(adev->pdev);
+
+ /*
+ * pcie_aspm_enabled() checks the link between its argument and
+ * the immediate upstream bridge. Use SWUS for dGPUs with an
+ * internal switch so that this is the host-facing link.
+ */
+ aspm_pdev = amdgpu_device_get_aspm_pdev(adev);
+ parent = pci_upstream_bridge(aspm_pdev);
+ if (!parent) {
+ dev_dbg(adev->dev, "ASPM: no upstream PCIe link for %s\n",
+ pci_name(aspm_pdev));
+ return false;
+ }
+
+ enabled = pcie_aspm_enabled(aspm_pdev);
+ /* Report the exact link used for the automatic ASPM decision. */
+ dev_dbg(adev->dev, "ASPM: link %s <-> %s is %s\n",
+ pci_name(parent), pci_name(aspm_pdev),
+ enabled ? "enabled" : "disabled");
+
+ return enabled;
}
bool amdgpu_device_aspm_support_quirk(void)
next prev parent reply other threads:[~2026-08-25 13:58 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 13:25 [PATCH 5.15 00/76] 5.15.218-rc1 review Greg Kroah-Hartman
2026-08-25 13:25 ` [PATCH 5.15 01/76] PCI: host-generic: Fix NULL pointer dereference on 32-bit CAM systems Greg Kroah-Hartman
2026-08-25 13:25 ` [PATCH 5.15 02/76] Bluetooth: RFCOMM: take rfcomm_mutex for the deferred setup accept Greg Kroah-Hartman
2026-08-25 13:25 ` [PATCH 5.15 03/76] rndis_host: add overflow check in rndis_rx_fixup() Greg Kroah-Hartman
2026-08-25 13:25 ` [PATCH 5.15 04/76] ALSA: dummy: Check card index validity at probe Greg Kroah-Hartman
2026-08-25 13:25 ` [PATCH 5.15 05/76] ocfs2: fix missing metadata reservation for large xattrs Greg Kroah-Hartman
2026-08-25 13:25 ` [PATCH 5.15 06/76] null_blk: fix UBSAN shift-out-of-bounds when zone_size is 0 or overflows Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 07/76] ext4: stop retrying saturated xattr cache entries Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 08/76] ext4: clear error before retrying inode xattr space fallback Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 09/76] xfs: validate attr entry pointer before field access Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 10/76] gpio: ml-ioh: use raw_spinlock_t for the register lock Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 11/76] mm/huge_memory: fix huge_zero_pfn race Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 12/76] misc: fastrpc: separate fastrpc device from channel context Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 13/76] misc: fastrpc: Rework fastrpc_req_munmap Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 14/76] misc: fastrpc: Remove buffer from list prior to unmap operation Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 15/76] perf/core: Fix child_total_time_enabled accounting bug at task exit Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 16/76] perf: Fix cgroup state vs ERROR Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 17/76] perf: Fix dangling cgroup pointer in cpuctx Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 18/76] perf/core: Fix group leader use-after-free after sibling detach Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 19/76] NTB: ntb_netdev: Preserve RX queue depth on allocation failure Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 20/76] serial: amba-pl011: synchronize DMA teardown Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 21/76] packet: use consistent hard_header_len in non-ring send paths Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 22/76] packet: use consistent hard_header_len in TX_RING send path Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 23/76] net/sched: reject overly deep qdisc hierarchies Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 24/76] packet: synchronize pressure clearing with ring reconfiguration Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 25/76] inet: frags: publish queues before arming timer Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 26/76] mmc: atmel-mci: Fix use-after-free in atmci_remove due to race condition Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 27/76] s390/vfio_ccw: Cancel existing workqueues Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 28/76] xfs: bounds-check buffer log items dirty bitmap Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 29/76] nfc: digital: clamp SENSF_RES length to the destination buffer Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 30/76] nfc: fdp: bound the device-reported read length and fix an skb leak Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 31/76] nfc: microread: validate target discovery payload lengths Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 32/76] nfc: llcp: bound the connect_sn TLV walk to the skb Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 33/76] nfc: llcp: fix OOB read and u8 offset wrap in TLV parsers Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 34/76] nfc: llcp: reject PDUs shorter than the LLCP header Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 35/76] nfc: pn533: purge fragmented skbs during cleanup Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 36/76] nfc: st21nfca: validate ATR_REQ length against the received frame Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 37/76] nfc: nci: fix out-of-bounds write in nci_target_auto_activated() Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 38/76] nfc: nci: fix uninit-value in the RF discover/activated NTF handlers Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 39/76] nfc: nci: free destination parameters when closing a connection Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 40/76] libceph: fix OOB read in decode_watchers() via missing bounds check Greg Kroah-Hartman
2026-08-25 13:26 ` Greg Kroah-Hartman [this message]
2026-08-25 13:26 ` [PATCH 5.15 42/76] ipv4: reject undersized MTUs in ip_do_fragment() Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 43/76] ipv6: fix use-after-free in ip6_finish_output2() Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 44/76] nvmet-fc: fix invalid free in LS IOD error path Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 45/76] nvmet-tcp: Do not WARN on remotely-controlled oversized SGL allocations Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 46/76] s390/vfio_ccw: Ensure index for read/write regions are within range Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 47/76] s390/vfio_ccw: Selectively expand io_mutex Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 48/76] s390/vfio_ccw: Implement a crw lock Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 49/76] mptcp: avoid combining some incoming suboptions Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 50/76] ASoC: codecs: lpass-tx-macro: Fix enum kcontrol accesses Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 51/76] KVM: x86/mmu: Retry page fault if root is invalidated by memslot update Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 52/76] KVM: x86/mmu: Directly "destroy" PTE list when recycling rmaps Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 53/76] KVM: x86/mmu: Rename pte_list_{destroy,remove}() to show they zap SPTEs Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 54/76] KVM: x86/mmu: Document the "rules" for using host_pfn_mapping_level() Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 55/76] KVM: Rename mmu_notifier_* to mmu_invalidate_* Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 56/76] KVM: x86/mmu: Split out TDP MMU page fault handling Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 57/76] KVM: x86/mmu: Rename __direct_map() to direct_map() Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 58/76] KVM: x86: Check for invalid/obsolete root *after* making MMU pages available Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 59/76] HID: magicmouse: do not keep a stale msc->input if no input is claimed Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 60/76] HID: magicmouse: Prevent out-of-bounds (OOB) read during DOUBLE_REPORT_ID Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 61/76] HID: core: fix OOB read of field->usage in hid_set_field() Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 62/76] xfrm: fix sk_dst_cache double-free in xfrm_user_policy() Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 63/76] KVM: x86: Retry page fault if MMU reload is pending and root has no sp Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 64/76] iomap: adjust read range correctly for non-block-aligned positions Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 65/76] s390/vfio_ccw: Free all memory if cp_init() fails Greg Kroah-Hartman
2026-08-25 13:26 ` [PATCH 5.15 66/76] Input: atkbd - skip deactivate for HONOR FMB-Ps internal keyboard Greg Kroah-Hartman
2026-08-25 13:27 ` [PATCH 5.15 67/76] Input: atkbd - skip deactivate for HONOR ZQC-P Greg Kroah-Hartman
2026-08-25 13:27 ` [PATCH 5.15 68/76] mptcp: pm: ADD_ADDR rtx: allow ID 0 Greg Kroah-Hartman
2026-08-25 13:27 ` [PATCH 5.15 69/76] mptcp: pm: ADD_ADDR rtx: always decrease sk refcount Greg Kroah-Hartman
2026-08-25 13:27 ` [PATCH 5.15 70/76] mptcp: pm: ADD_ADDR rtx: free sk if last Greg Kroah-Hartman
2026-08-25 13:27 ` [PATCH 5.15 71/76] mptcp: pm: fix data race in add_addr timer callback Greg Kroah-Hartman
2026-08-25 13:27 ` [PATCH 5.15 72/76] can: use skb hash instead of private variable in headroom Greg Kroah-Hartman
2026-08-25 13:27 ` [PATCH 5.15 73/76] can: isotp: fix timer drain order, wakeup handling and tx_gen ordering Greg Kroah-Hartman
2026-08-25 13:27 ` [PATCH 5.15 74/76] HID: core: fix number/pointer type confusion on long items Greg Kroah-Hartman
2026-08-25 13:27 ` [PATCH 5.15 75/76] HID: sensor: custom: Fix use-after-free in enable_sensor Greg Kroah-Hartman
2026-08-25 13:27 ` [PATCH 5.15 76/76] HID: hyperv: validate initial device info bounds Greg Kroah-Hartman
2026-08-25 18:17 ` [PATCH 5.15 00/76] 5.15.218-rc1 review Florian Fainelli
2026-08-25 19:34 ` Pavel Machek
2026-08-26 10:28 ` Jon Hunter
2026-08-26 10:56 ` Greg Kroah-Hartman
2026-08-26 0:25 ` Shuah Khan
2026-08-26 6:34 ` Ron Economos
2026-08-26 7:40 ` Barry K. Nathan
2026-08-26 10:32 ` Brett A C Sheffield
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=20260825132543.178416648@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=Hawking.Zhang@amd.com \
--cc=alexander.deucher@amd.com \
--cc=kenneth.feng@amd.com \
--cc=kevinyang.wang@amd.com \
--cc=patches@lists.linux.dev \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.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