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

Commit 98ffb324 authored by Lynus Vaz's avatar Lynus Vaz
Browse files

msm: kgsl: Prevent a deadlock when removing debugfs nodes



Release the kgsl process mutex before removing the process kgsl
debugfs nodes to prevent a deadlock.

Change-Id: I5ef83e54252991cf552807c39639e3ef6fa03969
Signed-off-by: default avatarLynus Vaz <lvaz@codeaurora.org>
parent 70be28c9
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -989,7 +989,6 @@ static void kgsl_process_private_close(struct kgsl_device_private *dev_priv,
	 */

	kgsl_process_uninit_sysfs(private);
	debugfs_remove_recursive(private->debug_root);

	process_release_sync_sources(private);

@@ -1001,12 +1000,14 @@ static void kgsl_process_private_close(struct kgsl_device_private *dev_priv,
	list_del(&private->list);

	/*
	 * Unlock the mutex before releasing the memory - this prevents a
	 * deadlock with the IOMMU mutex if a page fault occurs
	 * Unlock the mutex before releasing the memory and the debugfs
	 * nodes - this prevents deadlocks with the IOMMU and debugfs
	 * locks.
	 */
	mutex_unlock(&kgsl_driver.process_mutex);

	process_release_memory(private);
	debugfs_remove_recursive(private->debug_root);

	kgsl_process_private_put(private);
}