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

Commit c6ef3697 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "crypto: msm: Add DLKM support for crypto modules"

parents 1c0f1d30 465f5112
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
@@ -6105,6 +6105,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);

@@ -6138,6 +6139,7 @@ int qce_close(void *handle)
				pce_dev->coh_vmem, pce_dev->coh_pmem);
	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);
+10 −1
Original line number Diff line number Diff line
@@ -2077,11 +2077,14 @@ static int qcedev_probe_device(struct platform_device *pdev)
	podev->mem_client = NULL;

	misc_deregister(&podev->miscdevice);
	if (msm_bus_scale_client_update_request(podev->bus_scale_handle, 1))
		pr_err("%s Unable to set high bandwidth\n", __func__);
exit_qce_close:
	if (handle)
		qce_close(handle);
exit_scale_busbandwidth:
	msm_bus_scale_client_update_request(podev->bus_scale_handle, 0);
	if (msm_bus_scale_client_update_request(podev->bus_scale_handle, 0))
		pr_err("%s Unable to set low bandwidth\n", __func__);
exit_unregister_bus_scale:
	if (podev->platform_support.bus_scale_table != NULL)
		msm_bus_scale_unregister_client(podev->bus_scale_handle);
@@ -2111,9 +2114,15 @@ static int qcedev_remove(struct platform_device *pdev)
	podev = platform_get_drvdata(pdev);
	if (!podev)
		return 0;
	if (msm_bus_scale_client_update_request(podev->bus_scale_handle, 1))
		pr_err("%s Unable to set high bandwidth\n", __func__);

	if (podev->qce)
		qce_close(podev->qce);

	if (msm_bus_scale_client_update_request(podev->bus_scale_handle, 0))
		pr_err("%s Unable to set low bandwidth\n", __func__);

	if (podev->platform_support.bus_scale_table != NULL)
		msm_bus_scale_unregister_client(podev->bus_scale_handle);

+11 −5
Original line number Diff line number Diff line
/*
 * QTI Crypto driver
 *
 * Copyright (c) 2010-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2010-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
@@ -1354,10 +1354,6 @@ static void _qcrypto_remove_engine(struct crypto_engine *pengine)
	cancel_work_sync(&pengine->bw_allocate_ws);
	del_timer_sync(&pengine->bw_reaper_timer);

	if (pengine->bus_scale_handle != 0)
		msm_bus_scale_unregister_client(pengine->bus_scale_handle);
	pengine->bus_scale_handle = 0;

	kzfree(pengine->preq_pool);

	if (cp->total_units)
@@ -1388,8 +1384,18 @@ static int _qcrypto_remove(struct platform_device *pdev)
	mutex_lock(&cp->engine_lock);
	_qcrypto_remove_engine(pengine);
	mutex_unlock(&cp->engine_lock);

	if (msm_bus_scale_client_update_request(pengine->bus_scale_handle, 1))
		pr_err("%s Unable to set high bandwidth\n", __func__);

	if (pengine->qce)
		qce_close(pengine->qce);

	if (msm_bus_scale_client_update_request(pengine->bus_scale_handle, 0))
		pr_err("%s Unable to set low bandwidth\n", __func__);
	msm_bus_scale_unregister_client(pengine->bus_scale_handle);
	pengine->bus_scale_handle = 0;

	kzfree(pengine);
	return 0;
}