| 1 |
|
| 2 | |
| 3 | * Copyright 2024 Advanced Micro Devices, Inc.
|
| 4 | *
|
| 5 | * Lockdep annotation interface for AMDGPU
|
| 6 |
|
| 7 |
|
| 8 | #ifndef __AMDGPU_LOCKDEP_H__
|
| 9 | #define __AMDGPU_LOCKDEP_H__
|
| 10 |
|
| 11 | #include <linux/lockdep.h>
|
| 12 |
|
| 13 | struct amdgpu_device;
|
| 14 |
|
| 15 | #ifdef CONFIG_LOCKDEP
|
| 16 |
|
| 17 | |
| 18 | * amdgpu_lockdep_init - Train lockdep on correct lock ordering
|
| 19 | *
|
| 20 | * Call once during module init to establish the lock dependency chain.
|
| 21 |
|
| 22 | int amdgpu_lockdep_init(void);
|
| 23 |
|
| 24 | |
| 25 | * amdgpu_lockdep_set_class - Associate lock class keys with real locks
|
| 26 | * @adev: AMDGPU device
|
| 27 | *
|
| 28 | * Call during device init to associate lock classes with actual locks.
|
| 29 |
|
| 30 | void amdgpu_lockdep_set_class(struct amdgpu_device *adev);
|
| 31 |
|
| 32 | #else
|
| 33 |
|
| 34 | static inline int amdgpu_lockdep_init(void) { return 0; }
|
| 35 | static inline void amdgpu_lockdep_set_class(struct amdgpu_device *adev) {}
|
| 36 |
|
| 37 | #endif
|
| 38 |
|
| 39 | #endif
|