Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6450a9e0 authored by Pankaj Gupta's avatar Pankaj Gupta
Browse files

msm: kgsl: Use worker to put refcount on mem entry



If refcount on mem entry is the last refcount, we will call
kgsl_mem_entry_destroy and detach it from process list. If
there is no refcount on the process private as well then we
will call kgsl_destroy_process_private to cleanup. During
cleanup, we will try to remove the same sysfs node which is
in use by the current thread and this situation will end up in
a deadlock.
To fix this problem, use a worker to put the refcount on mem
entry.

Change-Id: I69a77c4059489c95de2ca205701571daac4bdc8a
Signed-off-by: default avatarPankaj Gupta <gpankaj@codeaurora.org>
parent 1c2af547
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -171,7 +171,18 @@ imported_mem_show(struct kgsl_process_private *priv,
			}
		}

		kgsl_mem_entry_put(entry);
		/*
		 * If refcount on mem entry is the last refcount, we will
		 * call kgsl_mem_entry_destroy and detach it from process
		 * list. When there is no refcount on the process private,
		 * we will call kgsl_destroy_process_private to do cleanup.
		 * During cleanup, we will try to remove the same sysfs
		 * node which is in use by the current thread and this
		 * situation will end up in a deadloack.
		 * To avoid this situation, use a worker to put the refcount
		 * on mem entry.
		 */
		kgsl_mem_entry_put_deferred(entry);
		spin_lock(&priv->mem_lock);
	}
	spin_unlock(&priv->mem_lock);