lkml.org 
[lkml]   [2026]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH 1/2] PCI/P2PDMA: Allow wildcard device IDs in host bridge list
From
Currently, the pci_p2pdma_whitelist array requires an exact match
for both vendor and device ID. Some hardware vendors support cross
bridge p2p across their entire silicon lineup, so add support for
wildcard device IDs to avoid the need to continuously update this
array.

Signed-off-by: Jacob Moroni <jmoroni@google.com>
---
drivers/pci/p2pdma.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
index e0f546166..25e9358d0 100644
--- a/drivers/pci/p2pdma.c
+++ b/drivers/pci/p2pdma.c
@@ -530,7 +530,7 @@ static bool cpu_supports_p2pdma(void)

static const struct pci_p2pdma_whitelist_entry {
unsigned short vendor;
- unsigned short device;
+ int device;
enum {
REQ_SAME_HOST_BRIDGE = 1 << 0,
} flags;
@@ -601,8 +601,12 @@ static bool __host_bridge_whitelist(struct pci_host_bridge *host,
device = root->device;

for (entry = pci_p2pdma_whitelist; entry->vendor; entry++) {
- if (vendor != entry->vendor || device != entry->device)
+ if (vendor != entry->vendor)
continue;
+
+ if (entry->device != PCI_ANY_ID && device != entry->device)
+ continue;
+
if (entry->flags & REQ_SAME_HOST_BRIDGE && !same_host_bridge)
return false;

--
2.53.0.1213.gd9a14994de-goog

\
 
 \ /
  Last update: 2026-04-09 17:05    [W:0.066 / U:1.956 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog