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

Commit 259c6b70 authored by Channagoud Kadabi's avatar Channagoud Kadabi
Browse files

soc: qcom: llcc: Update the active/deactive status check



There are multiple LLCC instances in the hw and the status of activation or
deactivation from each LLCC instance is OR'ed for broadcast reads.
Whenever a slice is activated the active status of the broadcast is set
immidiately when one of the many LLCC instances finishes activation of
the slice. Concluding on activation as complete based on the broadcast read
may not be correct. Instead of polling on active status after activation
poll on the deactive status. So the deactive status will become 0 whenever
all the slices are active and vice versa for deactivate usecase.

Change-Id: I539008137de071ab5705560ef0795766172da32a
Signed-off-by: default avatarChannagoud Kadabi <ckadabi@codeaurora.org>
parent 4480aa05
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2017, 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
@@ -190,7 +190,7 @@ static int llcc_update_act_ctrl(struct llcc_drv_data *drv, u32 sid,
	timeout = jiffies + usecs_to_jiffies(LLCC_STATUS_READ_DELAY);
	while (time_before(jiffies, timeout)) {
		regmap_read(drv->llcc_map, status_reg, &slice_status);
		if (slice_status & status)
		if (!(slice_status & status))
			return 0;
	}

@@ -231,7 +231,7 @@ int llcc_slice_activate(struct llcc_slice_desc *desc)
	act_ctrl_val |= ACT_CTRL_ACT_TRIG;

	rc = llcc_update_act_ctrl(drv, desc->llcc_slice_id, act_ctrl_val,
				  ACTIVATE);
				  DEACTIVATE);

	__set_bit(desc->llcc_slice_id, drv->llcc_slice_map);
	mutex_unlock(&drv->slice_mutex);
@@ -273,7 +273,7 @@ int llcc_slice_deactivate(struct llcc_slice_desc *desc)
	act_ctrl_val |= ACT_CTRL_ACT_TRIG;

	rc = llcc_update_act_ctrl(drv, desc->llcc_slice_id, act_ctrl_val,
				  DEACTIVATE);
				  ACTIVATE);

	__clear_bit(desc->llcc_slice_id, drv->llcc_slice_map);
	mutex_unlock(&drv->slice_mutex);