From 05d94c19312632ee2dbf97bce1a65afc2bfc07f05f07195b0a1c7e3e62c485b8 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 20 Apr 2023 08:58:34 +0000 Subject: [PATCH] - Add vhba-sle-kernel.diff [boo#1206169] OBS-URL: https://build.opensuse.org/package/show/filesystems/vhba-kmp?expand=0&rev=44 --- vhba-kmp.changes | 5 ++++ vhba-kmp.spec | 6 ++++- vhba-sle-kernel.diff | 58 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 vhba-sle-kernel.diff diff --git a/vhba-kmp.changes b/vhba-kmp.changes index ae5e665..9e42cff 100644 --- a/vhba-kmp.changes +++ b/vhba-kmp.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Apr 20 08:55:45 UTC 2023 - Jan Engelhardt + +- Add vhba-sle-kernel.diff [boo#1206169] + ------------------------------------------------------------------- Mon Dec 5 12:47:43 UTC 2022 - Ludwig Nussel diff --git a/vhba-kmp.spec b/vhba-kmp.spec index 632bb47..7665909 100644 --- a/vhba-kmp.spec +++ b/vhba-kmp.spec @@ -1,7 +1,7 @@ # # spec file for package vhba-kmp # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -29,6 +29,7 @@ Source: https://downloads.sf.net/cdemu/vhba-module-%version.tar.xz Source2: %name-preamble Patch1: vhba-no-werror.diff Patch2: vhba-devname.diff +Patch3: vhba-sle-kernel.diff BuildRequires: %kernel_module_package_buildreqs BuildRequires: kernel-syms >= 2.6.20 @@ -57,6 +58,9 @@ echo %flavors_to_build %autosetup -n vhba-module-%version -p1 %build +%if 0%{?sle_version} >= 150500 && 0%{?sle_version} < 160000 +export KCFLAGS="-DSLE" +%endif for flavor in %flavors_to_build; do cp -a . "../obj-$flavor/" pushd "../obj-$flavor/" diff --git a/vhba-sle-kernel.diff b/vhba-sle-kernel.diff new file mode 100644 index 0000000..6342e8f --- /dev/null +++ b/vhba-sle-kernel.diff @@ -0,0 +1,58 @@ +From: Jan Engelhardt +Date: 2023-04-20 10:58:03.045935811 +0200 + +Workaround failing VHBA compilation for the SLE 15.5 kernel API. + +--- + vhba.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +Index: vhba-module-20211218/vhba.c +=================================================================== +--- vhba-module-20211218.orig/vhba.c ++++ vhba-module-20211218/vhba.c +@@ -203,7 +203,7 @@ int vhba_device_queue (struct vhba_devic + vcmd->cmd = cmd; + + spin_lock_irqsave(&vdev->cmd_lock, flags); +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) || defined(SLE) + vcmd->metatag = scsi_cmd_to_rq(vcmd->cmd)->tag; + #else + vcmd->metatag = vcmd->cmd->request->tag; +@@ -477,7 +477,7 @@ int vhba_queuecommand (struct Scsi_Host + int retval; + unsigned int devnum; + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) || defined(SLE) + scmd_dbg(cmd, "queue %p tag %i\n", cmd, scsi_cmd_to_rq(cmd)->tag); + #else + scmd_dbg(cmd, "queue %p tag %i\n", cmd, cmd->request->tag); +@@ -489,7 +489,7 @@ int vhba_queuecommand (struct Scsi_Host + scmd_dbg(cmd, "no such device\n"); + + cmd->result = DID_NO_CONNECT << 16; +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) || defined(SLE) + scsi_done(cmd); + #else + cmd->scsi_done(cmd); +@@ -828,7 +828,7 @@ ssize_t vhba_ctl_write (struct file *fil + + spin_lock_irqsave(&vdev->cmd_lock, flags); + if (ret >= 0) { +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) || defined(SLE) + scsi_done(vcmd->cmd); + #else + vcmd->cmd->scsi_done(vcmd->cmd); +@@ -958,7 +958,7 @@ int vhba_ctl_release (struct inode *inod + + scmd_dbg(vcmd->cmd, "device released with command %lu (%p)\n", vcmd->metatag, vcmd->cmd); + vcmd->cmd->result = DID_NO_CONNECT << 16; +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) || defined(SLE) + scsi_done(vcmd->cmd); + #else + vcmd->cmd->scsi_done(vcmd->cmd);