Commit b60e0886 authored by Cristian Marussi's avatar Cristian Marussi Committed by Sudeep Holla

firmware: arm_scmi: Use new SCMI full message tracing

Add full message tracing for all transmitted and successfully received SCMI
commands, replies and notifications.

Link: https://lore.kernel.org/r/20220630173135.2086631-3-cristian.marussi@arm.comSigned-off-by: default avatarCristian Marussi <cristian.marussi@arm.com>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent 2bd04670
...@@ -660,6 +660,11 @@ static void scmi_handle_notification(struct scmi_chan_info *cinfo, ...@@ -660,6 +660,11 @@ static void scmi_handle_notification(struct scmi_chan_info *cinfo,
smp_store_mb(xfer->priv, priv); smp_store_mb(xfer->priv, priv);
info->desc->ops->fetch_notification(cinfo, info->desc->max_msg_size, info->desc->ops->fetch_notification(cinfo, info->desc->max_msg_size,
xfer); xfer);
trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id, "NOTI",
xfer->hdr.seq, xfer->hdr.status,
xfer->rx.buf, xfer->rx.len);
scmi_notify(cinfo->handle, xfer->hdr.protocol_id, scmi_notify(cinfo->handle, xfer->hdr.protocol_id,
xfer->hdr.id, xfer->rx.buf, xfer->rx.len, ts); xfer->hdr.id, xfer->rx.buf, xfer->rx.len, ts);
...@@ -694,6 +699,12 @@ static void scmi_handle_response(struct scmi_chan_info *cinfo, ...@@ -694,6 +699,12 @@ static void scmi_handle_response(struct scmi_chan_info *cinfo,
smp_store_mb(xfer->priv, priv); smp_store_mb(xfer->priv, priv);
info->desc->ops->fetch_response(cinfo, xfer); info->desc->ops->fetch_response(cinfo, xfer);
trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id,
xfer->hdr.type == MSG_TYPE_DELAYED_RESP ?
"DLYD" : "RESP",
xfer->hdr.seq, xfer->hdr.status,
xfer->rx.buf, xfer->rx.len);
trace_scmi_rx_done(xfer->transfer_id, xfer->hdr.id, trace_scmi_rx_done(xfer->transfer_id, xfer->hdr.id,
xfer->hdr.protocol_id, xfer->hdr.seq, xfer->hdr.protocol_id, xfer->hdr.seq,
xfer->hdr.type); xfer->hdr.type);
...@@ -827,6 +838,12 @@ static int scmi_wait_for_message_response(struct scmi_chan_info *cinfo, ...@@ -827,6 +838,12 @@ static int scmi_wait_for_message_response(struct scmi_chan_info *cinfo,
xfer->state = SCMI_XFER_RESP_OK; xfer->state = SCMI_XFER_RESP_OK;
} }
spin_unlock_irqrestore(&xfer->lock, flags); spin_unlock_irqrestore(&xfer->lock, flags);
/* Trace polled replies. */
trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id,
"RESP",
xfer->hdr.seq, xfer->hdr.status,
xfer->rx.buf, xfer->rx.len);
} }
} else { } else {
/* And we wait for the response. */ /* And we wait for the response. */
...@@ -903,6 +920,10 @@ static int do_xfer(const struct scmi_protocol_handle *ph, ...@@ -903,6 +920,10 @@ static int do_xfer(const struct scmi_protocol_handle *ph,
return ret; return ret;
} }
trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id, "CMND",
xfer->hdr.seq, xfer->hdr.status,
xfer->tx.buf, xfer->tx.len);
ret = scmi_wait_for_message_response(cinfo, xfer); ret = scmi_wait_for_message_response(cinfo, xfer);
if (!ret && xfer->hdr.status) if (!ret && xfer->hdr.status)
ret = scmi_to_linux_errno(xfer->hdr.status); ret = scmi_to_linux_errno(xfer->hdr.status);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment