Accepting request 1099604 from hardware
OBS-URL: https://build.opensuse.org/request/show/1099604 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gasket-driver?expand=0&rev=2
This commit is contained in:
commit
e3b4aafc5a
43
fix-kernel-gte-6.4.patch
Normal file
43
fix-kernel-gte-6.4.patch
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
From 83cbe8264fc63511e4e6250f2426749951a340c8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chris Bradbury <chris@binaryspanner.com>
|
||||||
|
Date: Fri, 14 Jul 2023 18:55:56 +0100
|
||||||
|
Subject: [PATCH] Amend use of `class_create()` for kernels >= 6.4
|
||||||
|
|
||||||
|
The function signature for `class_create()` was changed in kernels >= 6.4.x to only accept a single argument (see kernel commit #dcfbb67).
|
||||||
|
|
||||||
|
This change will conditionally modify how `class_create()` is called depending on the kernel version.
|
||||||
|
---
|
||||||
|
src/gasket_core.c | 12 ++++++++++--
|
||||||
|
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/gasket_core.c b/src/gasket_core.c
|
||||||
|
index 139616b..b1c2726 100644
|
||||||
|
--- a/src/gasket_core.c
|
||||||
|
+++ b/src/gasket_core.c
|
||||||
|
@@ -27,6 +27,7 @@
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/printk.h>
|
||||||
|
#include <linux/sched.h>
|
||||||
|
+#include <linux/version.h>
|
||||||
|
|
||||||
|
#ifdef GASKET_KERNEL_TRACE_SUPPORT
|
||||||
|
#define CREATE_TRACE_POINTS
|
||||||
|
@@ -1837,8 +1838,15 @@ int gasket_register_device(const struct gasket_driver_desc *driver_desc)
|
||||||
|
internal = &g_descs[desc_idx];
|
||||||
|
mutex_init(&internal->mutex);
|
||||||
|
memset(internal->devs, 0, sizeof(struct gasket_dev *) * GASKET_DEV_MAX);
|
||||||
|
- internal->class =
|
||||||
|
- class_create(driver_desc->module, driver_desc->name);
|
||||||
|
+
|
||||||
|
+ /* Function signature for `class_create()` is changed in kernel >= 6.4.x
|
||||||
|
+ * to only accept a single argument.
|
||||||
|
+ * */
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
|
||||||
|
+ internal->class = class_create(driver_desc->module, driver_desc->name);
|
||||||
|
+#else
|
||||||
|
+ internal->class = class_create(driver_desc->name);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
if (IS_ERR(internal->class)) {
|
||||||
|
pr_err("Cannot register %s class [ret=%ld]\n",
|
||||||
|
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jul 19 23:18:19 UTC 2023 - Chris Bradbury <opensuse@chrbrd.com>
|
||||||
|
|
||||||
|
- Add `fix-kernel-gte-6.4.patch`.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu May 11 19:12:53 UTC 2023 - Chris Bradbury <obs@chrbrd.com>
|
Thu May 11 19:12:53 UTC 2023 - Chris Bradbury <obs@chrbrd.com>
|
||||||
|
|
||||||
|
@ -11,8 +11,10 @@
|
|||||||
# case the license is the MIT License). An "Open Source License" is a
|
# case the license is the MIT License). An "Open Source License" is a
|
||||||
# license that conforms to the Open Source Definition (Version 1.9)
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||||||
# published by the Open Source Initiative.
|
# published by the Open Source Initiative.
|
||||||
#
|
|
||||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
#===
|
#===
|
||||||
# Packaging Notes:
|
# Packaging Notes:
|
||||||
@ -43,8 +45,8 @@ Source1: group.conf
|
|||||||
Source2: preamble
|
Source2: preamble
|
||||||
Source3: gasket-driver-rpmlintrc
|
Source3: gasket-driver-rpmlintrc
|
||||||
BuildRequires: %kernel_module_package_buildreqs
|
BuildRequires: %kernel_module_package_buildreqs
|
||||||
BuildRequires: sysuser-tools
|
|
||||||
BuildRequires: pesign-obs-integration
|
BuildRequires: pesign-obs-integration
|
||||||
|
BuildRequires: sysuser-tools
|
||||||
Requires: %{name}-kmp
|
Requires: %{name}-kmp
|
||||||
%sysusers_requires
|
%sysusers_requires
|
||||||
|
|
||||||
@ -59,6 +61,15 @@ Requires: %{name}-kmp
|
|||||||
# PATCH-FIX-OPENSUSE fix-for-backported-dma-buf-ns.patch gh#google/gasket-driver!10
|
# PATCH-FIX-OPENSUSE fix-for-backported-dma-buf-ns.patch gh#google/gasket-driver!10
|
||||||
Patch0: fix-for-backported-dma-buf-ns.patch
|
Patch0: fix-for-backported-dma-buf-ns.patch
|
||||||
|
|
||||||
|
# The function signature for `class_create()` was changed in kernels >= 6.4.x to only accept a
|
||||||
|
# single argument (see kernel commit #dcfbb67).
|
||||||
|
# This patch conditionally modifies how `class_create()` is called depending on the kernel version.
|
||||||
|
# See:
|
||||||
|
# https://github.com/google/gasket-driver/pull/13
|
||||||
|
# https://github.com/google/gasket-driver/commit/83cbe8264fc63511e4e6250f2426749951a340c8.patch
|
||||||
|
# PATCH-FIX-OPENSUSE fix-kernel-gte-6.4.patch gh#google/gasket-driver!13
|
||||||
|
Patch1: fix-kernel-gte-6.4.patch
|
||||||
|
|
||||||
# This directive instructs the build service to temporarily save the project's
|
# This directive instructs the build service to temporarily save the project's
|
||||||
# certificate as %%_sourcedir/_projectcert.crt. See:
|
# certificate as %%_sourcedir/_projectcert.crt. See:
|
||||||
# https://github.com/openSUSE/pesign-obs-integration
|
# https://github.com/openSUSE/pesign-obs-integration
|
||||||
@ -79,8 +90,13 @@ The driver contains two modules:
|
|||||||
for lightweight communication with Google ASICs.
|
for lightweight communication with Google ASICs.
|
||||||
- Apex refers to the EdgeTPU v1.
|
- Apex refers to the EdgeTPU v1.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# This magic "KMP" subpackage is documented in
|
# This magic "KMP" subpackage is documented in
|
||||||
# https://en.opensuse.org/Kernel_Module_Packages#Specfile_mechanisms
|
# https://en.opensuse.org/Kernel_Module_Packages#Specfile_mechanisms
|
||||||
|
|
||||||
%package KMP
|
%package KMP
|
||||||
Summary: Gasket Driver kernel modules
|
Summary: Gasket Driver kernel modules
|
||||||
Group: System/Kernel
|
Group: System/Kernel
|
||||||
@ -98,6 +114,9 @@ mkdir -p obj
|
|||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
# Apply patches without conditions.
|
||||||
|
%patch1 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# Build the kernel modules.
|
# Build the kernel modules.
|
||||||
for flavor in %flavors_to_build; do
|
for flavor in %flavors_to_build; do
|
||||||
@ -136,4 +155,3 @@ export BRP_PESIGN_COMPRESS_MODULE="xz"
|
|||||||
%{_udevrulesdir}/70-apex.rules
|
%{_udevrulesdir}/70-apex.rules
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user