lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210511002040.802226-9-peter.hilber@opensynergy.com>
Date:   Tue, 11 May 2021 02:20:36 +0200
From:   Peter Hilber <peter.hilber@...nsynergy.com>
To:     <linux-arm-kernel@...ts.infradead.org>,
        <devicetree@...r.kernel.org>
CC:     Peter Hilber <peter.hilber@...nsynergy.com>,
        Rob Herring <robh+dt@...nel.org>,
        <linux-kernel@...r.kernel.org>, <sudeep.holla@....com>,
        <souvik.chakravarty@....com>, <alex.bennee@...aro.org>,
        <jean-philippe@...aro.org>, <igor.skalkin@...nsynergy.com>,
        <mikhail.golubev@...nsynergy.com>,
        <anton.yakovlev@...nsynergy.com>,
        Vasyl Vavrychuk <Vasyl.Vavrychuk@...nsynergy.com>,
        Andriy Tryshnivskyy <Andriy.Tryshnivskyy@...nsynergy.com>,
        Cristian Marussi <cristian.marussi@....com>
Subject: [RFC PATCH v3 08/12] firmware: arm_scmi: Add optional drop_message() transport op

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@...nsynergy.com>
---
 drivers/firmware/arm_scmi/common.h | 2 ++
 drivers/firmware/arm_scmi/driver.c | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
index 5ab2ea0f7db2..51ee08bdcb0c 100644
--- a/drivers/firmware/arm_scmi/common.h
+++ b/drivers/firmware/arm_scmi/common.h
@@ -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);
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index cc27978b4bea..e04e7c8e6928 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -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);
 }
 
 /**
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