From: Mark Brown <broonie@kernel.org>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
Mario Limonciello <mario.limonciello@amd.com>
Subject: linux-next: manual merge of the amdgpu tree with the drm-fixes tree
Date: Fri, 18 Sep 2026 12:49:06 +0100 [thread overview]
Message-ID: <aq0lMnjHbQIUW2aB@sirena.org.uk> (raw)
[-- Attachment #1: Type: text/plain, Size: 5142 bytes --]
Hi all,
Today's linux-next merge of the amdgpu tree got a conflict in:
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
between commit:
04de4007d3238 ("drm/amdgpu: Fix GPU PCIe link capability reporting")
from the drm-fixes tree and commits:
7ea6a47224e2c ("drm/amdgpu: Fix GPU PCIe link capability reporting")
15b2b06744561 ("drm/amdgpu: Reuse cached PCIe link device")
from the amdgpu tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --combined drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index cf39db90dfe0a,dcf72ff438889..0000000000000
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@@ -68,6 -68,7 +68,7 @@@
#include "amdgpu_vf_error.h"
#include "amdgpu_amdkfd.h"
+ #include "amdgpu_ip.h"
#include "amdgpu_pm.h"
#include "amdgpu_xgmi.h"
@@@ -1353,31 -1354,6 +1354,6 @@@ static bool amdgpu_device_aspm_support_
#endif
}
- /*
- * 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
*
@@@ -1413,7 -1389,7 +1389,7 @@@ bool amdgpu_device_should_use_aspm(stru
* 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);
+ aspm_pdev = adev->link_dev;
parent = pci_upstream_bridge(aspm_pdev);
if (!parent) {
dev_dbg(adev->dev, "ASPM: no upstream PCIe link for %s\n",
@@@ -1739,17 -1715,10 +1715,17 @@@ static bool amdgpu_switcheroo_can_switc
return atomic_read(&dev->open_count) == 0;
}
+static void amdgpu_switcheroo_pre_switch(struct pci_dev *pdev)
+{
+ struct drm_device *dev = pci_get_drvdata(pdev);
+
+ drm_client_dev_acquire_outputs(dev);
+}
+
static const struct vga_switcheroo_client_ops amdgpu_switcheroo_ops = {
.set_gpu_state = amdgpu_switcheroo_set_state,
- .reprobe = NULL,
.can_switch = amdgpu_switcheroo_can_switch,
+ .pre_switch = amdgpu_switcheroo_pre_switch,
};
/**
@@@ -1968,15 -1937,26 +1944,26 @@@ static void amdgpu_uid_fini(struct amdg
static void amdgpu_device_init_pcie_links(struct amdgpu_device *adev)
{
+ struct pci_dev *swds, *swus;
+
adev->link_dev = adev->pdev;
adev->link_partner = pci_upstream_bridge(adev->link_dev);
- /* Skip upstream/downstream switches internal to the dGPU. */
- while (adev->link_partner &&
- adev->link_partner->vendor == PCI_VENDOR_ID_ATI) {
- adev->link_dev = adev->link_partner;
- adev->link_partner = pci_upstream_bridge(adev->link_dev);
- }
+ /* Skip an upstream/downstream switch internal to the dGPU. */
+ swds = adev->link_partner;
+ if (!swds || swds->vendor != PCI_VENDOR_ID_ATI ||
+ pci_pcie_type(swds) != PCI_EXP_TYPE_DOWNSTREAM)
+ return;
+
+ 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->link_dev = swus;
+ adev->link_partner = pci_upstream_bridge(swus);
}
/**
@@@ -3855,6 -3835,7 +3842,7 @@@ int amdgpu_device_init(struct amdgpu_de
spin_lock_init(&adev->irq.lock);
+ amdgpu_ip_map_init(adev);
amdgpu_early_init_rlc_reg_funcs(adev);
amdgpu_device_init_apu_flags(adev);
@@@ -6434,16 -6415,10 +6422,10 @@@ static void amdgpu_device_cache_switch_
struct pci_dev *swus, *swds;
int r;
+ swus = adev->link_dev != adev->pdev ? adev->link_dev : NULL;
+ if (!swus)
+ return;
swds = pci_upstream_bridge(adev->pdev);
- if (!swds || swds->vendor != PCI_VENDOR_ID_ATI ||
- pci_pcie_type(swds) != PCI_EXP_TYPE_DOWNSTREAM)
- return;
- 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;
/* If already saved, return */
if (adev->pcie_reset_ctx.swus)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next reply other threads:[~2026-09-18 11:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 11:49 Mark Brown [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-06-08 11:29 linux-next: manual merge of the amdgpu tree with the drm-fixes tree Mark Brown
2026-03-05 13:37 Mark Brown
2026-02-27 14:00 Mark Brown
2021-07-23 2:58 Stephen Rothwell
2021-07-23 3:08 ` Stephen Rothwell
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=aq0lMnjHbQIUW2aB@sirena.org.uk \
--to=broonie@kernel.org \
--cc=alexander.deucher@amd.com \
--cc=alexdeucher@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=mario.limonciello@amd.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