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

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

Merge "drivers: mailbox: rpmh: Enhance debug logs"

parents 124e4981 4460cd9b
Loading
Loading
Loading
Loading
+22 −2
Original line number Diff line number Diff line
/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-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
@@ -128,6 +128,7 @@ struct rsc_drv {
	const char *name;
	void __iomem *base; /* start address of the RSC's registers */
	void __iomem *reg_base; /* start address for DRV specific register */
	int irq;
	int drv_id;
	struct platform_device *pdev;
	struct tcs_mbox tcs[TCS_TYPE_NR];
@@ -877,6 +878,8 @@ static void dump_tcs_stats(struct rsc_drv *drv)
{
	int i;
	unsigned long long curr = arch_counter_get_cntvct();
	struct irq_data *rsc_irq_data = irq_get_irq_data(drv->irq);
	bool irq_sts;

	for (i = 0; i < drv->num_tcs; i++) {
		if (!atomic_read(&drv->tcs_in_use[i]))
@@ -890,6 +893,20 @@ static void dump_tcs_stats(struct rsc_drv *drv)
		print_tcs_regs(drv, i);
		print_response(drv, i);
	}

	if (rsc_irq_data) {
		irq_get_irqchip_state(drv->irq, IRQCHIP_STATE_PENDING,
								&irq_sts);
		pr_warn("HW IRQ %lu is %s at GIC\n", rsc_irq_data->hwirq,
					irq_sts ? "PENDING" : "NOT PENDING");
	}

	if (test_bit(TASKLET_STATE_SCHED, &drv->tasklet.state))
		pr_warn("Tasklet is scheduled for execution\n");
	else if (test_bit(TASKLET_STATE_RUN, &drv->tasklet.state))
		pr_warn("Tasklet is running\n");
	else
		pr_warn("Tasklet is not active\n");
}

static void chan_debug(struct mbox_chan *chan)
@@ -979,7 +996,8 @@ static int chan_tcs_write(struct mbox_chan *chan, void *data)

	/* If we were just busy waiting for TCS, dump the state and return */
	if (ret == -EBUSY) {
		pr_info_ratelimited("TCS Busy, retrying RPMH message send\n");
		dev_err_ratelimited(chan->cl->dev,
				"TCS Busy, retrying RPMH message send\n");
		ret = -EAGAIN;
	}

@@ -1258,6 +1276,8 @@ static int rsc_drv_probe(struct platform_device *pdev)
	if (ret)
		return ret;

	drv->irq = irq;

	/* Enable interrupts for AMC TCS */
	write_tcs_reg(drv->reg_base, RSC_DRV_IRQ_ENABLE, 0, 0,
					drv->tcs[ACTIVE_TCS].tcs_mask);