All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yazen Ghannam <yazen.ghannam@amd.com>
To: <x86@kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Filip Barczyk <filip.barczyk@pico.net>,
	"Yazen Ghannam" <yazen.ghannam@amd.com>
Subject: [PATCH 2/2] x86/amd_node: Use new root search helper
Date: Tue, 30 Sep 2025 16:45:46 +0000	[thread overview]
Message-ID: <20250930-fix-amd-root-v1-2-ce28731c349f@amd.com> (raw)
In-Reply-To: <20250930-fix-amd-root-v1-0-ce28731c349f@amd.com>

...to reduce code duplication.

No functional change intended.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
---
 arch/x86/kernel/amd_node.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/arch/x86/kernel/amd_node.c b/arch/x86/kernel/amd_node.c
index 4a3d9ca6e225..02254e2034bd 100644
--- a/arch/x86/kernel/amd_node.c
+++ b/arch/x86/kernel/amd_node.c
@@ -268,18 +268,8 @@ static int amd_cache_roots(void)
 static int reserve_root_config_spaces(void)
 {
 	struct pci_dev *root = NULL;
-	struct pci_bus *bus = NULL;
-
-	while ((bus = pci_find_next_bus(bus))) {
-		/* Root device is Device 0 Function 0 on each Primary Bus. */
-		root = pci_get_slot(bus, 0);
-		if (!root)
-			continue;
-
-		if (root->vendor != PCI_VENDOR_ID_AMD &&
-		    root->vendor != PCI_VENDOR_ID_HYGON)
-			continue;
 
+	while ((root = get_next_root(root))) {
 		pci_dbg(root, "Reserving PCI config space\n");
 
 		/*

-- 
2.51.0


  parent reply	other threads:[~2025-09-30 16:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-30 16:45 [PATCH 0/2] AMD root search fix Yazen Ghannam
2025-09-30 16:45 ` [PATCH 1/2] x86/amd_node: Fix AMD root device caching Yazen Ghannam
2025-09-30 18:07   ` Mario Limonciello (AMD) (kernel.org)
2025-10-01 13:46     ` Yazen Ghannam
2025-10-07 17:30       ` Filip Barczyk
2025-10-07 17:37       ` Filip Barczyk
2025-10-21 12:29   ` Borislav Petkov
2025-10-21 13:37     ` Yazen Ghannam
2025-10-21 14:15       ` Borislav Petkov
2025-10-21 14:25         ` Yazen Ghannam
2025-10-22 11:13   ` Borislav Petkov
2025-10-22 13:19     ` Yazen Ghannam
2025-10-22 18:48       ` Borislav Petkov
2025-09-30 16:45 ` Yazen Ghannam [this message]
2025-09-30 18:07 ` [PATCH 0/2] AMD root search fix Mario Limonciello (AMD) (kernel.org)

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=20250930-fix-amd-root-v1-2-ce28731c349f@amd.com \
    --to=yazen.ghannam@amd.com \
    --cc=filip.barczyk@pico.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=x86@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 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.