!26 [sync] PR-16: 更新src

From: @openeuler-sync-bot 
Reviewed-by: @xqm227 
Signed-off-by: @xqm227
This commit is contained in:
openeuler-ci-bot 2022-04-13 02:35:25 +00:00 committed by Gitee
commit 9ebcc0f765
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
8 changed files with 78 additions and 166 deletions

View File

@ -0,0 +1,57 @@
From 0f373a79d760586d194040896b6abfd4ac8c4414 Mon Sep 17 00:00:00 2001
From: z00590711 <keith_keyi@126.com>
Date: Sat, 12 Feb 2022 16:44:03 +0800
Subject: [PATCH] ci kernel version patch
---
Makefile | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/Makefile b/Makefile
index 3cb5a30..bf9e27c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
-KERNEL_PATH := /lib/modules/`uname -r`/build
-KSP := $(shell if test -d /lib/modules/`uname -r`/source; then \
- echo /lib/modules/`uname -r`/source; \
+KERNEL_PATH := /lib/modules/5.10*/build
+KSP := $(shell if test -d /lib/modules/5.10*/source; then \
+ echo /lib/modules/5.10*/source; \
else \
- echo /lib/modules/`uname -r`/build; \
+ echo /lib/modules/5.10*/build; \
fi)
obj-m += uacce/
@@ -28,8 +28,8 @@ defaul:
# cp -f $(shell pwd)/include_uapi_linux/uacce.h $(KSP)/include/uapi/linux
install:
- $(shell mkdir -p /lib/modules/`uname -r`/extra)
- $(shell find . -name "*.ko" -exec cp -f {} /lib/modules/`uname -r`/extra \;)
+ $(shell mkdir -p /lib/modules/5.10*/extra)
+ $(shell find . -name "*.ko" -exec cp -f {} /lib/modules/5.10*/extra \;)
depmod -a
$(shell if test -e /etc/modprobe.d/10-unsupported-modules.conf; then \
sed -i "s/^allow_unsupported_modules.*/allow_unsupported_modules 1/" /etc/modprobe.d/10-unsupported-modules.conf; \
@@ -50,11 +50,11 @@ uninstall:
modprobe -r hisi_sec2
modprobe -r hisi_qm
modprobe -r uacce
- rm -rf /lib/modules/`uname -r`/extra/uacce.ko
- rm -rf /lib/modules/`uname -r`/extra/hisi_qm.ko
- rm -rf /lib/modules/`uname -r`/extra/hisi_sec2.ko
- rm -rf /lib/modules/`uname -r`/extra/hisi_hpre.ko
- rm -rf /lib/modules/`uname -r`/extra/hisi_zip.ko
+ rm -rf /lib/modules/5.10*/extra/uacce.ko
+ rm -rf /lib/modules/5.10*/extra/hisi_qm.ko
+ rm -rf /lib/modules/5.10*/extra/hisi_sec2.ko
+ rm -rf /lib/modules/5.10*/extra/hisi_hpre.ko
+ rm -rf /lib/modules/5.10*/extra/hisi_zip.ko
rm -rf /etc/modprobe.d/hisi_sec2.conf
rm -rf /etc/modprobe.d/hisi_hpre.conf
rm -rf /etc/modprobe.d/hisi_zip.conf
--
2.35.0.windows.1

View File

@ -1,22 +0,0 @@
From 690b5230ec25237c82630ec7c3766381b2a8c467 Mon Sep 17 00:00:00 2001
From: wang_yue111 <648774160@qq.com>
Date: Wed, 11 Nov 2020 14:43:58 +0800
Subject: [PATCH] fix Makefile compilation failed
---
kae_driver/hisilicon/Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/kae_driver/hisilicon/Makefile b/kae_driver-1.3.9/kae_driver/hisilicon/Makefile
index c766a09..eafceb9 100644
--- a/kae_driver/hisilicon/Makefile
+++ b/kae_driver/hisilicon/Makefile
@@ -1,5 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_CRYPTO_DEV_HISI_SEC) += sec/
obj-$(CONFIG_CRYPTO_DEV_HISI_QM) += hisi_qm.o
hisi_qm-objs = qm.o sgl.o
obj-$(CONFIG_CRYPTO_DEV_HISI_ZIP) += zip/
--
2.23.0

View File

@ -1,47 +0,0 @@
From 41654427d727cdc7e5f63ed148265054d530998b Mon Sep 17 00:00:00 2001
From: wang_yue111 <648774160@qq.com>
Date: Wed, 11 Nov 2020 15:15:21 +0800
Subject: [PATCH] fix value not ignored as itought to be
---
kae_driver/hisilicon/rde/rde_main.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/kae_driver/hisilicon/rde/rde_main.c b/KAEdriver-1.3.9/kae_driver/hisilicon/rde/rde_main.c
index bdc4c55..f900369 100644
--- a/kae_driver/hisilicon/rde/rde_main.c
+++ b/kae_driver/hisilicon/rde/rde_main.c
@@ -479,7 +479,7 @@ static int hisi_rde_chn_debug_init(struct hisi_qm *qm)
{
struct device *dev = &qm->pdev->dev;
struct debugfs_regset32 *regset, *regset_ooo;
- struct dentry *tmp_d, *tmp;
+ struct dentry *tmp_d;
char buf[HRDE_DBGFS_VAL_MAX_LEN];
int ret;
@@ -497,9 +497,7 @@ static int hisi_rde_chn_debug_init(struct hisi_qm *qm)
regset->regs = hrde_dfx_regs;
regset->nregs = ARRAY_SIZE(hrde_dfx_regs);
regset->base = qm->io_base;
- tmp = debugfs_create_regset32("chn_regs", 0444, tmp_d, regset);
- if (!tmp)
- return -ENOENT;
+ debugfs_create_regset32("chn_regs", 0444, tmp_d, regset);
regset_ooo = devm_kzalloc(dev, sizeof(*regset_ooo), GFP_KERNEL);
if (!regset_ooo)
@@ -507,9 +505,7 @@ static int hisi_rde_chn_debug_init(struct hisi_qm *qm)
regset_ooo->regs = hrde_ooo_dfx_regs;
regset_ooo->nregs = ARRAY_SIZE(hrde_ooo_dfx_regs);
regset_ooo->base = qm->io_base;
- tmp = debugfs_create_regset32("ooo_regs", 0444, tmp_d, regset_ooo);
- if (!tmp)
- return -ENOENT;
+ debugfs_create_regset32("ooo_regs", 0444, tmp_d, regset_ooo);
return 0;
}
--
2.23.0

View File

@ -1,34 +0,0 @@
From 47c1fc7609ad25b54896c8715eff0e05b45d9956 Mon Sep 17 00:00:00 2001
From: wang_yue111 <648774160@qq.com>
Date: Wed, 11 Nov 2020 14:13:19 +0800
Subject: [PATCH] fix vm_fault_t conflict error
---
kae_driver/uacce/uacce.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kae_driver/uacce/uacce.c b/KAEdriver-1.3.9/kae_driver/uacce/uacce.c
index 0ce0702..f897456 100644
--- a/kae_driver/uacce/uacce.c
+++ b/kae_driver/uacce/uacce.c
@@ -14,6 +14,7 @@
#include "../include_linux/uacce.h"
#include <linux/wait.h>
#include <linux/eventpoll.h>
+#include <linux/version.h>
static struct class *uacce_class;
static DEFINE_IDR(uacce_idr);
@@ -31,7 +32,9 @@ static DECLARE_RWSEM(uacce_qs_lock);
static const struct file_operations uacce_fops;
static void uacce_put_queue(struct uacce_queue *q);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,1,0)
typedef int vm_fault_t;
+#endif
typedef unsigned int __poll_t;
/* match with enum uacce_qfrt */
--
2.23.0

