2020-02-13 03:23:43 +00:00
|
|
|
--- a/kernel/nv-linux.h
|
|
|
|
+++ b/kernel/nv-linux.h
|
|
|
|
@@ -1190,7 +1190,8 @@ typedef void irqreturn_t;
|
|
|
|
#ifndef PCI_CAP_ID_EXP
|
|
|
|
#define PCI_CAP_ID_EXP 0x10
|
|
|
|
#endif
|
|
|
|
-
|
|
|
|
+#define NV_KMEM_CACHE_CREATE_FULL_USERCOPY(name, size, align, flags, useroffset, usersize, ctor) \
|
|
|
|
+ kmem_cache_create_usercopy(name, size, align, flags, useroffset, usersize, ctor)
|
|
|
|
/*
|
|
|
|
* On Linux on PPC64LE enable basic support for Linux PCI error recovery (see
|
|
|
|
* Documentation/PCI/pci-error-recovery.txt). Currently RM only supports error
|
|
|
|
@@ -1199,6 +1200,9 @@ typedef void irqreturn_t;
|
|
|
|
#if defined(NVCPU_PPC64LE)
|
|
|
|
#define NV_PCI_ERROR_RECOVERY
|
|
|
|
#define NV_PCI_ERS_BUFFER_SIZE 0x1000
|
2020-02-16 16:29:45 +00:00
|
|
|
#endif
|
2020-02-13 03:23:43 +00:00
|
|
|
+#define NV_KMEM_CACHE_CREATE_USERCOPY(name, type) \
|
|
|
|
+ NV_KMEM_CACHE_CREATE_FULL_USERCOPY(name, sizeof(type), 0, 0, 0, sizeof(type), NULL)
|
|
|
|
+
|
|
|
|
|
|
|
|
/*
|
|
|
|
--- a/kernel/nv.c
|
|
|
|
+++ b/kernel/nv.c
|
|
|
|
@@ -752,7 +752,7 @@ int __init nvidia_init_module(void)
|
|
|
|
NV_SPIN_LOCK_INIT(&km_lock);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
- NV_KMEM_CACHE_CREATE(nv_stack_t_cache, NV_STACK_CACHE_STR, nv_stack_t);
|
2020-02-16 16:29:45 +00:00
|
|
|
+ nv_stack_t_cache = NV_KMEM_CACHE_CREATE_USERCOPY(NV_STACK_CACHE_STR, nv_stack_t);
|
2020-02-13 03:23:43 +00:00
|
|
|
if (nv_stack_t_cache == NULL)
|
|
|
|
{
|
|
|
|
nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n");
|