Link Here
|
1 |
--- src/nvidia/nvidia_subr.c.orig 2021-08-02 23:24:25 UTC |
2 |
+++ src/nvidia/nvidia_subr.c |
3 |
@@ -397,7 +397,7 @@ int nvidia_handle_ioctl( |
4 |
nr = xfer->cmd; |
5 |
} |
6 |
|
7 |
- mtx_lock(&nvffp->fops_mtx); |
8 |
+ sx_xlock(&nvffp->fops_sx); |
9 |
sp = nvffp->fops_sp; |
10 |
|
11 |
switch (nr) { |
12 |
@@ -471,7 +471,7 @@ int nvidia_handle_ioctl( |
13 |
break; |
14 |
} |
15 |
|
16 |
- mtx_unlock(&nvffp->fops_mtx); |
17 |
+ sx_xunlock(&nvffp->fops_sx); |
18 |
|
19 |
if (args != (void *)data) { |
20 |
if (copyout(args, NvP64_VALUE(xfer->ptr), size) != 0) |
21 |
@@ -1048,7 +1048,7 @@ NV_STATUS NV_API_CALL nv_add_mapping_context_to_file( |
22 |
|
23 |
nvffp = nv_get_nvffp_from_nvfp(nvfp); |
24 |
|
25 |
- mtx_lock(&nvffp->fops_mtx); |
26 |
+ sx_xlock(&nvffp->fops_sx); |
27 |
|
28 |
nvamc = &nvffp->mmap_context; |
29 |
|
30 |
@@ -1076,7 +1076,7 @@ NV_STATUS NV_API_CALL nv_add_mapping_context_to_file( |
31 |
nvamc->valid = NV_TRUE; |
32 |
|
33 |
done: |
34 |
- mtx_unlock(&nvffp->fops_mtx); |
35 |
+ sx_xunlock(&nvffp->fops_sx); |
36 |
nv_put_file_private(priv); |
37 |
|
38 |
return status; |
39 |
@@ -1503,7 +1503,7 @@ int nvidia_mmap_ctl_single( |
40 |
nv_alloc_mapping_context_t *mmap_context; |
41 |
int status; |
42 |
|
43 |
- mtx_lock(&nvffp->fops_mtx); |
44 |
+ sx_xlock(&nvffp->fops_sx); |
45 |
|
46 |
mmap_context = &nvffp->mmap_context; |
47 |
|
48 |
@@ -1532,7 +1532,7 @@ int nvidia_mmap_ctl_single( |
49 |
status = 0; |
50 |
|
51 |
done: |
52 |
- mtx_unlock(&nvffp->fops_mtx); |
53 |
+ sx_xunlock(&nvffp->fops_sx); |
54 |
|
55 |
return status; |
56 |
} |
57 |
@@ -1553,7 +1553,7 @@ int nvidia_mmap_dev_single( |
58 |
nv = nvffp->nv; |
59 |
sc = nv->os_state; |
60 |
|
61 |
- mtx_lock(&nvffp->fops_mtx); |
62 |
+ sx_xlock(&nvffp->fops_sx); |
63 |
|
64 |
/* |
65 |
* If no mmap context is valid on this file descriptor then this mapping |
66 |
@@ -1593,7 +1593,7 @@ int nvidia_mmap_dev_single( |
67 |
} |
68 |
|
69 |
done: |
70 |
- mtx_unlock(&nvffp->fops_mtx); |
71 |
+ sx_xunlock(&nvffp->fops_sx); |
72 |
|
73 |
return status; |
74 |
} |