BIN
kae_driver-1.3.11.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -2,7 +2,7 @@
Name: kae_driver
Summary: Kunpeng Accelerator Engine Kernel Driver
Version: 1.3.9
Version: 1.3.11
Release: 1
License: GPL-2.0
Source: %{name}-%{version}.tar.gz
@ -14,13 +14,10 @@ Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release}
BuildRequires: kernel-devel, gcc, make
ExclusiveArch: aarch64
Patch0001: fix-vm_fault_t-conflict.patch
Patch0002: fix-Makefile-compilation-failed.patch
Patch0003: fix-value-not-ignored-as-it-ought-to-be.patch
Patch0004: support-kernel-5.7.0-compation.patch
Patch0001: 0001-ci-kernel-version-patch.patch
%define kernel_version %(uname -r)
%define kae_driver_path %{_builddir}/%{name}-%{version}/%{name}
%define kae_driver_path %{_builddir}/%{name}-%{version}
%description
This package contains the Kunpeng Accelerator Engine Kernel Driver
@ -60,21 +57,20 @@ Provides: %{name} = %{version}-%{release}
%description -n hisi_zip
This package contains the Huawei Hisilicon ZIP Accelerator Driver.
%package -n hisi_rde
Summary: Huawei Hisilicon RDE Accelerator Driver
%package -n hisi_trng_v2
Summary: Huawei Hisilicon TRNG Accelerator Driver
Requires: uacce >= %{version}-%{release}
Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release}
%description -n hisi_rde
This package contains the Huawei Hisilicon RDE Accelerator Driver.
%description -n hisi_trng_v2
This package contains the Huawei Hisilicon TRNG Accelerator Driver.
%prep
%autosetup -c -n %{name}-%{version} -p1
%autosetup -n %{name}-%{version} -p1
%build
cd kae_driver
make
%install
@ -88,8 +84,8 @@ install -b -m644 %{kae_driver_path}/hisilicon/hpre/hisi_hpre.ko ${RPM_BUILD_ROOT
install -b -m644 %{kae_driver_path}/conf/hisi_hpre.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_hpre.conf
install -b -m644 %{kae_driver_path}/hisilicon/zip/hisi_zip.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m644 %{kae_driver_path}/conf/hisi_zip.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_zip.conf
install -b -m644 %{kae_driver_path}/hisilicon/rde/hisi_rde.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m644 %{kae_driver_path}/conf/hisi_rde.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_rde.conf
install -b -m644 %{kae_driver_path}/hisilicon/trng/hisi-trng-v2.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m644 %{kae_driver_path}/conf/hisi_trng_v2.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_trng_v2.conf
%clean
rm -rf ${RPM_BUILD_ROOT}
@ -118,10 +114,10 @@ if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
echo "hisi_zip modules start to install"
fi
%pre -n hisi_rde
%pre -n hisi_trng_v2
echo "checking installed modules"
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
echo "hisi_rde modules start to install"
echo "hisi_trng_v2 modules start to install"
fi
%post -n uacce
@ -148,11 +144,11 @@ if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
fi
echo "hisi_zip modules installed"
%post -n hisi_rde
%post -n hisi_trng_v2
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
/sbin/depmod -a > /dev/null 2>&1 || true
fi
echo "hisi_rde modules installed"
echo "hisi_trng_v2 modules installed"
%preun -n uacce
if [ "$1" = "0" ] ; then #0: uninstall
@ -174,9 +170,9 @@ if [ "$1" = "0" ] ; then #0: uninstall
echo "hisi_zip modules uninstalling"
fi
%preun -n hisi_rde
%preun -n hisi_trng_v2
if [ "$1" = "0" ] ; then #0: uninstall
echo "hisi_rde modules uninstalling"
echo "hisi_trng_v2 modules uninstalling"
fi
%postun -n uacce
@ -203,11 +199,11 @@ if [ "$1" = "0" ] ; then #0: uninstall
fi
echo "hisi_zip modules uninstalled"
%postun -n hisi_rde
%postun -n hisi_trng_v2
if [ "$1" = "0" ] ; then #0: uninstall
/sbin/depmod -a > /dev/null 2>&1 || true
fi
echo "hisi_rde modules uninstalled"
echo "hisi_trng_v2 modules uninstalled"
%files -n uacce
%defattr(644,root,root)
@ -230,10 +226,10 @@ echo "hisi_rde modules uninstalled"
/lib/modules/%{kernel_version}/extra/hisi_zip.ko
%config(noreplace) /etc/modprobe.d/hisi_zip.conf
%files -n hisi_rde
%files -n hisi_trng_v2
%defattr(644,root,root)
/lib/modules/%{kernel_version}/extra/hisi_rde.ko
%config(noreplace) /etc/modprobe.d/hisi_rde.conf
/lib/modules/%{kernel_version}/extra/hisi-trng-v2.ko
%config(noreplace) /etc/modprobe.d/hisi_trng_v2.conf
%changelog
* Wed Nov 11 2020 wangyue <wangyue92@huawei.com> - 1.3.9-1

View File

@ -1,38 +0,0 @@
From b3dd45f0dc62148045cdbdc52dbaac6c7f136efe Mon Sep 17 00:00:00 2001
From: wang_yue111 <648774160@qq.com>
Date: Wed, 11 Nov 2020 15:43:59 +0800
Subject: [PATCH] fix pci_cleanup_aer_uncorrect_error_status renamed to pci_aer_clear_nonfatal_status since kernel 5.7.0
---
kae_driver/hisilicon/qm.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/kae_driver/hisilicon/qm.c b/KAEdriver-1.3.9/kae_driver/hisilicon/qm.c
index 35aa107..601b9c2 100644
--- a/kae_driver/hisilicon/qm.c
+++ b/kae_driver/hisilicon/qm.c
@@ -13,6 +13,7 @@
#include <linux/seq_file.h>
#include "qm.h"
#include "qm_usr_if.h"
+#include <linux/version.h>
/* eq/aeq irq enable */
#define QM_VF_AEQ_INT_SOURCE 0x0
@@ -4127,8 +4128,11 @@ pci_ers_result_t hisi_qm_dev_slot_reset(struct pci_dev *pdev)
return PCI_ERS_RESULT_RECOVERED;
pci_info(pdev, "Requesting reset due to PCI error\n");
- pci_cleanup_aer_uncorrect_error_status(pdev);
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)
+ pci_aer_clear_nonfatal_status(pdev);
+#else
+ pci_cleanup_aer_uncorrect_error_status(pdev);
+#endif
/* reset pcie device controller */
ret = hisi_qm_controller_reset(qm);
if (ret) {
--
2.23.0