soc: qcom: crm: Add IPC logging

Add IPC logging for caching and writing various power states along
with channel switch and completion IRQ logging.

Change-Id: I4b7d263258b1228fcea1b7c2339e3c7cdf6dde8b
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
This commit is contained in:
Maulik Shah 2022-11-18 10:47:14 +05:30 committed by Gerrit - the friendly Code Review server
parent 88f0bf1775
commit 040f2a75d1

View File

@ -404,6 +404,7 @@ int crm_channel_switch_complete(const struct crm_drv *drv, u32 ch)
ret = -EBUSY;
trace_crm_switch_channel(drv->name, ch, ret);
ipc_log_string(drv->ipc_log_ctx, "Switch Channel: ch: %u ret: %d", ch, ret);
return ret;
}
@ -462,6 +463,9 @@ static void crm_flush_cache(struct crm_drv *drv, struct crm_vcd *vcd, u32 ch, u3
reg = crm_get_pwr_state_reg(j);
write_crm_reg(drv, reg, ch, vcd_type, i, vcd->cache[i][j]);
trace_crm_write_vcd_votes(drv->name, vcd_type, i, j, vcd->cache[i][j]);
ipc_log_string(drv->ipc_log_ctx,
"Flush: type: %u resource_idx:%u pwr_state: %u data: %#x",
vcd_type, i, j, vcd->cache[i][j]);
}
}
}
@ -558,6 +562,9 @@ static irqreturn_t crm_vote_complete_irq(int irq, void *p)
write_crm_reg(drv, IRQ_CLEAR, 0, j, k, IRQ_CLEAR_BIT);
trace_crm_irq(drv->name, j, k, irq_status);
ipc_log_string(drv->ipc_log_ctx,
"IRQ: type: %u resource_idx:%u irq_status: %lu"
, j, k, irq_status);
votes = &vcd->sw_votes[k];
if (!votes->in_progress) {
@ -648,6 +655,9 @@ static int crm_send_cmd(struct crm_drv *drv, u32 vcd_type, const struct crm_cmd
spin_unlock_irqrestore(&drv->lock, flags);
trace_crm_write_vcd_votes(drv->name, vcd_type, resource_idx, pwr_state, data);
ipc_log_string(drv->ipc_log_ctx,
"Write: type: %u resource_idx:%u pwr_state: %u data: %#x",
vcd_type, resource_idx, pwr_state, data);
if (compl && wait) {
time_left = CRM_TIMEOUT_MS;
@ -678,6 +688,10 @@ static void crm_cache_vcd_votes(struct crm_drv *drv, u32 vcd_type, const struct
spin_unlock(&drv->cache_lock);
trace_crm_cache_vcd_votes(drv->name, vcd_type, resource_idx, pwr_state, data);
ipc_log_string(drv->ipc_log_ctx,
"Cache: type: %u resource_idx:%u pwr_state: %u data: %#x",
vcd_type, resource_idx, pwr_state, data);
}
static bool crm_is_invalid_cmd(struct crm_drv *drv, u32 vcd_type, const struct crm_cmd *cmd)