diff --git a/msm/sde_dbg.h b/msm/sde_dbg.h index fc8e7987c5..03c02f20a9 100644 --- a/msm/sde_dbg.h +++ b/msm/sde_dbg.h @@ -191,11 +191,10 @@ struct sde_dbg_reglog { u32 first; u32 last; u32 last_dump; - u32 curr; + atomic64_t curr; u32 next; u32 enable; u32 enable_mask; - spinlock_t spin_lock; }; extern struct sde_dbg_reglog *sde_dbg_base_reglog; diff --git a/msm/sde_dbg_evtlog.c b/msm/sde_dbg_evtlog.c index 03a1e287bd..1b18d4a49b 100644 --- a/msm/sde_dbg_evtlog.c +++ b/msm/sde_dbg_evtlog.c @@ -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; }