Skip to content

Commit a181899

Browse files
binujpBinu Jose Philip
andauthored
Add patch to mlnx-ofa_kernel module for IBT compatibility (#12045)
Co-authored-by: Binu Jose Philip <[email protected]>
1 parent e148529 commit a181899

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This patch is based on
2+
# https://opendev.org/starlingx/kernel/raw/commit/b6f8503866c3cae009d5b2e8e8db17149c917d9c/kernel-modules/mlnx-ofa_kernel/debian/patches/0003-Fix-the-obsolete-module-init.patch
3+
# modified to apply cleanly with no change in logic.
4+
5+
--- a/include/linux/compat-2.6.h
6+
+++ b/include/linux/compat-2.6.h
7+
@@ -31,9 +31,11 @@
8+
#define module_init(initfn) \
9+
static int __init __init_backport(void) \
10+
{ \
11+
- mlx_backport_dependency_symbol(); \
12+
+ mlx_backport_dependency_symbol(); \
13+
return initfn(); \
14+
} \
15+
- int init_module(void) __copy(initfn) __attribute__((alias("__init_backport")));
16+
+ int init_module(void) __copy(initfn) \
17+
+ __attribute__((alias("__init_backport"))); \
18+
+ ___ADDRESSABLE(init_module, __initdata);
19+
20+
#endif /* LINUX_26_COMPAT_H */

SPECS/mlnx-ofa_kernel/mlnx-ofa_kernel.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ Release: 1%{?dist}
103103
License: GPLv2
104104
Url: http://www.mellanox.com/
105105
Group: System Environment/Base
106-
Source0: https://linux.mellanox.com/public/repo/mlnx_ofed/24.10-0.7.0.0/SRPMS/mlnx-ofa_kernel-24.10.tgz#/%{_name}-%{_version}.tgz
106+
Source0: https://linux.mellanox.com/public/repo/mlnx_ofed/24.10-0.7.0.0/SRPMS/mlnx-ofa_kernel-24.10.tgz#/%{_name}-%{_version}.tgz
107+
Patch0: 001-fix-module-init-for-ibt.patch
108+
107109
BuildRoot: /var/tmp/%{name}-%{version}-build
108110
Vendor: Microsoft Corporation
109111
Distribution: Azure Linux
@@ -289,6 +291,7 @@ drivers against it.
289291

290292
%prep
291293
%setup -n %{_name}-%{_version}
294+
%patch 0 -p1
292295
set -- *
293296
mkdir source
294297
mv "$@" source/

0 commit comments

Comments
 (0)