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

Commit 1bbccd2f authored by Pratik Patel's avatar Pratik Patel
Browse files

coresight: add support for cti save disable



Add support to disable CTI save and restore to avoid voting for
CTI clock during probe as well as the associated save and restore
latency at the cost of breaking cpu CTI support on targets where
cpu CTIs have to be preserved across power collapse.

This allows for low overhead CTI support where cpu CTI usage is
not required but the target requires cpu CTIs to be preserved
across power collapse.

Change-Id: I0545d3442d1d6b2f707da7f56d029a7df2f7cae9
Signed-off-by: default avatarPratik Patel <pratikp@codeaurora.org>
parent 2a9c456e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -49,6 +49,16 @@ config CORESIGHT_CTI
	  hardware component to another. It can also be used to pass
	  software generated events.

config CORESIGHT_CTI_SAVE_DISABLE
	bool "Turn off CTI save and restore"
	help
	  Turns off CoreSight CTI save and restore support for cpu CTIs. This
	  avoids voting for the clocks during probe as well as the associated
	  save and restore latency at the cost of breaking cpu CTI support on
	  targets where cpu CTIs have to be preserved across power collapse.

	  If unsure, say 'N' here to avoid breaking cpu CTI support.

config CORESIGHT_CSR
	bool "CoreSight Slave Register driver"
	help
+22 −1
Original line number Diff line number Diff line
@@ -102,6 +102,11 @@ struct cti_drvdata {

static LIST_HEAD(cti_list);
static DEFINE_MUTEX(cti_lock);
#ifdef CONFIG_CORESIGHT_CTI_SAVE_DISABLE
static int cti_save_disable = 1;
#else
static int cti_save_disable;
#endif

static int cti_verify_trigger_bound(int trig)
{
@@ -134,6 +139,14 @@ void coresight_cti_ctx_save(void)
	int trig, cpuid, cpu;
	unsigned long flag;

	/*
	 * Explicitly check and return to avoid latency associated with
	 * traversing the linked list of all CTIs and checking for their
	 * respective cti_save flag.
	 */
	if (cti_save_disable)
		return;

	cpu = raw_smp_processor_id();

	list_for_each_entry(cti, &cti_list, link) {
@@ -170,6 +183,14 @@ void coresight_cti_ctx_restore(void)
	int trig, cpuid, cpu;
	unsigned long flag;

	/*
	 * Explicitly check and return to avoid latency associated with
	 * traversing the linked list of all CTIs and checking for their
	 * respective cti_save flag.
	 */
	if (cti_save_disable)
		return;

	cpu = raw_smp_processor_id();

	list_for_each_entry(cti, &cti_list, link) {
@@ -1378,7 +1399,7 @@ static int cti_probe(struct platform_device *pdev)
		}
	}

	if (pdev->dev.of_node)
	if (pdev->dev.of_node && !cti_save_disable)
		drvdata->cti_save = of_property_read_bool(pdev->dev.of_node,
							  "qcom,cti-save");
	if (drvdata->cti_save) {