mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
disp: msm: dsi: Fix potential data race in ctrl isr
Use atomic operations for shared variables to ensure safe concurrent access from both ISR and task context. Change-Id: I02d4bde88692d0be7027b158648a3ab8a5704b2d Signed-off-by: Gopi Botlagunta <botlagun@qti.qualcomm.com>
This commit is contained in:
parent
920eacd962
commit
df582cc15a
2 changed files with 8 additions and 7 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
*/
|
||||
|
||||
#include <linux/of_device.h>
|
||||
|
|
@ -229,10 +229,10 @@ static ssize_t debugfs_line_count_read(struct file *file,
|
|||
dsi_ctrl->cmd_trigger_frame);
|
||||
len += scnprintf((buf + len), max_len - len,
|
||||
"Command successful at line: %04x\n",
|
||||
dsi_ctrl->cmd_success_line);
|
||||
atomic_read(&dsi_ctrl->cmd_success_line));
|
||||
len += scnprintf((buf + len), max_len - len,
|
||||
"Command successful at frame: %04x\n",
|
||||
dsi_ctrl->cmd_success_frame);
|
||||
atomic_read(&dsi_ctrl->cmd_success_frame));
|
||||
|
||||
mutex_unlock(&dsi_ctrl->ctrl_lock);
|
||||
|
||||
|
|
@ -2891,8 +2891,8 @@ static irqreturn_t dsi_ctrl_isr(int irq, void *ptr)
|
|||
if (dsi_ctrl->enable_cmd_dma_stats) {
|
||||
u32 reg = dsi_ctrl->hw.ops.log_line_count(&dsi_ctrl->hw,
|
||||
dsi_ctrl->cmd_mode);
|
||||
dsi_ctrl->cmd_success_line = (reg & 0xFFFF);
|
||||
dsi_ctrl->cmd_success_frame = ((reg >> 16) & 0xFFFF);
|
||||
atomic_set(&dsi_ctrl->cmd_success_line, (reg & 0xFFFF));
|
||||
atomic_set(&dsi_ctrl->cmd_success_frame, ((reg >> 16) & 0xFFFF));
|
||||
SDE_EVT32(dsi_ctrl->cell_index, SDE_EVTLOG_FUNC_CASE1,
|
||||
dsi_ctrl->cmd_success_line,
|
||||
dsi_ctrl->cmd_success_frame);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
|
|
@ -309,8 +310,8 @@ struct dsi_ctrl {
|
|||
bool cmd_mode;
|
||||
u32 cmd_trigger_line;
|
||||
u32 cmd_trigger_frame;
|
||||
u32 cmd_success_line;
|
||||
u32 cmd_success_frame;
|
||||
atomic_t cmd_success_line;
|
||||
atomic_t cmd_success_frame;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue