@@ -298,6 +298,7 @@ struct scmi_chan_info {
* @fetch_notification: Callback to fetch notification
* @clear_channel: Callback to clear a channel
* @poll_done: Callback to poll transfer status
+ * @drop_message: Optional callback when finished using msg_handle
*/
struct scmi_transport_ops {
int (*link_supplier)(struct device *dev);
@@ -315,6 +316,7 @@ struct scmi_transport_ops {
struct scmi_xfer *xfer, void *msg_handle);
void (*clear_channel)(struct scmi_chan_info *cinfo);
bool (*poll_done)(struct scmi_chan_info *cinfo, struct scmi_xfer *xfer);
+ void (*drop_message)(struct scmi_chan_info *cinfo, void *msg_handle);
};
int scmi_protocol_device_request(const struct scmi_device_id *id_table);
@@ -371,6 +371,7 @@ void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr,
{
u16 xfer_id = MSG_XTRACT_TOKEN(msg_hdr);
u8 msg_type = MSG_XTRACT_TYPE(msg_hdr);
+ struct scmi_info *info = handle_to_scmi_info(cinfo->handle);
switch (msg_type) {
case MSG_TYPE_NOTIFICATION:
@@ -384,6 +385,9 @@ void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr,
WARN_ONCE(1, "received unknown msg_type:%d\n", msg_type);
break;
}
+
+ if (info->desc->ops->drop_message)
+ info->desc->ops->drop_message(cinfo, msg_handle);
}
/**
The virtio transport will need to know when the core has finished using a message. Add a transport op that indicates this to scmi_rx_callback(). Do not address the polling case for now. Signed-off-by: Peter Hilber <peter.hilber@opensynergy.com> --- drivers/firmware/arm_scmi/common.h | 2 ++ drivers/firmware/arm_scmi/driver.c | 4 ++++ 2 files changed, 6 insertions(+)