Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 892ad60d authored by Anmolpreet Kaur's avatar Anmolpreet Kaur Committed by Gerrit - the friendly Code Review server
Browse files

crypto: msm: Detach qce driver on unloading



On closing the driver or unloading the driver,
it should be detached from the corresponding
iommu mappings to avoid smmu attach errors on
module re-loading.

Change-Id: Ia05233c748527eea18ed2d95d87bc4953ef9c0a1
Signed-off-by: default avatarAnmolpreet Kaur <anmolpre@codeaurora.org>
parent 3a278b80
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/*
 * QTI Crypto Engine driver.
 *
 * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -6125,6 +6125,7 @@ void *qce_open(struct platform_device *pdev, int *rc)
		dma_free_coherent(pce_dev->pdev, pce_dev->memsize,
			pce_dev->coh_vmem, pce_dev->coh_pmem);
err_iobase:
	arm_iommu_detach_device(pce_dev->pdev);
	if (pce_dev->enable_s1_smmu)
		qce_iommu_release_iomapping(pce_dev);

@@ -6157,6 +6158,7 @@ int qce_close(void *handle)
	kfree(pce_dev->dummyreq_in_buf);
	kfree(pce_dev->iovec_vmem);

	arm_iommu_detach_device(pce_dev->pdev);
	if (pce_dev->enable_s1_smmu)
		qce_iommu_release_iomapping(pce_dev);