disp: msm: sde: use atomic operator for evt log entries
To optimize evt log entries, spinlock is been removed and used atomic operator for curr variable, due to which there is mismatch of count values between curr and last variable during xlog dump in kernel. So change the last variable to atomic to avoid race condition between entries of evt logs. Change-Id: Idf3e2b982261d77fec97985af1e8bf740a6f6197 Signed-off-by: Ryan McCann <quic_rmccann@quicinc.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2009-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
@@ -1561,8 +1561,8 @@ static int sde_dbg_debugfs_open(struct inode *inode, struct file *file)
|
||||
mutex_lock(&sde_dbg_base.mutex);
|
||||
sde_dbg_base.cur_evt_index = 0;
|
||||
sde_dbg_base.evtlog->first = (u32)atomic_add_return(0, &sde_dbg_base.evtlog->curr) + 1;
|
||||
sde_dbg_base.evtlog->last =
|
||||
sde_dbg_base.evtlog->first + SDE_EVTLOG_ENTRY;
|
||||
atomic_set(&sde_dbg_base.evtlog->last,
|
||||
(sde_dbg_base.evtlog->first + SDE_EVTLOG_ENTRY));
|
||||
mutex_unlock(&sde_dbg_base.mutex);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user