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

Commit 038109f1 authored by AnilKumar Chimata's avatar AnilKumar Chimata
Browse files

crypto: qce50: Fix unclocked access in unbind path



In unbind path crypto registers are accessed even if clocks are
disabled which results unclocked access to crypto register, this
patch fixes the same.

Change-Id: Ie56d4f2f0d4118e7d8efbd81b6aa128b1708e74b
Signed-off-by: default avatarAnilKumar Chimata <anilc@codeaurora.org>
parent cebe1742
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
/*
 * QTI Crypto Engine driver.
 *
 * Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2018, 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
@@ -6118,12 +6118,14 @@ EXPORT_SYMBOL(qce_open);
int qce_close(void *handle)
{
	struct qce_device *pce_dev = (struct qce_device *) handle;
	int ret = -1;

	if (handle == NULL)
		return -ENODEV;

	mutex_lock(&qce_iomap_mutex);
	qce_enable_clk(pce_dev);
	ret = qce_enable_clk(pce_dev);
	if (!ret)
		qce_sps_exit(pce_dev);

	if (pce_dev->iobase)
@@ -6137,6 +6139,7 @@ int qce_close(void *handle)
	if (pce_dev->enable_s1_smmu)
		qce_iommu_release_iomapping(pce_dev);

	if (!ret)
		qce_disable_clk(pce_dev);
	__qce_deinit_clk(pce_dev);
	mutex_unlock(&qce_iomap_mutex);