|
@@ -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;
|
|
|
}
|