Commit 1a29bfae authored by AlmAck's avatar AlmAck

kernel 5.2.0

nvidia-340xx not buildable, skipped for now and maybe removed in the future
[skip-ci]
parent 0867ea7b
pkgbase=acpi_call
pkgname=(acpi_call acpi_call-dkms)
pkgver=1.1.0
pkgrel=58
pkgrel=59
pkgdesc="A kernel module that enables you to call parameterless ACPI methods by writing the method name to /proc/acpi/call, e.g. to turn off discrete graphics card in a dual graphics environment (like NVIDIA Optimus)."
arch=('x86_64')
url="http://github.com/mkottman/acpi_call"
license=('GPL')
depends=("linux=4.19.26")
makedepends=("linux-headers=4.19.26")
depends=("linux=5.2.9")
makedepends=("linux-headers=5.2.9")
_extramodules=extramodules-CHAKRA
source=("https://github.com/mkottman/acpi_call/archive/v${pkgver}.tar.gz"
dkms.conf)
......
pkgname=bbswitch
pkgver=0.8
pkgrel=52
pkgrel=53
pkgdesc="kernel module allowing to switch dedicated graphics card on Optimus laptops"
arch=('x86_64')
url="http://github.com/Bumblebee-Project/bbswitch"
license=('GPL')
depends=("linux=4.19.26")
makedepends=("linux-headers=4.19.26")
depends=("linux=5.2.9")
makedepends=("linux-headers=5.2.9")
_extramodules=extramodules-CHAKRA
source=("https://github.com/Bumblebee-Project/bbswitch/archive/v${pkgver}.tar.gz")
md5sums=('5b116b31ace3604ddf9d1fc1f4bc5807')
......
pkgname=broadcom-wl
pkgver=6.30.223.271
pkgrel=34
pkgrel=35
pkgdesc='Broadcom 802.11abgn hybrid Linux networking device driver'
url='http://www.broadcom.com/support/802.11/linux_sta.php'
arch=('x86_64')
license=('custom')
depends=("linux=4.19.26")
makedepends=("linux-headers=4.19.26")
depends=("linux=5.2.9")
makedepends=("linux-headers=5.2.9")
_extramodules=extramodules-CHAKRA
source=("https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-${pkgver//./_}.tar.gz"
#"http://ftp.de.debian.org/debian/pool/non-free/b/broadcom-sta/broadcom-sta_5.100.82.112.orig.tar.gz" "http://www.broadcom.com/docs/linux_sta/hybrid-portsrc_${ARCH}-v${pkgver//./_}.tar.gz" we need the debian version, because upstream URL doesn't exist anymore
......@@ -43,6 +43,8 @@ prepare() {
patch -p1 -i 007-linux412.patch
patch -p1 -i 008-linux415.patch
sed -i 's/get_ds()/KERNEL_DS/g' src/wl/sys/wl_iw.c
sed -i 's/get_ds()/KERNEL_DS/g' src/wl/sys/wl_cfg80211_hybrid.c
sed -e "/BRCM_WLAN_IFNAME/s:eth:wlan:" \
-i src/wl/sys/wl_linux.c
}
......
......@@ -2,8 +2,8 @@
# kernel.
pkgname=btrfs-progs
pkgver=4.19.1
pkgrel=4
pkgver=5.2.1
pkgrel=1
pkgdesc='Btrfs filesystem utilities'
arch=('x86_64')
depends=('glibc' 'util-linux' 'e2fsprogs' 'lzo2' 'zlib' 'zstd')
......@@ -15,7 +15,7 @@ source=("https://github.com/kdave/${pkgname}/archive/v${pkgver}.tar.gz"
'initcpio-hook-btrfs'
'btrfs-scrub@.service'
'btrfs-scrub@.timer')
md5sums=('b56a3e76de396d5e65f54a059c9cc4b6'
md5sums=('f23449c2558220d7956f557053f39aad'
'7241ba3a4286d08da0d50b7176941112'
'b09688a915a0ec8f40e2f5aacbabc9ad'
'794b867e09451284c545bae112aa0cfd'
......
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
pkgname=linux-api-headers
pkgver=4.19.26
pkgver=5.2.9
pkgrel=1
pkgdesc="Kernel headers sanitized for use in userspace"
arch=('x86_64')
url="http://www.gnu.org/software/libc"
license=('GPL2')
source=(https://www.kernel.org/pub/linux/kernel/v4.x/linux-${pkgver}.tar.{xz,sign})
md5sums=('a324dc720e990ac7990c3e638afccfd7'
md5sums=('d7162b4421327c756b1d548204fd8fb1'
'SKIP')
validpgpkeys=('ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
'647F28654894E3BD457199BE38DBBDC86092693E') # Greg Kroah-Hartman
......
......@@ -13,13 +13,13 @@ pkgname=(
'usbip'
'x86_energy_perf_policy'
)
pkgver=4.19.26
pkgver=5.2.9
pkgrel=1
license=('GPL2')
arch=('x86_64')
url='http://www.kernel.org'
options=('!strip')
makedepends=('git' "linux=4.19.26")
makedepends=('git' "linux=5.2.9")
# split packages need all package dependencies set manually in makedepends
# kernel source deps
makedepends+=('asciidoc' 'xmlto')
......@@ -37,7 +37,7 @@ source=("http://www.kernel.org/pub/linux/kernel/v4.x/linux-${pkgver}.tar.xz"
'cpupower.systemd'
'cpupower.service'
'usbipd.service')
sha256sums=('bec45f66c94739596f2bbc35e89de7a2cbd407cf63b537970b52ab117db747fc'
sha256sums=('b6f02a4b306ca5cd314d72615bfc2650166969613135da202630e6c4e1b5d4e6'
'4fa509949d6863d001075fa3e8671eff2599c046d20c98bb4a70778595cd1c3f'
'fbf6e0ce6eb0ef15703fe212958de6ca46e62188900b5e9f9272ed3cc9cfd54e'
'a89284d0ecb556ca53a66d1c2087b5fd6d0a901ab2769cd3aebb93f4478905dc'
......
......@@ -6,4 +6,4 @@
# These are the "basic variables" appliable for the normal kernel group
_kernelname="-CHAKRA"
_kernelver=4.19.26
_kernelver=5.2.9
......@@ -2,7 +2,7 @@
Type = File
Operation = Install
Operation = Upgrade
Target = boot/vmlinuz-%PKGBASE%
Target = usr/lib/modules/%KERNVER%/vmlinuz
Target = usr/lib/initcpio/*
[Action]
......
pkgbase=linux
pkgname=('linux' 'linux-headers' 'linux-docs')
pkgver=4.19.26
pkgver=5.2.9
_kernelbasever=${pkgver:0:4}
_srcname=linux-$pkgver
pkgrel=1
_ckpatchversion=1
#_ckpatchname="patch-${_kernelbasever}-ck${_ckpatchversion}"
_ckpatch="patch-5.2-ck${_ckpatchversion}"
arch=('x86_64')
url="https://www.kernel.org/"
license=('GPL2')
makedepends=('xmlto' 'kmod' 'inetutils' 'bc' 'libelf')
options=('!strip')
source=(
https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.{xz,sign}
https://www.kernel.org/pub/linux/kernel/v5.x/${_srcname}.tar.{xz,sign}
config.x86_64 # the main kernel config file
60-linux.hook # pacman hook for depmod
90-linux.hook # pacman hook for initramfs regeneration
linux.preset # standard config files for mkinitcpio ramdisk
#"http://ck.kolivas.org/patches/4.0/${_kernelbasever}/${_kernelbasever}-ck${_ckpatchversion}/${_ckpatchname}.xz"
"http://ck.kolivas.org/patches/4.0/4.19/4.19-ck${_ckpatchversion}/4.19-ck1-broken-out.tar.xz"
https://gist.githubusercontent.com/graysky2/dc820c1b41c5eeb63d2de7a2e72499f4/raw/3d2b3be40df7e538db4ef9a69b438e00e5575e2d/unfuck-pre.patch
"unfuck-post.patch::https://pastebin.com/raw/v618N2xd"
0000-unfuck-ck1-for-kvm-intel-symbol.patch
#"http://ck.kolivas.org/patches/4.0/${_kernelbasever}/${_kernelbasever}-ck${_ckpatchversion}/${_ckpatch}.xz"
"http://ck.kolivas.org/patches/5.0/5.2/5.2-ck${_ckpatchversion}/$_ckpatch.xz"
)
validpgpkeys=(
'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
'647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
'8218F88849AAC522E94CF470A5E9288C4FA415FA' # Jan Alexander Steffens (heftig)
)
sha256sums=('bec45f66c94739596f2bbc35e89de7a2cbd407cf63b537970b52ab117db747fc'
sha256sums=('b6f02a4b306ca5cd314d72615bfc2650166969613135da202630e6c4e1b5d4e6'
'SKIP'
'28985dc73b166cf6efc42cacfd3d0b22e2bf75d2557371adb2e9be8707cdf4e0'
'8b82b75175dbda1c7a08a09429a783c3c80c20b3955b9cb430e7f8952d8629b7'
'287b43e83535d0aba2797b8fe4c1527788995cbfd858097be37214345e781a25'
'75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919'
'c043f3033bb781e2688794a59f6d1f7ed49ef9b13eb77ff9a425df33a244a636'
'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65'
'61431037fd487f4eff135a3fcf5962270913af9fd95c31e27a2f9d4124bd3d3b'
'b57666e47574edcb0b12c3a4fbddf2a37b1badf3591c76344aae0e8f91452915'
'd761a320bade7e16dfaf4ae87a9ee1280b96068b11ac5691beb4d55edb0bada2'
'3e8c7d3015bb593e8a861be0b2b9f1de74fcb25e00c6e3eacee3165c6bec6f64')
'f1abc13a8d859fbf6350040e45d7f04ad551a6d39f113ba96fbbd820118c0e36')
_kernelname=-CHAKRA
prepare() {
cd ${_srcname}
# when the ck patch set is ready, refer to:
# https://code.chakralinux.org/chakra/packages/core/commit/401096701cadaf3da9d93b0073ea1a479827e1ea
# in order to revert back the original PKGBUILD
# array defines CK1 broken out
# we need to modify 0001 to fix for 4.19.7+
_CKArr=(
0001-MultiQueue-Skiplist-Scheduler-version-v0.180.patch
0002-Fix-Werror-build-failure-in-tools.patch
0003-Make-preemptible-kernel-default.patch
0004-Expose-vmsplit-for-our-poor-32-bit-users.patch
0005-Create-highres-timeout-variants-of-schedule_timeout-.patch
0006-Special-case-calls-of-schedule_timeout-1-to-use-the-.patch
0007-Convert-msleep-to-use-hrtimers-when-active.patch
0008-Replace-all-schedule-timeout-1-with-schedule_min_hrt.patch
0009-Replace-all-calls-to-schedule_timeout_interruptible-.patch
0010-Replace-all-calls-to-schedule_timeout_uninterruptibl.patch
0011-Don-t-use-hrtimer-overlay-when-pm_freezing-since-som.patch
0012-Make-hrtimer-granularity-and-minimum-hrtimeout-confi.patch
0013-Make-threaded-IRQs-optionally-the-default-which-can-.patch
0014-Reinstate-default-Hz-of-100-in-combination-with-MuQS.patch
0015-Swap-sucks.patch
0016-Add-ck1-version.patch
)
pushd ../patches
# fix naming schema in EXTRAVERSION of ck patch set
sed -i -re "s/^(.EXTRAVERSION).*$/\1 = /" 0016-Add-ck1-version.patch
# unfuck 0001-MultiQueue-Skiplist-Scheduler-version-v0.180.patch
# http://ck-hack.blogspot.com/2018/11/linux-419-ck1-muqss-version-0180-for.html?showComment=1544055404401#c6971461776340355351
patch -Np1 -i "$srcdir/unfuck-pre.patch"
popd
msg2 "Applying ck patchset..."
local ckp
for ckp in "${_CKArr[@]}"; do
patch -Np1 < "../patches/$ckp"
done
patch -Np1 < "../unfuck-post.patch"
patch -Np1 < "../0000-unfuck-ck1-for-kvm-intel-symbol.patch"
# add latest fixes from stable queue, if needed
# http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
......@@ -103,8 +51,8 @@ END
-e "/^EXTRAVERSION =/aLOCALVERSION =" \
-i Makefile
#msg2 "Patching with ck patchset..."
#patch -Np1 -i "$srcdir/${_ckpatchname}"
msg2 "Patching with ck patchset..."
patch -Np1 -i "$srcdir/${_ckpatch}"
# don't run depmod on 'make install'. We'll do this ourselves in packaging
sed -i '2iexit 0' scripts/depmod.sh
......@@ -282,6 +230,19 @@ package_linux-docs() {
mkdir -p "$builddir"
cp -t "$builddir" -a Documentation
msg2 "Moving HTML docs..."
local src dst
while read -rd '' src; do
dst="$builddir/Documentation/${src#$builddir/Documentation/output/}"
mkdir -p "${dst%/*}"
mv "$src" "$dst"
rmdir -p --ignore-fail-on-non-empty "${src%/*}"
done < <(find "$builddir/Documentation/output" -type f -print0)
msg2 "Adding symlink..."
mkdir -p "$pkgdir/usr/share/doc"
ln -sr "$builddir/Documentation" "$pkgdir/usr/share/doc/$pkgbase"
msg2 "Fixing permissions..."
chmod -Rc u=rwX,go=rX "$pkgdir"
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,7 +2,7 @@ pkgbase=nvidia-340xx-utils
pkgname=('nvidia-340xx-utils' 'opencl-nvidia-340xx')
# Edit chakra-hardware-detection/hooks/hwdetect_7_graphics on version jump from 3xx.xx
pkgver=340.107
pkgrel=11
pkgrel=12
arch=('x86_64')
url="http://www.nvidia.com/"
license=('custom')
......
......@@ -2,26 +2,42 @@
pkgbase=nvidia-340xx
pkgname=('nvidia-340xx' 'chd-nvidia-340xx' 'nvidia-340xx-dkms')
pkgver=340.107
pkgrel=12
pkgrel=13
arch=('x86_64')
url="http://www.nvidia.com/"
makedepends=("linux-headers=4.19.26")
makedepends=("linux-headers=5.2.9")
license=('custom')
source=("https://code.chakralinux.org/tools/chakra-hardware-detection/raw/master/hwdb/nvidia_supported"
'kernel-4.11.patch')
'kernel-4.11.patch'
'kernel-5.0.patch'
'kernel-5.2.patch')
_ARCH='x86_64'
_pkg="NVIDIA-Linux-${_ARCH}-${pkgver}-no-compat32"
_extramodules=extramodules-CHAKRA
source+=("http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/${_pkg}.run")
md5sums=('62d0cdb856cfae64753c0f3acf729d47'
'e09208cdee41f89ae787f86c602c69d2'
'1e5c198f53bf88b5160ebca8d3f602cb'
'0ff09b69db7d3da1a56d3455f6587679'
'164fac79ada52b2a8723ed30b529a624'
'ffca1879d77dfc491dfb0276ceb56cc1')
prepare() {
sh "${_pkg}.run" --extract-only
cd "${_pkg}"
# patches here
patch -Np0 < "${srcdir}/kernel-4.11.patch"
#https://devtalk.nvidia.com/default/topic/1047179/linux/-solved-nvidia-340-107-linux-5-0-rc5-failed-to-build-kernel-module/
#https://gitlab.manjaro.org/packages/extra/linux52-extramodules/nvidia-340xx
# Fix compile problem with 4.11
(cd kernel; patch -p1 --no-backup-if-mismatch -i "$srcdir"/kernel-4.11.patch)
# Fix compile problem with 5.0
(cd kernel; patch -p1 --no-backup-if-mismatch -i "$srcdir"/kernel-5.0.patch)
(cd kernel; patch -p1 --no-backup-if-mismatch -i "$srcdir"/kernel-5.2.patch)
cp -a kernel kernel-dkms
}
......@@ -39,7 +55,7 @@ build() {
package_nvidia-340xx() {
pkgdesc="NVIDIA drivers for linux."
depends=("linux=4.19.26" "nvidia-340xx-libgl" "nvidia-340xx-utils=${pkgver}")
depends=("linux=5.2.9" "nvidia-340xx-libgl" "nvidia-340xx-utils=${pkgver}")
conflicts=('nvidia-96xx' 'nvidia-173xx' 'nvidia-304xx' 'nvidia-bumblebee')
install=nvidia.install
......
--- kernel/uvm/nvidia_uvm_lite.c 2017-09-27 13:50:46.334075042 +0200
+++ kernel/uvm/nvidia_uvm_lite.c 2017-09-27 13:56:06.358041280 +0200
@@ -818,7 +818,11 @@
From 53d65b3781b7b2cf25368efd5382ed5bbda19bd9 Mon Sep 17 00:00:00 2001
From: Alberto Milone <alberto.milone@canonical.com>
Date: Thu, 21 Sep 2017 15:16:41 +0200
Subject: [PATCH 1/1] Add support for Linux 4.11
This only contains the last few bits that didn't make it into
the 340 driver.
Credit goes to Michael Marley for spotting the problem.
---
uvm/nvidia_uvm_lite.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/uvm/nvidia_uvm_lite.c b/uvm/nvidia_uvm_lite.c
index 246ed04..119c93a 100644
--- a/uvm/nvidia_uvm_lite.c
+++ b/uvm/nvidia_uvm_lite.c
@@ -818,8 +818,15 @@ done:
}
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+#else
+int _fault(struct vm_fault *vmf)
+#else
+int _fault(struct vm_fault *vmf)
+#endif
{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+ struct vm_area_struct *vma = vmf->vma;
+#endif
#if defined(NV_VM_FAULT_HAS_ADDRESS)
unsigned long vaddr = vmf->address;
@@ -828,7 +832,11 @@
struct page *page = NULL;
int retval;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
retval = _fault_common(vma, vaddr, &page, vmf->flags);
+#else
+ retval = _fault_common(NULL, vaddr, &page, vmf->flags);
+#endif
vmf->page = page;
@@ -866,7 +874,11 @@
#else
@@ -866,7 +873,11 @@ static struct vm_operations_struct uvmlite_vma_ops =
// it's dealing with anonymous mapping (see handle_pte_fault).
//
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
......@@ -36,3 +43,6 @@
{
vmf->page = NULL;
return VM_FAULT_SIGBUS;
--
2.7.4
From 0b4e74ba61c50aefa16a4bafac3a60799eab7a20 Mon Sep 17 00:00:00 2001
From: Alberto Milone <alberto.milone@canonical.com>
Date: Fri, 15 Feb 2019 14:43:21 +0100
Subject: [PATCH 1/1] Add support for Linux 5.0
---
Makefile | 2 ++
conftest.sh | 33 +++++++++++++++++++++++++++++++++
nv-drm.c | 12 +++++++++++-
nv-time.h | 24 ++++++++++++++++++++++++
os-interface.c | 13 +++++++------
uvm/Makefile | 1 +
uvm/nvidia_uvm_linux.h | 1 +
uvm/nvidia_uvm_lite.c | 4 ++--
8 files changed, 81 insertions(+), 9 deletions(-)
create mode 100644 nv-time.h
diff --git a/Makefile b/Makefile
index 8ac3c1a..1959dce 100644
--- a/Makefile
+++ b/Makefile
@@ -147,6 +147,8 @@ COMPILE_TESTS = \
vm_fault_present \
vm_fault_has_address \
drm_driver_unload_has_int_return_type \
+ drm_gem_object_get \
+ do_gettimeofday \
drm_legacy_pci_init \
timer_setup
#
diff --git a/conftest.sh b/conftest.sh
index 64d75a1..fb0bf60 100755
--- a/conftest.sh
+++ b/conftest.sh
@@ -168,6 +168,7 @@ test_headers() {
FILES="$FILES linux/sched/task.h"
FILES="$FILES xen/ioemu.h"
FILES="$FILES linux/fence.h"
+ FILES="$FILES linux/ktime.h"
FILES_ARCH="$FILES_ARCH asm/set_memory.h"
@@ -1971,6 +1972,38 @@ compile_test() {
compile_check_conftest "$CODE" "NV_DRM_DRIVER_UNLOAD_HAS_INT_RETURN_TYPE" "" "types"
;;
+ drm_gem_object_get)
+ #
+ # Determine if the function drm_gem_object_get() is present.
+ #
+ CODE="
+ #include <drm/drmP.h>
+ #if defined(NV_DRM_DRM_GEM_H_PRESENT)
+ #include <drm/drm_gem.h>
+ #endif
+ void conftest_drm_gem_object_get(void) {
+ drm_gem_object_get();
+ }"
+
+ compile_check_conftest "$CODE" "NV_DRM_GEM_OBJECT_GET_PRESENT" "" "functions"
+ ;;
+
+ do_gettimeofday)
+ #
+ # Determine if the function do_gettimeofday() is present.
+ #
+ CODE="
+ #include <linux/time.h>
+ #if defined(NV_LINUX_KTIME_H_PRESENT)
+ #include <linux/ktime.h>
+ #endif
+ void conftest_do_gettimeofday(void) {
+ do_gettimeofday();
+ }"
+
+ compile_check_conftest "$CODE" "NV_DO_GETTIMEOFDAY_PRESENT" "" "functions"
+ ;;
+
drm_legacy_pci_init)
#
# Determine if drm_legacy_pci_init() is present. drm_pci_init() was
diff --git a/nv-drm.c b/nv-drm.c
index 0eb72e4..1c968de 100644
--- a/nv-drm.c
+++ b/nv-drm.c
@@ -37,6 +37,16 @@ struct nv_gem_object {
struct page **pages;
};
+static inline void
+nv_drm_gem_object_unreference_unlocked(struct nv_gem_object *nv_gem)
+{
+#if defined(NV_DRM_GEM_OBJECT_GET_PRESENT)
+ drm_gem_object_put_unlocked(&nv_gem->base);
+#else
+ drm_gem_object_unreference_unlocked(&nv_gem->base);
+#endif
+}
+
static int nv_drm_load(
struct drm_device *dev,
unsigned long flags
@@ -252,7 +262,7 @@ RM_STATUS NV_API_CALL nv_alloc_os_descriptor_handle(
goto done;
}
- drm_gem_object_unreference_unlocked(&nv_obj->base);
+ nv_drm_gem_object_unreference_unlocked(nv_obj);
status = RM_OK;
diff --git a/nv-time.h b/nv-time.h
new file mode 100644
index 0000000..cc828aa
--- /dev/null
+++ b/nv-time.h
@@ -0,0 +1,24 @@
+#ifndef __NV_TIME_H__
+#define __NV_TIME_H__
+
+#include "conftest.h"
+#include <linux/time.h>
+
+#if defined(NV_LINUX_KTIME_H_PRESENT)
+#include <linux/ktime.h>
+#endif
+
+static inline void nv_gettimeofday(struct timeval *tv)
+{
+#ifdef NV_DO_GETTIMEOFDAY_PRESENT
+ do_gettimeofday(tv);
+#else
+ struct timespec64 now;
+
+ ktime_get_real_ts64(&now);
+ tv->tv_sec = now.tv_sec;
+ tv->tv_usec = now.tv_nsec/1000;
+#endif
+}
+
+#endif
diff --git a/os-interface.c b/os-interface.c
index 7e3d362..7190b26 100644
--- a/os-interface.c
+++ b/os-interface.c
@@ -13,6 +13,7 @@
#include "os-interface.h"
#include "nv-linux.h"
+#include "nv-time.h"
RM_STATUS NV_API_CALL os_disable_console_access(void)
{
@@ -440,7 +441,7 @@ RM_STATUS NV_API_CALL os_get_current_time(
{
struct timeval tm;
- do_gettimeofday(&tm);
+ nv_gettimeofday(&tm);
*seconds = tm.tv_sec;
*useconds = tm.tv_usec;
@@ -475,7 +476,7 @@ RM_STATUS NV_API_CALL os_delay_us(NvU32 MicroSeconds)
#ifdef NV_CHECK_DELAY_ACCURACY
struct timeval tm1, tm2;
- do_gettimeofday(&tm1);
+ nv_gettimeofday(&tm1);
#endif
if (in_irq() && (MicroSeconds > NV_MAX_ISR_DELAY_US))
@@ -490,7 +491,7 @@ RM_STATUS NV_API_CALL os_delay_us(NvU32 MicroSeconds)
udelay(usec);
#ifdef NV_CHECK_DELAY_ACCURACY
- do_gettimeofday(&tm2);
+ nv_gettimeofday(&tm2);
nv_printf(NV_DBG_ERRORS, "NVRM: osDelayUs %d: 0x%x 0x%x\n",
MicroSeconds, tm2.tv_sec - tm1.tv_sec, tm2.tv_usec - tm1.tv_usec);
#endif
@@ -518,7 +519,7 @@ RM_STATUS NV_API_CALL os_delay(NvU32 MilliSeconds)
struct timeval tm_start;
#endif
- do_gettimeofday(&tm_aux);
+ nv_gettimeofday(&tm_aux);
#ifdef NV_CHECK_DELAY_ACCURACY
tm_start = tm_aux;
#endif
@@ -552,7 +553,7 @@ RM_STATUS NV_API_CALL os_delay(NvU32 MilliSeconds)
do
{
schedule_timeout(jiffies);
- do_gettimeofday(&tm_aux);
+ nv_gettimeofday(&tm_aux);
if (NV_TIMERCMP(&tm_aux, &tm_end, <))
{
NV_TIMERSUB(&tm_end, &tm_aux, &tm_aux);
@@ -574,7 +575,7 @@ RM_STATUS NV_API_CALL os_delay(NvU32 MilliSeconds)
udelay(MicroSeconds);
}
#ifdef NV_CHECK_DELAY_ACCURACY
- do_gettimeofday(&tm_aux);
+ nv_gettimeofday(&tm_aux);
timersub(&tm_aux, &tm_start, &tm_aux);
nv_printf(NV_DBG_ERRORS, "NVRM: osDelay %dmsec: %d.%06dsec\n",
MilliSeconds, tm_aux.tv_sec, tm_aux.tv_usec);
diff --git a/uvm/Makefile b/uvm/Makefile
index 42ad927..5c7b466 100644
--- a/uvm/Makefile
+++ b/uvm/Makefile
@@ -171,6 +171,7 @@ COMPILE_TESTS = \
kbasename \
fatal_signal_pending \
kuid_t \
+ do_gettimeofday \
vm_fault_has_address
MODULE_NAME:= nvidia-uvm
diff --git a/uvm/nvidia_uvm_linux.h b/uvm/nvidia_uvm_linux.h
index 1625209..1edb620 100644
--- a/uvm/nvidia_uvm_linux.h
+++ b/uvm/nvidia_uvm_linux.h
@@ -146,6 +146,7 @@
#include <linux/interrupt.h> /* tasklets, interrupt helpers */
#include <linux/timer.h>
#include <linux/time.h> /* do_gettimeofday()*/
+#include "nv-time.h"
#include <asm/div64.h> /* do_div() */
#if defined(NV_ASM_SYSTEM_H_PRESENT)
diff --git a/uvm/nvidia_uvm_lite.c b/uvm/nvidia_uvm_lite.c
index 119c93a..33b8d4b 100644
--- a/uvm/nvidia_uvm_lite.c
+++ b/uvm/nvidia_uvm_lite.c
@@ -2019,7 +2019,7 @@ static RM_STATUS _check_ecc_errors(UvmGpuMigrationTracking *pMigTracker,
{
if (!!(rmInterruptSet) && !bEccIncomingError)
{
- do_gettimeofday(&eccErrorStartTime);
+ nv_gettimeofday(&eccErrorStartTime);
_set_timeout_in_usec(&eccErrorStartTime, &eccTimeout,
UVM_ECC_ERR_TIMEOUT_USEC);
@@ -2051,7 +2051,7 @@ static RM_STATUS _check_ecc_errors(UvmGpuMigrationTracking *pMigTracker,
//
if (!!(rmInterruptSet) && (eccErrorStartTime.tv_usec != 0))
{
- do_gettimeofday(&eccErrorCurrentTime);
+ nv_gettimeofday(&eccErrorCurrentTime);
if ((eccErrorCurrentTime.tv_sec > eccTimeout.tv_sec) ||
((eccErrorCurrentTime.tv_sec == eccTimeout.tv_sec) &&
(eccErrorCurrentTime.tv_usec >= eccTimeout.tv_usec)))
--
2.19.1
From d48c28c8f690cd1b7f1a252f3a33c9b536096