!5 fix build error

Merge pull request !5 from catastrowings/master
This commit is contained in:
openeuler-ci-bot 2020-02-03 18:08:48 +08:00 committed by Gitee
commit 8aba6268ac
2 changed files with 83 additions and 12 deletions

View File

@ -0,0 +1,66 @@
diff -Nur kae_driver-1.2.8.old/uacce/uacce.c kae_driver-1.2.8/uacce/uacce.c
--- kae_driver-1.2.8.old/uacce/uacce.c 2020-02-03 16:15:12.585798416 +0800
+++ kae_driver-1.2.8/uacce/uacce.c 2020-02-03 16:16:25.797131365 +0800
@@ -969,7 +969,7 @@
if (is_to_free_region)
uacce_destroy_region(q, qfr);
}
-#ifdef CONFIG_IOMMU_SVA
+#ifdef CONFIG_IOMMU_SVA2
if (uacce->flags & UACCE_DEV_SVA)
iommu_sva_unbind_device(uacce->pdev, q->pasid);
#endif
@@ -1019,7 +1019,7 @@
int ret;
int pasid = 0;
-#ifdef CONFIG_IOMMU_SVA
+#ifdef CONFIG_IOMMU_SVA2
if (uacce->flags & UACCE_DEV_PASID) {
ret = iommu_sva_bind_device(uacce->pdev, current->mm, &pasid,
IOMMU_SVA_FEAT_IOPF, NULL);
@@ -1052,7 +1052,7 @@
return 0;
err_unbind:
-#ifdef CONFIG_IOMMU_SVA
+#ifdef CONFIG_IOMMU_SVA2
if (uacce->flags & UACCE_DEV_PASID)
iommu_sva_unbind_device(uacce->pdev, pasid);
#endif
@@ -1557,7 +1557,7 @@
return 0;
}
-#ifndef CONFIG_IOMMU_SVA
+#ifndef CONFIG_IOMMU_SVA2
static int uacce_dev_match(struct device *dev, void *data)
{
if (dev->parent == data)
@@ -1732,7 +1732,7 @@
uacce->ops->get_available_instances =
uacce_default_get_available_instances;
-#ifndef CONFIG_IOMMU_SVA
+#ifndef CONFIG_IOMMU_SVA2
ret = uacce_set_iommu_domain(uacce);
if (ret)
return ret;
@@ -1745,7 +1745,7 @@
}
if (uacce->flags & UACCE_DEV_PASID) {
-#ifdef CONFIG_IOMMU_SVA
+#ifdef CONFIG_IOMMU_SVA2
ret = iommu_sva_init_device(uacce->pdev, IOMMU_SVA_FEAT_IOPF,
0, 0, NULL);
if (ret) {
@@ -1780,7 +1780,7 @@
return -EAGAIN;
}
-#ifdef CONFIG_IOMMU_SVA
+#ifdef CONFIG_IOMMU_SVA2
iommu_sva_shutdown_device(uacce->pdev);
#else
uacce_unset_iommu_domain(uacce);

View File

@ -6,7 +6,7 @@
Name: kae_driver
Summary: Kunpeng Accelerator Engine Kernel Driver
Version: 1.2.8
Release: 2
Release: 3
License: GPL-2.0
Source: %{name}-%{version}.tar.gz
Vendor: Huawei Corporation
@ -17,6 +17,8 @@ Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release}
BuildRequires: kernel-devel, gcc, make
Patch0000: change-sva-macros-to-version2.patch
%description
This package contains the Kunpeng Accelerator Engine Kernel Driver
@ -65,7 +67,7 @@ Provides: %{name} = %{version}-%{release}
This package contains the Huawei Hisilicon RDE Accelerator Driver.
%prep
%setup -n %{name}-%{version}
%autosetup -n %{name}-%{version} -p1
%build
make
@ -73,16 +75,16 @@ make
%install
mkdir -p ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
mkdir -p ${RPM_BUILD_ROOT}/etc/modprobe.d
install -b -m -644 %{kae_driver_path}/uacce/uacce.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m -644 %{kae_driver_path}/hisilicon/hisi_qm.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m -644 %{kae_driver_path}/hisilicon/sec2/hisi_sec2.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m -644 %{kae_driver_path}/conf/hisi_sec2.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_sec2.conf
install -b -m -644 %{kae_driver_path}/hisilicon/hpre/hisi_hpre.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m -644 %{kae_driver_path}/conf/hisi_hpre.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_hpre.conf
install -b -m -644 %{kae_driver_path}/hisilicon/zip/hisi_zip.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m -644 %{kae_driver_path}/conf/hisi_zip.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_zip.conf
install -b -m -644 %{kae_driver_path}/hisilicon/rde/hisi_rde.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m -644 %{kae_driver_path}/conf/hisi_rde.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_rde.conf
install -b -m644 %{kae_driver_path}/uacce/uacce.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m644 %{kae_driver_path}/hisilicon/hisi_qm.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m644 %{kae_driver_path}/hisilicon/sec2/hisi_sec2.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
install -b -m644 %{kae_driver_path}/conf/hisi_sec2.conf ${RPM_BUILD_ROOT}/etc/modprobe.d/hisi_sec2.conf
install -b -m644 %{kae_driver_path}/hisilicon/hpre/hisi_hpre.ko ${RPM_BUILD_ROOT}/lib/modules/%{kernel_version}/extra
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
%clean
rm -rf ${RPM_BUILD_ROOT}
@ -229,6 +231,9 @@ echo "hisi_rde modules uninstalled"
%config(noreplace) /etc/modprobe.d/hisi_rde.conf
%changelog
* Mon Feb 03 2020 catastrowings <jianghuhao1994@163.com> 1.2.8-3
- fix sva build error
* Mon Jan 20 2020 catastrowings <jianghuhao1994@163.com> 1.2.7-2
- compatible with openEuler