[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<AM9PR04MB86047361CA1E9AC521DB51DF95452@AM9PR04MB8604.eurprd04.prod.outlook.com>
Date: Tue, 15 Oct 2024 09:19:01 +0000
From: Pankaj Gupta <pankaj.gupta@....com>
To: Jonathan Corbet <corbet@....net>, Rob Herring <robh@...nel.org>, Krzysztof
Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Shawn Guo
<shawnguo@...nel.org>, Sascha Hauer <s.hauer@...gutronix.de>, Pengutronix
Kernel Team <kernel@...gutronix.de>, Fabio Estevam <festevam@...il.com>, Rob
Herring <robh+dt@...nel.org>
CC: "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"imx@...ts.linux.dev" <imx@...ts.linux.dev>,
"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>
Subject: RE: [PATCH v8 4/5] firmware: imx: add driver for NXP EdgeLock Enclave
diff --git a/drivers/firmware/imx/se_ctrl.c b/drivers/firmware/imx/se_ctrl.c
new file mode 100644 index 000000000000..37693c27042f
--- /dev/null
+++ b/drivers/firmware/imx/se_ctrl.c
+
+static void se_if_probe_cleanup(void *plat_dev) {
+ struct platform_device *pdev = plat_dev;
+ struct device *dev = &pdev->dev;
+ struct se_fw_load_info *load_fw;
+ struct se_if_priv *priv;
+
+ priv = dev_get_drvdata(dev);
+ load_fw = get_load_fw_instance(priv);
+
+ /* In se_if_request_channel(), passed the clean-up functional
+ * pointer reference as action to devm_add_action().
+ * No need to free the mbox channels here.
+ */
+
+ /* free the buffer in se remove, previously allocated
+ * in se probe to store encrypted IMEM
+ */
+ if (!load_fw && load_fw->imem.buf) {
This needs to be corrected to: if (load_fw && load_fw->imem.buf) {
Will correct in v9.
+ dmam_free_coherent(dev,
+ ELE_IMEM_SIZE,
+ load_fw->imem.buf,
+ load_fw->imem.phyaddr);
+ load_fw->imem.buf = NULL;
+ }
+
+ /* No need to check, if reserved memory is allocated
+ * before calling for its release. Or clearing the
+ * un-set bit.
+ */
+ of_reserved_mem_device_release(dev);
+}
+
+static int se_if_probe(struct platform_device *pdev) {
+ const struct se_if_node_info_list *info_list;
Download attachment "smime.p7s" of type "application/pkcs7-signature" (11094 bytes)
Powered by blists - more mailing lists