From 6bcbd9920b2a8f701c126df04297f51e0a8e6c04 Mon Sep 17 00:00:00 2001 From: Maulik Shah Date: Wed, 12 Feb 2020 14:49:11 +0530 Subject: [PATCH] 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: Maulik Shah --- drivers/soc/qcom/rpmh-internal.h | 4 ++-- drivers/soc/qcom/rpmh-rsc.c | 6 ++++-- drivers/soc/qcom/rpmh.c | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/soc/qcom/rpmh-internal.h b/drivers/soc/qcom/rpmh-internal.h index afcffc301a86f..9d5db1297405d 100644 --- a/drivers/soc/qcom/rpmh-internal.h +++ b/drivers/soc/qcom/rpmh-internal.h @@ -1,5 +1,5 @@ /* 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. */ #ifndef __RPM_INTERNAL_H__ #define __RPM_INTERNAL_H__ @@ -123,5 +123,5 @@ int rpmh_rsc_write_pdc_data(struct rsc_drv *drv, const struct tcs_request *msg); 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__ */ diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c index bf57fbcaacb8f..9e571616157ff 100644 --- a/drivers/soc/qcom/rpmh-rsc.c +++ b/drivers/soc/qcom/rpmh-rsc.c @@ -1,5 +1,5 @@ // 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 @@ -708,7 +708,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; @@ -734,6 +734,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)); diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c index c77d9303f68e5..671486d937aad 100644 --- a/drivers/soc/qcom/rpmh.c +++ b/drivers/soc/qcom/rpmh.c @@ -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; } @@ -480,7 +480,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; }