File: 0001-Fix-p2p.c-compilation-on-newer-kernels.patch

package info (click to toggle)
xrt 202610.2.21.21-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 405,432 kB
  • sloc: asm: 1,880,448; ansic: 422,549; cpp: 419,350; python: 11,112; sh: 10,302; makefile: 4,575; lisp: 1,346; xml: 617; csh: 180; javascript: 145; perl: 48; cs: 36; tcl: 22
file content (36 lines) | stat: -rw-r--r-- 1,426 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Description: Compatibility with newer kernels
Author: Mario Limonciello <superm1@gmail.com>
Origin: other
Forwarded: https://github.com/Xilinx/XRT/pull/9411
Last-Update: 2025-11-18

From 516ce3da0423c52205cd5c827619eca05e3d9af4 Mon Sep 17 00:00:00 2001
From: "Mario Limonciello (AMD)" <superm1@kernel.org>
Date: Thu, 6 Nov 2025 10:56:14 -0600
Subject: [PATCH 1/9] Fix p2p.c compilation on newer kernels

Link: https://git.kernel.org/torvalds/c/6632863226d88
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
 src/runtime_src/core/pcie/driver/linux/xocl/subdev/p2p.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xrt/XRT/src/runtime_src/core/pcie/driver/linux/xocl/subdev/p2p.c b/src/runtime_src/core/pcie/driver/linux/xocl/subdev/p2p.c
index 040002241..eb96a9366 100644
--- a/xrt/XRT/src/runtime_src/core/pcie/driver/linux/xocl/subdev/p2p.c
+++ b/xrt/XRT/src/runtime_src/core/pcie/driver/linux/xocl/subdev/p2p.c
@@ -513,7 +513,11 @@ static void p2p_read_addr_mgmtpf(struct p2p *p2p)
 	mb_req->req = XCL_MAILBOX_REQ_READ_P2P_BAR_ADDR;
 	mb_p2p = (struct xcl_mailbox_p2p_bar_addr *)mb_req->data;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0)
 	if (!iommu_present(&pci_bus_type)){
+#else
+	if (!device_iommu_mapped(&pcidev->dev)) {
+#endif
 		mb_p2p->p2p_bar_len = pci_resource_len(pcidev, p2p->p2p_bar_idx);
 		mb_p2p->p2p_bar_addr = pci_resource_start(pcidev,
 				p2p->p2p_bar_idx);
-- 
2.43.0