disp: msm: sde: avoid using spinlock for register log
Add support to use atomic variable instead of spinlock for register logs during register write. This change helps in reducing the run-time and is safe to use as most of the register writes happen in commit context. Change-Id: Ib7e377f80cbf437e391792b0b424cbd1eefdf497 Signed-off-by: Yashwanth <yvulapu@codeaurora.org> Signed-off-by: Samantha Tran <samtran@codeaurora.org>
This commit is contained in:

committad av
Samantha Tran

förälder
8b0b1d1c51
incheckning
e57b8443cc
@@ -103,27 +103,22 @@ exit:
|
||||
|
||||
void sde_reglog_log(u8 blk_id, u32 val, u32 addr)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct sde_dbg_reglog_log *log;
|
||||
struct sde_dbg_reglog *reglog = sde_dbg_base_reglog;
|
||||
int index;
|
||||
|
||||
if (!reglog)
|
||||
return;
|
||||
|
||||
spin_lock_irqsave(®log->spin_lock, flags);
|
||||
|
||||
log = ®log->logs[reglog->curr];
|
||||
index = abs(atomic64_inc_return(®log->curr) % SDE_REGLOG_ENTRY);
|
||||
|
||||
log = ®log->logs[index];
|
||||
log->blk_id = blk_id;
|
||||
log->val = val;
|
||||
log->addr = addr;
|
||||
log->time = local_clock();
|
||||
log->pid = current->pid;
|
||||
|
||||
reglog->curr = (reglog->curr + 1) % SDE_REGLOG_ENTRY;
|
||||
reglog->last++;
|
||||
|
||||
spin_unlock_irqrestore(®log->spin_lock, flags);
|
||||
}
|
||||
|
||||
/* always dump the last entries which are not dumped yet */
|
||||
@@ -245,7 +240,7 @@ struct sde_dbg_reglog *sde_reglog_init(void)
|
||||
if (!reglog)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
spin_lock_init(®log->spin_lock);
|
||||
atomic64_set(®log->curr, 0);
|
||||
|
||||
return reglog;
|
||||
}
|
||||
|
Referens i nytt ärende
Block a user