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

Commit 5d7eae8a authored by Praneeth Paladugu's avatar Praneeth Paladugu Committed by Vikash Garodia
Browse files

msm: vidc: Check clocks state before Venus AXI halt



Venus AXI registers need venus VBIF clock. Without clock,
the register access may cause unknown behavior. Hence
check the clock state before accessing the register.

CRs-Fixed: 772609
Change-Id: I86fe8e85e497d0534b63d4a8af22e2f0c3b84659
Signed-off-by: default avatarPraneeth Paladugu <ppaladug@codeaurora.org>
parent aa7b16b7
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, 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
@@ -1458,6 +1458,15 @@ static int venus_hfi_halt_axi(struct venus_hfi_device *device)
		dprintk(VIDC_ERR, "Invalid input: %p\n", device);
		return -EINVAL;
	}
	/*
	 * Driver needs to make sure that clocks are enabled to read Venus AXI
	 * registers. If not skip AXI HALT.
	 */
	if (device->clk_state != ENABLED_PREPARED) {
		dprintk(VIDC_WARN,
			"Clocks are OFF, skipping AXI HALT\n");
		return -EINVAL;
	}

	/* Halt AXI and AXI OCMEM VBIF Access */
	reg = venus_hfi_read_register(device, VENUS_VBIF_AXI_HALT_CTRL0);