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

Commit ac193569 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "crypto: msm: Update qce_close to make bandwidth request"

parents 8fe53e48 ed091d1a
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -2080,7 +2080,7 @@ static int qcedev_probe_device(struct platform_device *pdev)
	podev->mem_client = qcedev_mem_new_client(MEM_ION);
	if (!podev->mem_client) {
		pr_err("%s: err: qcedev_mem_new_client failed\n", __func__);
		goto exit_qce_close;
		goto exit_qce_req_bw;
	}

	rc = of_platform_populate(pdev->dev.of_node, qcedev_match,
@@ -2097,12 +2097,15 @@ static int qcedev_probe_device(struct platform_device *pdev)
	if (podev->mem_client)
		qcedev_mem_delete_client(podev->mem_client);
	podev->mem_client = NULL;

exit_qce_req_bw:
	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);
@@ -2141,9 +2144,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);
	tasklet_kill(&podev->done_tasklet);
+14 −6
Original line number Diff line number Diff line
/*
 * QTI Crypto driver
 *
 * Copyright (c) 2010-2018, 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,19 @@ 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;
}
@@ -5312,7 +5319,8 @@ static int _qcrypto_probe(struct platform_device *pdev)
	if (pengine->qce)
		qce_close(pengine->qce);
exit_free_pdata:
	msm_bus_scale_client_update_request(pengine->bus_scale_handle, 0);
	if (msm_bus_scale_client_update_request(pengine->bus_scale_handle, 0))
		pr_err("%s Unable to set low bandwidth\n", __func__);
	platform_set_drvdata(pdev, NULL);
exit_kzfree:
	kzfree(pengine);