Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Advanced Micro Devices, Inc. |
| 3 | * All Rights Reserved. |
| 4 | * |
| 5 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 6 | * copy of this software and associated documentation files (the |
| 7 | * "Software"), to deal in the Software without restriction, including |
| 8 | * without limitation the rights to use, copy, modify, merge, publish, |
| 9 | * distribute, sub license, and/or sell copies of the Software, and to |
| 10 | * permit persons to whom the Software is furnished to do so, subject to |
| 11 | * the following conditions: |
| 12 | * |
| 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL |
| 16 | * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, |
| 17 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 18 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
| 19 | * USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 20 | * |
| 21 | * The above copyright notice and this permission notice (including the |
| 22 | * next paragraph) shall be included in all copies or substantial portions |
| 23 | * of the Software. |
| 24 | * |
| 25 | */ |
| 26 | /* |
| 27 | * Authors: |
| 28 | * Christian König <christian.koenig@amd.com> |
| 29 | */ |
| 30 | |
| 31 | #include <linux/firmware.h> |
| 32 | #include <linux/module.h> |
| 33 | #include <linux/mmu_notifier.h> |
Christian König | a9f87f6 | 2017-03-30 14:03:59 +0200 | [diff] [blame] | 34 | #include <linux/interval_tree.h> |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 35 | #include <drm/drmP.h> |
| 36 | #include <drm/drm.h> |
| 37 | |
| 38 | #include "amdgpu.h" |
| 39 | |
| 40 | struct amdgpu_mn { |
| 41 | /* constant after initialisation */ |
| 42 | struct amdgpu_device *adev; |
| 43 | struct mm_struct *mm; |
| 44 | struct mmu_notifier mn; |
| 45 | |
| 46 | /* only used on destruction */ |
| 47 | struct work_struct work; |
| 48 | |
| 49 | /* protected by adev->mn_lock */ |
| 50 | struct hlist_node node; |
| 51 | |
Christian König | 0d2b42b | 2016-03-18 19:29:51 +0100 | [diff] [blame] | 52 | /* objects protected by lock */ |
Christian König | 60de1c1 | 2017-09-05 14:50:24 +0200 | [diff] [blame] | 53 | struct rw_semaphore lock; |
Davidlohr Bueso | f808c13 | 2017-09-08 16:15:08 -0700 | [diff] [blame] | 54 | struct rb_root_cached objects; |
Christian König | 1ed3d25 | 2017-09-05 17:30:46 +0200 | [diff] [blame] | 55 | struct mutex read_lock; |
| 56 | atomic_t recursion; |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 57 | }; |
| 58 | |
| 59 | struct amdgpu_mn_node { |
| 60 | struct interval_tree_node it; |
| 61 | struct list_head bos; |
| 62 | }; |
| 63 | |
| 64 | /** |
| 65 | * amdgpu_mn_destroy - destroy the rmn |
| 66 | * |
| 67 | * @work: previously sheduled work item |
| 68 | * |
| 69 | * Lazy destroys the notifier from a work item |
| 70 | */ |
| 71 | static void amdgpu_mn_destroy(struct work_struct *work) |
| 72 | { |
| 73 | struct amdgpu_mn *rmn = container_of(work, struct amdgpu_mn, work); |
| 74 | struct amdgpu_device *adev = rmn->adev; |
| 75 | struct amdgpu_mn_node *node, *next_node; |
| 76 | struct amdgpu_bo *bo, *next_bo; |
| 77 | |
| 78 | mutex_lock(&adev->mn_lock); |
Christian König | 60de1c1 | 2017-09-05 14:50:24 +0200 | [diff] [blame] | 79 | down_write(&rmn->lock); |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 80 | hash_del(&rmn->node); |
Davidlohr Bueso | f808c13 | 2017-09-08 16:15:08 -0700 | [diff] [blame] | 81 | rbtree_postorder_for_each_entry_safe(node, next_node, |
| 82 | &rmn->objects.rb_root, it.rb) { |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 83 | list_for_each_entry_safe(bo, next_bo, &node->bos, mn_list) { |
| 84 | bo->mn = NULL; |
| 85 | list_del_init(&bo->mn_list); |
| 86 | } |
| 87 | kfree(node); |
| 88 | } |
Christian König | 60de1c1 | 2017-09-05 14:50:24 +0200 | [diff] [blame] | 89 | up_write(&rmn->lock); |
Felix Kuehling | b8ea378 | 2016-02-16 15:29:23 -0500 | [diff] [blame] | 90 | mutex_unlock(&adev->mn_lock); |
Felix Kuehling | fa5b500 | 2016-01-14 00:35:08 -0500 | [diff] [blame] | 91 | mmu_notifier_unregister_no_release(&rmn->mn, rmn->mm); |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 92 | kfree(rmn); |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * amdgpu_mn_release - callback to notify about mm destruction |
| 97 | * |
| 98 | * @mn: our notifier |
| 99 | * @mn: the mm this callback is about |
| 100 | * |
| 101 | * Shedule a work item to lazy destroy our notifier. |
| 102 | */ |
| 103 | static void amdgpu_mn_release(struct mmu_notifier *mn, |
| 104 | struct mm_struct *mm) |
| 105 | { |
| 106 | struct amdgpu_mn *rmn = container_of(mn, struct amdgpu_mn, mn); |
| 107 | INIT_WORK(&rmn->work, amdgpu_mn_destroy); |
| 108 | schedule_work(&rmn->work); |
| 109 | } |
| 110 | |
Christian König | 3fe8977 | 2017-09-12 14:25:14 -0400 | [diff] [blame] | 111 | |
| 112 | /** |
| 113 | * amdgpu_mn_lock - take the write side lock for this mn |
| 114 | */ |
| 115 | void amdgpu_mn_lock(struct amdgpu_mn *mn) |
| 116 | { |
| 117 | if (mn) |
| 118 | down_write(&mn->lock); |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * amdgpu_mn_unlock - drop the write side lock for this mn |
| 123 | */ |
| 124 | void amdgpu_mn_unlock(struct amdgpu_mn *mn) |
| 125 | { |
| 126 | if (mn) |
| 127 | up_write(&mn->lock); |
| 128 | } |
| 129 | |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 130 | /** |
Christian König | 1ed3d25 | 2017-09-05 17:30:46 +0200 | [diff] [blame] | 131 | * amdgpu_mn_read_lock - take the rmn read lock |
| 132 | * |
| 133 | * @rmn: our notifier |
| 134 | * |
| 135 | * Take the rmn read side lock. |
| 136 | */ |
| 137 | static void amdgpu_mn_read_lock(struct amdgpu_mn *rmn) |
| 138 | { |
| 139 | mutex_lock(&rmn->read_lock); |
| 140 | if (atomic_inc_return(&rmn->recursion) == 1) |
| 141 | down_read_non_owner(&rmn->lock); |
| 142 | mutex_unlock(&rmn->read_lock); |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * amdgpu_mn_read_unlock - drop the rmn read lock |
| 147 | * |
| 148 | * @rmn: our notifier |
| 149 | * |
| 150 | * Drop the rmn read side lock. |
| 151 | */ |
| 152 | static void amdgpu_mn_read_unlock(struct amdgpu_mn *rmn) |
| 153 | { |
| 154 | if (atomic_dec_return(&rmn->recursion) == 0) |
| 155 | up_read_non_owner(&rmn->lock); |
| 156 | } |
| 157 | |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 158 | /** |
Christian König | ae20f12 | 2016-03-18 19:29:52 +0100 | [diff] [blame] | 159 | * amdgpu_mn_invalidate_node - unmap all BOs of a node |
| 160 | * |
| 161 | * @node: the node with the BOs to unmap |
| 162 | * |
| 163 | * We block for all BOs and unmap them by move them |
| 164 | * into system domain again. |
| 165 | */ |
| 166 | static void amdgpu_mn_invalidate_node(struct amdgpu_mn_node *node, |
| 167 | unsigned long start, |
| 168 | unsigned long end) |
| 169 | { |
| 170 | struct amdgpu_bo *bo; |
| 171 | long r; |
| 172 | |
| 173 | list_for_each_entry(bo, &node->bos, mn_list) { |
| 174 | |
| 175 | if (!amdgpu_ttm_tt_affect_userptr(bo->tbo.ttm, start, end)) |
| 176 | continue; |
| 177 | |
Christian König | ae20f12 | 2016-03-18 19:29:52 +0100 | [diff] [blame] | 178 | r = reservation_object_wait_timeout_rcu(bo->tbo.resv, |
| 179 | true, false, MAX_SCHEDULE_TIMEOUT); |
| 180 | if (r <= 0) |
| 181 | DRM_ERROR("(%ld) failed to wait for user bo\n", r); |
| 182 | |
Christian König | 1b0c0f9 | 2017-09-05 14:36:44 +0200 | [diff] [blame] | 183 | amdgpu_ttm_tt_mark_user_pages(bo->tbo.ttm); |
Christian König | ae20f12 | 2016-03-18 19:29:52 +0100 | [diff] [blame] | 184 | } |
| 185 | } |
| 186 | |
| 187 | /** |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 188 | * amdgpu_mn_invalidate_range_start - callback to notify about mm change |
| 189 | * |
| 190 | * @mn: our notifier |
| 191 | * @mn: the mm this callback is about |
| 192 | * @start: start of updated range |
| 193 | * @end: end of updated range |
| 194 | * |
| 195 | * We block for all BOs between start and end to be idle and |
| 196 | * unmap them by move them into system domain again. |
| 197 | */ |
| 198 | static void amdgpu_mn_invalidate_range_start(struct mmu_notifier *mn, |
| 199 | struct mm_struct *mm, |
| 200 | unsigned long start, |
| 201 | unsigned long end) |
| 202 | { |
| 203 | struct amdgpu_mn *rmn = container_of(mn, struct amdgpu_mn, mn); |
| 204 | struct interval_tree_node *it; |
| 205 | |
| 206 | /* notification is exclusive, but interval is inclusive */ |
| 207 | end -= 1; |
| 208 | |
Christian König | 1ed3d25 | 2017-09-05 17:30:46 +0200 | [diff] [blame] | 209 | amdgpu_mn_read_lock(rmn); |
Christian König | 0d2b42b | 2016-03-18 19:29:51 +0100 | [diff] [blame] | 210 | |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 211 | it = interval_tree_iter_first(&rmn->objects, start, end); |
| 212 | while (it) { |
| 213 | struct amdgpu_mn_node *node; |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 214 | |
| 215 | node = container_of(it, struct amdgpu_mn_node, it); |
| 216 | it = interval_tree_iter_next(it, start, end); |
| 217 | |
Christian König | ae20f12 | 2016-03-18 19:29:52 +0100 | [diff] [blame] | 218 | amdgpu_mn_invalidate_node(node, start, end); |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 219 | } |
Christian König | 1ed3d25 | 2017-09-05 17:30:46 +0200 | [diff] [blame] | 220 | } |
Christian König | 0d2b42b | 2016-03-18 19:29:51 +0100 | [diff] [blame] | 221 | |
Christian König | 1ed3d25 | 2017-09-05 17:30:46 +0200 | [diff] [blame] | 222 | /** |
| 223 | * amdgpu_mn_invalidate_range_end - callback to notify about mm change |
| 224 | * |
| 225 | * @mn: our notifier |
| 226 | * @mn: the mm this callback is about |
| 227 | * @start: start of updated range |
| 228 | * @end: end of updated range |
| 229 | * |
| 230 | * Release the lock again to allow new command submissions. |
| 231 | */ |
| 232 | static void amdgpu_mn_invalidate_range_end(struct mmu_notifier *mn, |
| 233 | struct mm_struct *mm, |
| 234 | unsigned long start, |
| 235 | unsigned long end) |
| 236 | { |
| 237 | struct amdgpu_mn *rmn = container_of(mn, struct amdgpu_mn, mn); |
| 238 | |
| 239 | amdgpu_mn_read_unlock(rmn); |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | static const struct mmu_notifier_ops amdgpu_mn_ops = { |
| 243 | .release = amdgpu_mn_release, |
| 244 | .invalidate_range_start = amdgpu_mn_invalidate_range_start, |
Christian König | 1ed3d25 | 2017-09-05 17:30:46 +0200 | [diff] [blame] | 245 | .invalidate_range_end = amdgpu_mn_invalidate_range_end, |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 246 | }; |
| 247 | |
| 248 | /** |
| 249 | * amdgpu_mn_get - create notifier context |
| 250 | * |
| 251 | * @adev: amdgpu device pointer |
| 252 | * |
| 253 | * Creates a notifier context for current->mm. |
| 254 | */ |
Christian König | 3fe8977 | 2017-09-12 14:25:14 -0400 | [diff] [blame] | 255 | struct amdgpu_mn *amdgpu_mn_get(struct amdgpu_device *adev) |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 256 | { |
| 257 | struct mm_struct *mm = current->mm; |
| 258 | struct amdgpu_mn *rmn; |
| 259 | int r; |
| 260 | |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 261 | mutex_lock(&adev->mn_lock); |
Michal Hocko | b563705 | 2016-05-23 16:26:17 -0700 | [diff] [blame] | 262 | if (down_write_killable(&mm->mmap_sem)) { |
| 263 | mutex_unlock(&adev->mn_lock); |
| 264 | return ERR_PTR(-EINTR); |
| 265 | } |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 266 | |
| 267 | hash_for_each_possible(adev->mn_hash, rmn, node, (unsigned long)mm) |
| 268 | if (rmn->mm == mm) |
| 269 | goto release_locks; |
| 270 | |
| 271 | rmn = kzalloc(sizeof(*rmn), GFP_KERNEL); |
| 272 | if (!rmn) { |
| 273 | rmn = ERR_PTR(-ENOMEM); |
| 274 | goto release_locks; |
| 275 | } |
| 276 | |
| 277 | rmn->adev = adev; |
| 278 | rmn->mm = mm; |
| 279 | rmn->mn.ops = &amdgpu_mn_ops; |
Christian König | 60de1c1 | 2017-09-05 14:50:24 +0200 | [diff] [blame] | 280 | init_rwsem(&rmn->lock); |
Davidlohr Bueso | f808c13 | 2017-09-08 16:15:08 -0700 | [diff] [blame] | 281 | rmn->objects = RB_ROOT_CACHED; |
Christian König | 1ed3d25 | 2017-09-05 17:30:46 +0200 | [diff] [blame] | 282 | mutex_init(&rmn->read_lock); |
| 283 | atomic_set(&rmn->recursion, 0); |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 284 | |
| 285 | r = __mmu_notifier_register(&rmn->mn, mm); |
| 286 | if (r) |
| 287 | goto free_rmn; |
| 288 | |
| 289 | hash_add(adev->mn_hash, &rmn->node, (unsigned long)mm); |
| 290 | |
| 291 | release_locks: |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 292 | up_write(&mm->mmap_sem); |
Felix Kuehling | b8ea378 | 2016-02-16 15:29:23 -0500 | [diff] [blame] | 293 | mutex_unlock(&adev->mn_lock); |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 294 | |
| 295 | return rmn; |
| 296 | |
| 297 | free_rmn: |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 298 | up_write(&mm->mmap_sem); |
Felix Kuehling | b8ea378 | 2016-02-16 15:29:23 -0500 | [diff] [blame] | 299 | mutex_unlock(&adev->mn_lock); |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 300 | kfree(rmn); |
| 301 | |
| 302 | return ERR_PTR(r); |
| 303 | } |
| 304 | |
| 305 | /** |
| 306 | * amdgpu_mn_register - register a BO for notifier updates |
| 307 | * |
| 308 | * @bo: amdgpu buffer object |
| 309 | * @addr: userptr addr we should monitor |
| 310 | * |
| 311 | * Registers an MMU notifier for the given BO at the specified address. |
| 312 | * Returns 0 on success, -ERRNO if anything goes wrong. |
| 313 | */ |
| 314 | int amdgpu_mn_register(struct amdgpu_bo *bo, unsigned long addr) |
| 315 | { |
| 316 | unsigned long end = addr + amdgpu_bo_size(bo) - 1; |
Christian König | a7d64de | 2016-09-15 14:58:48 +0200 | [diff] [blame] | 317 | struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 318 | struct amdgpu_mn *rmn; |
| 319 | struct amdgpu_mn_node *node = NULL; |
| 320 | struct list_head bos; |
| 321 | struct interval_tree_node *it; |
| 322 | |
| 323 | rmn = amdgpu_mn_get(adev); |
| 324 | if (IS_ERR(rmn)) |
| 325 | return PTR_ERR(rmn); |
| 326 | |
| 327 | INIT_LIST_HEAD(&bos); |
| 328 | |
Christian König | 60de1c1 | 2017-09-05 14:50:24 +0200 | [diff] [blame] | 329 | down_write(&rmn->lock); |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 330 | |
| 331 | while ((it = interval_tree_iter_first(&rmn->objects, addr, end))) { |
| 332 | kfree(node); |
| 333 | node = container_of(it, struct amdgpu_mn_node, it); |
| 334 | interval_tree_remove(&node->it, &rmn->objects); |
| 335 | addr = min(it->start, addr); |
| 336 | end = max(it->last, end); |
| 337 | list_splice(&node->bos, &bos); |
| 338 | } |
| 339 | |
| 340 | if (!node) { |
| 341 | node = kmalloc(sizeof(struct amdgpu_mn_node), GFP_KERNEL); |
| 342 | if (!node) { |
Christian König | 60de1c1 | 2017-09-05 14:50:24 +0200 | [diff] [blame] | 343 | up_write(&rmn->lock); |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 344 | return -ENOMEM; |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | bo->mn = rmn; |
| 349 | |
| 350 | node->it.start = addr; |
| 351 | node->it.last = end; |
| 352 | INIT_LIST_HEAD(&node->bos); |
| 353 | list_splice(&bos, &node->bos); |
| 354 | list_add(&bo->mn_list, &node->bos); |
| 355 | |
| 356 | interval_tree_insert(&node->it, &rmn->objects); |
| 357 | |
Christian König | 60de1c1 | 2017-09-05 14:50:24 +0200 | [diff] [blame] | 358 | up_write(&rmn->lock); |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 359 | |
| 360 | return 0; |
| 361 | } |
| 362 | |
| 363 | /** |
| 364 | * amdgpu_mn_unregister - unregister a BO for notifier updates |
| 365 | * |
| 366 | * @bo: amdgpu buffer object |
| 367 | * |
| 368 | * Remove any registration of MMU notifier updates from the buffer object. |
| 369 | */ |
| 370 | void amdgpu_mn_unregister(struct amdgpu_bo *bo) |
| 371 | { |
Christian König | a7d64de | 2016-09-15 14:58:48 +0200 | [diff] [blame] | 372 | struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); |
Felix Kuehling | b8ea378 | 2016-02-16 15:29:23 -0500 | [diff] [blame] | 373 | struct amdgpu_mn *rmn; |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 374 | struct list_head *head; |
| 375 | |
Felix Kuehling | b8ea378 | 2016-02-16 15:29:23 -0500 | [diff] [blame] | 376 | mutex_lock(&adev->mn_lock); |
| 377 | |
| 378 | rmn = bo->mn; |
| 379 | if (rmn == NULL) { |
| 380 | mutex_unlock(&adev->mn_lock); |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 381 | return; |
Felix Kuehling | b8ea378 | 2016-02-16 15:29:23 -0500 | [diff] [blame] | 382 | } |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 383 | |
Christian König | 60de1c1 | 2017-09-05 14:50:24 +0200 | [diff] [blame] | 384 | down_write(&rmn->lock); |
Christian König | c41d271 | 2016-02-09 16:13:37 +0100 | [diff] [blame] | 385 | |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 386 | /* save the next list entry for later */ |
| 387 | head = bo->mn_list.next; |
| 388 | |
| 389 | bo->mn = NULL; |
Felix Kuehling | 68c9793d | 2017-08-01 22:34:55 -0400 | [diff] [blame] | 390 | list_del_init(&bo->mn_list); |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 391 | |
| 392 | if (list_empty(head)) { |
| 393 | struct amdgpu_mn_node *node; |
| 394 | node = container_of(head, struct amdgpu_mn_node, bos); |
| 395 | interval_tree_remove(&node->it, &rmn->objects); |
| 396 | kfree(node); |
| 397 | } |
| 398 | |
Christian König | 60de1c1 | 2017-09-05 14:50:24 +0200 | [diff] [blame] | 399 | up_write(&rmn->lock); |
Felix Kuehling | b8ea378 | 2016-02-16 15:29:23 -0500 | [diff] [blame] | 400 | mutex_unlock(&adev->mn_lock); |
Alex Deucher | d38ceaf | 2015-04-20 16:55:21 -0400 | [diff] [blame] | 401 | } |
Christian König | 3fe8977 | 2017-09-12 14:25:14 -0400 | [diff] [blame] | 402 | |