Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/ww_mutex.h
Context not available. | |||||
#include <linux/mutex.h> | #include <linux/mutex.h> | ||||
struct task_struct; | |||||
struct ww_class { | struct ww_class { | ||||
const char *mutex_name; | const char *mutex_name; | ||||
}; | }; | ||||
Context not available. | |||||
struct ww_mutex { | struct ww_mutex { | ||||
struct mutex base; | struct mutex base; | ||||
struct ww_acquire_ctx *ctx; | |||||
hselasky: Is this field used? | |||||
Not Done Inline ActionsYes johalun0_gmail.com: Yes | |||||
Not Done Inline ActionsThis field is only read. Who is setting it up? I think you should stub its usage in drm-next? hselasky: This field is only read. Who is setting it up? I think you should stub its usage in drm-next? | |||||
Not Done Inline ActionsThe usage is here: https://github.com/FreeBSDDesktop/kms-drm/blob/drm-v4.15/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c#L1587 However, I can not find where it's being set. Maybe that's a Linux internal thing? I can disable that check in the driver code. johalun0_gmail.com: The usage is here: https://github.com/FreeBSDDesktop/kms-drm/blob/drm-v4. | |||||
Not Done Inline ActionsYes, I believe that check should be disabled or replaced. hselasky: Yes, I believe that check should be disabled or replaced. | |||||
struct cv condvar; | struct cv condvar; | ||||
}; | }; | ||||
Context not available. | |||||
} | } | ||||
Done Inline ActionsThese chunks look just like re-ordered code? Can you remove them? hselasky: These chunks look just like re-ordered code? Can you remove them? | |||||
static inline void | static inline void | ||||
ww_mutex_destroy(struct ww_mutex *lock) | ww_mutex_init(struct ww_mutex *lock, struct ww_class *ww_class) | ||||
{ | { | ||||
cv_destroy(&lock->condvar); | linux_mutex_init(&lock->base, ww_class->mutex_name, SX_NOWITNESS); | ||||
mutex_destroy(&lock->base); | cv_init(&lock->condvar, "lkpi-ww"); | ||||
} | } | ||||
static inline void | static inline void | ||||
ww_acquire_init(struct ww_acquire_ctx *ctx, struct ww_class *ww_class) | ww_mutex_destroy(struct ww_mutex *lock) | ||||
{ | { | ||||
cv_destroy(&lock->condvar); | |||||
mutex_destroy(&lock->base); | |||||
} | } | ||||
static inline void | static inline void | ||||
ww_mutex_init(struct ww_mutex *lock, struct ww_class *ww_class) | ww_acquire_init(struct ww_acquire_ctx *ctx, struct ww_class *ww_class) | ||||
{ | { | ||||
linux_mutex_init(&lock->base, ww_class->mutex_name, SX_NOWITNESS); | // NOP is deliberate | ||||
cv_init(&lock->condvar, "lkpi-ww"); | |||||
} | } | ||||
static inline void | static inline void | ||||
ww_acquire_fini(struct ww_acquire_ctx *ctx) | ww_acquire_fini(struct ww_acquire_ctx *ctx) | ||||
{ | { | ||||
// NOP is deliberate | |||||
} | } | ||||
static inline void | static inline void | ||||
ww_acquire_done(struct ww_acquire_ctx *ctx) | ww_acquire_done(struct ww_acquire_ctx *ctx) | ||||
{ | { | ||||
// NOP is deliberate | |||||
} | } | ||||
#endif /* _LINUX_WW_MUTEX_H_ */ | #endif /* _LINUX_WW_MUTEX_H_ */ | ||||
Context not available. |
Is this field used?