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

Commit 95b8aa9b authored by Zhen Kong's avatar Zhen Kong
Browse files

firmware: qcom: tz_log: change to use debugfs_create_file_unsafe



In the 4.9 kernel, a global srcu lock was added to debugfs file
operation, which will be hold during full_proxy_read operation. As
tz_log reading operation will sleep until there is new data coming,
this makes srcu deadlock with other driver debugfs operations. To
break deadlock for sleep use cases during debugfs_read, change to
use debugfs_create_file_unsafe(), then full_proxy_read is not used,
and it will not hold srcu lock. Besides, tz_log debugfs won't get
removed and thus, there is no need to protect it against removal
races. The use of debugfs_create_file_unsafe() is safe here.

Change-Id: I63efc408f4adb04a664c0944b899946770d60b18
Signed-off-by: default avatarZhen Kong <zkong@codeaurora.org>
parent 7529b53b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -962,7 +962,7 @@ static int tzdbgfs_init(struct platform_device *pdev)

	for (i = 0; i < TZDBG_STATS_MAX; i++) {
		tzdbg.debug_tz[i] = i;
		dent = debugfs_create_file(tzdbg.stat[i].name,
		dent = debugfs_create_file_unsafe(tzdbg.stat[i].name,
				0444, dent_dir,
				&tzdbg.debug_tz[i], &tzdbg_fops);
		if (dent == NULL) {