mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
drm/msm: Remove struct_mutex usage
The remaining struct_mutex usage is just to serialize various gpu related things (submit/retire/recover/fault/etc), so replace struct_mutex with gpu->lock. Signed-off-by: Rob Clark <robdclark@chromium.org> Link: https://lore.kernel.org/r/20211109181117.591148-4-robdclark@gmail.com Signed-off-by: Rob Clark <robdclark@chromium.org>
This commit is contained in:
@@ -161,13 +161,23 @@ struct msm_gpu {
|
||||
*/
|
||||
struct list_head active_list;
|
||||
|
||||
/**
|
||||
* lock:
|
||||
*
|
||||
* General lock for serializing all the gpu things.
|
||||
*
|
||||
* TODO move to per-ring locking where feasible (ie. submit/retire
|
||||
* path, etc)
|
||||
*/
|
||||
struct mutex lock;
|
||||
|
||||
/**
|
||||
* active_submits:
|
||||
*
|
||||
* The number of submitted but not yet retired submits, used to
|
||||
* determine transitions between active and idle.
|
||||
*
|
||||
* Protected by lock
|
||||
* Protected by active_lock
|
||||
*/
|
||||
int active_submits;
|
||||
|
||||
@@ -548,28 +558,28 @@ static inline struct msm_gpu_state *msm_gpu_crashstate_get(struct msm_gpu *gpu)
|
||||
{
|
||||
struct msm_gpu_state *state = NULL;
|
||||
|
||||
mutex_lock(&gpu->dev->struct_mutex);
|
||||
mutex_lock(&gpu->lock);
|
||||
|
||||
if (gpu->crashstate) {
|
||||
kref_get(&gpu->crashstate->ref);
|
||||
state = gpu->crashstate;
|
||||
}
|
||||
|
||||
mutex_unlock(&gpu->dev->struct_mutex);
|
||||
mutex_unlock(&gpu->lock);
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
static inline void msm_gpu_crashstate_put(struct msm_gpu *gpu)
|
||||
{
|
||||
mutex_lock(&gpu->dev->struct_mutex);
|
||||
mutex_lock(&gpu->lock);
|
||||
|
||||
if (gpu->crashstate) {
|
||||
if (gpu->funcs->gpu_state_put(gpu->crashstate))
|
||||
gpu->crashstate = NULL;
|
||||
}
|
||||
|
||||
mutex_unlock(&gpu->dev->struct_mutex);
|
||||
mutex_unlock(&gpu->lock);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user