projects/linux·blob master · refs

39 lines · 913 B

1/* SPDX-License-Identifier: MIT */
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
13struct 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 */
22int 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 */
30void amdgpu_lockdep_set_class(struct amdgpu_device *adev);
31
32#else /* !CONFIG_LOCKDEP */
33
34static inline int amdgpu_lockdep_init(void) { return 0; }
35static inline void amdgpu_lockdep_set_class(struct amdgpu_device *adev) {}
36
37#endif /* CONFIG_LOCKDEP */
38
39#endif /* __AMDGPU_LOCKDEP_H__ */