dev_warn(ipc->dev, "%s: get token\n", __func__);
return;
}
- ipc_logbuf_outprint(&ipc->chub_rt_log, loop);
+ if (ipc_logbuf_outprint(&ipc->chub_rt_log, loop))
+ chub_dbg_dump_hw(ipc, CHUB_ERR_NANOHUB);
contexthub_put_token(ipc);
}
}
}
ipc_logbuf_flush_on(1);
mutex_lock(&log_mutex);
- ipc_logbuf_outprint(&ipc->chub_rt_log, 100);
+ if (ipc_logbuf_outprint(&ipc->chub_rt_log, 100))
+ chub_dbg_dump_hw(ipc, CHUB_ERR_NANOHUB);
mutex_unlock(&log_mutex);
ipc_logbuf_flush_on(0);
contexthub_put_token(ipc);
{
unsigned long flag;
int size = 0;
- int ret;
+ int ret = 0;
void *rxbuf;
u64 time = 0; /* for debug */
} else {
err = CHUB_ERR_EVTQ_EMTPY;
CSP_PRINTF_ERROR
- ("%s: evt-empty irq:%d(%d+%d), evt:%d, status:0x%x->0x%x(SR:0x%x)\n", __func__,
- irq_num, cur_evt->irq, start_index, evt, status_org, status, ipc_hw_read_int_status_reg(AP));
+ ("%s: evt-empty irq:%d(%d), evt:%d, status:0x%x->0x%x(SR:0x%x)\n", __func__,
+ irq_num, start_index, evt, status_org, status, ipc_hw_read_int_status_reg(AP));
break;
}
ipc_hw_clear_int_pend_reg(AP, irq_num);
#endif
if (!get_evt) {
CSP_PRINTF_ERROR("%s:%s: fails pending wait (%d): irq:%d, evt:%d\n",
- NAME_PREFIX, __func__, trycnt, cur_evt->irq, cur_evt->evt);
+ NAME_PREFIX, __func__, trycnt, cur_evt ? cur_evt->irq : -1, cur_evt ? cur_evt->evt : -1);
ipc_dump();
}
ENABLE_IRQ(LOCK_ADD_EVT, &flag);
return 0;
}
-void ipc_logbuf_outprint(struct runtimelog_buf *rt_buf, u32 loop)
+int ipc_logbuf_outprint(struct runtimelog_buf *rt_buf, u32 loop)
{
if (ipc_map) {
struct logbuf_content *log;
eq = logbuf->eq;
if (eq >= LOGBUF_NUM || logbuf->dq >= LOGBUF_NUM) {
pr_err("%s: index err:%d, eq:%d, dq:%d\n", __func__, eq, logbuf->dq);
- return;
+ logbuf->eq = logbuf->dq = 0;
+ return -1;
}
if (logbuf->full) {
if (logbuf->flush_req)
logbuf->flush_req = 0;
}
+ return 0;
}
enum ipc_fw_loglevel ipc_logbuf_loglevel(enum ipc_fw_loglevel loglevel, int set)
void *ipc_logbuf_inbase(bool force);
void ipc_logbuf_flush_on(bool on);
bool ipc_logbuf_filled(void);
-void ipc_logbuf_outprint(struct runtimelog_buf *rt_buf, u32 loop);
+int ipc_logbuf_outprint(struct runtimelog_buf *rt_buf, u32 loop);
void ipc_logbuf_req_flush(struct logbuf_content *log);
void ipc_logbuf_set_req_num(struct logbuf_content *log);
struct logbuf_content *ipc_logbuf_get_curlogbuf(struct logbuf_content *log);