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

Commit 24ed3c0f authored by Maulik Shah's avatar Maulik Shah
Browse files

soc: qcom: rpmh: Add completion status to rpmh debug information



Linux kernel lockup case can be either due to RSC interrupt
pending at GIC unable to service or due to completion did not
get a chance to run and finish.

Currently rpmh debug only prints pending IRQ status at GIC.
Add completion status as well to rpmh debug information.

Change-Id: Iaee639f744be19c2cffb701547623c19bdabfb30
Signed-off-by: default avatarMaulik Shah <mkshah@codeaurora.org>
parent 02b56508
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 */


#ifndef __RPM_INTERNAL_H__
#define __RPM_INTERNAL_H__

@@ -124,5 +123,5 @@ void rpmh_rsc_mode_solver_set(struct rsc_drv *drv, bool enable);

void rpmh_tx_done(const struct tcs_request *msg, int r);

void rpmh_rsc_debug(struct rsc_drv *drv);
void rpmh_rsc_debug(struct rsc_drv *drv, struct completion *compl);
#endif /* __RPM_INTERNAL_H__ */
+4 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 */

#define pr_fmt(fmt) "%s " fmt, KBUILD_MODNAME
@@ -692,7 +692,7 @@ static void print_tcs_info(struct rsc_drv *drv, int tcs_id, unsigned long *accl)
	}
}

void rpmh_rsc_debug(struct rsc_drv *drv)
void rpmh_rsc_debug(struct rsc_drv *drv, struct completion *compl)
{
	struct irq_data *rsc_irq_data = irq_get_irq_data(drv->irq);
	bool irq_sts;
@@ -718,6 +718,8 @@ void rpmh_rsc_debug(struct rsc_drv *drv)
	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");
	pr_warn("Completion is %s to finish\n",
		completion_done(compl) ? "PENDING" : "NOT PENDING");

	for_each_set_bit(i, &accl, ARRAY_SIZE(accl_str)) {
		strlcat(str, accl_str[i], sizeof(str));
+3 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/atomic.h>
@@ -336,7 +336,7 @@ int rpmh_write(const struct device *dev, enum rpmh_state state,

	ret = wait_for_completion_timeout(&compl, RPMH_TIMEOUT_MS);
	if (!ret) {
		rpmh_rsc_debug(ctrlr_to_drv(ctrlr));
		rpmh_rsc_debug(ctrlr_to_drv(ctrlr), &compl);
		return -ETIMEDOUT;
	}

@@ -477,7 +477,7 @@ int rpmh_write_batch(const struct device *dev, enum rpmh_state state,
			 * the completion that we're going to free once
			 * we've returned from this function.
			 */
			rpmh_rsc_debug(ctrlr_to_drv(ctrlr));
			rpmh_rsc_debug(ctrlr_to_drv(ctrlr), &compls[i]);
			ret = -ETIMEDOUT;
			goto exit;
		}