linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] irqchip/gic-v3-its: BUG_ON if stall bit is set
@ 2023-12-07  6:12 Mukesh Ojha
  2023-12-07  7:43 ` Marc Zyngier
  0 siblings, 1 reply; 2+ messages in thread
From: Mukesh Ojha @ 2023-12-07  6:12 UTC (permalink / raw)
  To: maz, tglx; +Cc: linux-arm-kernel, linux-kernel, Mukesh Ojha

There could be various reason that stall bit could
be set due to software errors while processing
commands in command queue is being processed and
waiting for 1s is not going to help in debugging
as command processing anyways going to be timed
out and system will continue to run and may crash
after some time due to this.

So, to debug such issues what command caused the
stall bit to set, BUG_ON right away.

Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
---
 drivers/irqchip/irq-gic-v3-its.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 9a7a74239eab..8983e0a3318c 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -1078,6 +1078,11 @@ static int its_wait_for_range_completion(struct its_node *its,
 		s64 delta;
 
 		rd_idx = readl_relaxed(its->base + GITS_CREADR);
+		/*
+		 * Check for stall bit as there is no point in waiting
+		 * for 1s if the stall bit is already set.
+		 */
+		BUG_ON(rd_idx & 1);
 
 		/*
 		 * Compute the read pointer progress, taking the
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] irqchip/gic-v3-its: BUG_ON if stall bit is set
  2023-12-07  6:12 [PATCH] irqchip/gic-v3-its: BUG_ON if stall bit is set Mukesh Ojha
@ 2023-12-07  7:43 ` Marc Zyngier
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Zyngier @ 2023-12-07  7:43 UTC (permalink / raw)
  To: Mukesh Ojha; +Cc: tglx, linux-arm-kernel, linux-kernel

On Thu, 07 Dec 2023 06:12:39 +0000,
Mukesh Ojha <quic_mojha@quicinc.com> wrote:
> 
> There could be various reason that stall bit could
> be set due to software errors while processing
> commands in command queue is being processed and

Such as?

> waiting for 1s is not going to help in debugging
> as command processing anyways going to be timed
> out and system will continue to run and may crash
> after some time due to this.
> 
> So, to debug such issues what command caused the
> stall bit to set, BUG_ON right away.

How on Earth will killing the system allow *anything* to be further
debugged?

If you need debug information, add the correct debug statements using
pr_debug(). Even better, try to gracefully recover from it if the ITS
command queue supports restarting.

Crashing the system is not an option.

	M.

-- 
Without deviation from the norm, progress is not possible.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-07  7:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-07  6:12 [PATCH] irqchip/gic-v3-its: BUG_ON if stall bit is set Mukesh Ojha
2023-12-07  7:43 ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).