File: 0006-Handle-namespace-import-change-from-kernel-6.13.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 (66 lines) | stat: -rw-r--r-- 2,431 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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 095eabab3e1977648ced65c6f82088244f625d0c Mon Sep 17 00:00:00 2001
From: "Mario Limonciello (AMD)" <superm1@kernel.org>
Date: Tue, 18 Nov 2025 22:08:40 -0600
Subject: [PATCH 6/9] Handle namespace import change from kernel 6.13

Link: https://github.com/torvalds/linux/commit/cdd30ebb1b9f36159d66f088b61aee264e649d7a
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
 .../core/pcie/driver/linux/xocl/userpf/xocl_drv.c  | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/xrt/XRT/src/runtime_src/core/pcie/driver/linux/xocl/userpf/xocl_drv.c b/src/runtime_src/core/pcie/driver/linux/xocl/userpf/xocl_drv.c
index cacc35252..639592186 100644
--- a/xrt/XRT/src/runtime_src/core/pcie/driver/linux/xocl/userpf/xocl_drv.c
+++ b/xrt/XRT/src/runtime_src/core/pcie/driver/linux/xocl/userpf/xocl_drv.c
@@ -7,7 +7,6 @@
  */
 
 #include <linux/aer.h>
-#include <linux/crc32c.h>
 #include <linux/iommu.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -15,6 +14,11 @@
 #include <linux/pci.h>
 #include <linux/random.h>
 #include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
+#include <linux/crc32.h>
+#else
+#include <linux/crc32c.h>
+#endif
 
 #include "common.h"
 #include "version.h" /* Generated file. The XRT version the driver works with */
@@ -621,7 +625,11 @@ static void xocl_mb_connect(struct xocl_dev *xdev)
 	mb_conn->kaddr = (uint64_t)kaddr;
 	mb_conn->paddr = (uint64_t)virt_to_phys(kaddr);
 	get_random_bytes(kaddr, PAGE_SIZE);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
+	mb_conn->crc32 = crc32_le(~0, kaddr, PAGE_SIZE);
+#else
 	mb_conn->crc32 = crc32c_le(~0, kaddr, PAGE_SIZE);
+#endif
 	mb_conn->version = XCL_MB_PROTOCOL_VER;
 
 	ret = xocl_peer_request(xdev, mb_req, reqlen, resp, &resplen,
@@ -2057,6 +2065,8 @@ MODULE_VERSION(XRT_DRIVER_VERSION);
 MODULE_DESCRIPTION(XOCL_DRIVER_DESC);
 MODULE_AUTHOR("Lizhi Hou <lizhi.hou@xilinx.com>");
 MODULE_LICENSE("GPL v2");
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0)  || defined(RHEL_9_0_GE)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
+MODULE_IMPORT_NS("DMA_BUF");
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0)  || defined(RHEL_9_0_GE)
 MODULE_IMPORT_NS(DMA_BUF);
 #endif
-- 
2.43.0