summaryrefslogtreecommitdiff
path: root/drivers/dma/fsl-dpaa2-qdma/dpdmai.c
diff options
context:
space:
mode:
authorPeng Ma <peng.ma@nxp.com>2020-02-27 07:28:41 +0300
committerVinod Koul <vkoul@kernel.org>2020-03-02 12:26:22 +0300
commit3e0ca3c38dc2ff5424eefa01a3a91cc9c0f65f5a (patch)
tree4d3737e4e113369258f1d538d01f818e454359fe /drivers/dma/fsl-dpaa2-qdma/dpdmai.c
parent667b9251440b762ebc8cd3348a6e6ab29401bb97 (diff)
downloadlinux-3e0ca3c38dc2ff5424eefa01a3a91cc9c0f65f5a.tar.xz
dmaengine: fsl-dpaa2-qdma: Adding shutdown hook
We need to ensure DMA engine could be stopped in order for kexec to start the next kernel. So add the shutdown operation support. Signed-off-by: Peng Ma <peng.ma@nxp.com> Link: https://lore.kernel.org/r/20200227042841.18358-1-peng.ma@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/fsl-dpaa2-qdma/dpdmai.c')
-rw-r--r--drivers/dma/fsl-dpaa2-qdma/dpdmai.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/dma/fsl-dpaa2-qdma/dpdmai.c b/drivers/dma/fsl-dpaa2-qdma/dpdmai.c
index f8d22115154a..878662aaa1c2 100644
--- a/drivers/dma/fsl-dpaa2-qdma/dpdmai.c
+++ b/drivers/dma/fsl-dpaa2-qdma/dpdmai.c
@@ -160,6 +160,27 @@ int dpdmai_create(struct fsl_mc_io *mc_io, u32 cmd_flags,
}
/**
+ * dpdmai_destroy() - Destroy the DPDMAI object and release all its resources.
+ * @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token: Token of DPDMAI object
+ *
+ * Return: '0' on Success; error code otherwise.
+ */
+int dpdmai_destroy(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token)
+{
+ struct fsl_mc_command cmd = { 0 };
+
+ /* prepare command */
+ cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_DESTROY,
+ cmd_flags, token);
+
+ /* send command to mc*/
+ return mc_send_command(mc_io, &cmd);
+}
+EXPORT_SYMBOL_GPL(dpdmai_destroy);
+
+/**
* dpdmai_enable() - Enable the DPDMAI, allow sending and receiving frames.
* @mc_io: Pointer to MC portal's I/O object
* @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'