Commit a19b462f authored by Marc Zyngier's avatar Marc Zyngier

irqchip/gic-v3-its: Add post-mortem info on command timeout

If the ITS stops processing commands, we're pretty much toasted
as we cannot update the configuration anymore (and we're not
even sure that the ITS still translates interrups).

If that happens, let's dump some basic information about the
state of affairs before moving on.
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
parent 558b0165
...@@ -690,7 +690,7 @@ static void its_flush_cmd(struct its_node *its, struct its_cmd_block *cmd) ...@@ -690,7 +690,7 @@ static void its_flush_cmd(struct its_node *its, struct its_cmd_block *cmd)
dsb(ishst); dsb(ishst);
} }
static void its_wait_for_range_completion(struct its_node *its, static int its_wait_for_range_completion(struct its_node *its,
struct its_cmd_block *from, struct its_cmd_block *from,
struct its_cmd_block *to) struct its_cmd_block *to)
{ {
...@@ -713,12 +713,15 @@ static void its_wait_for_range_completion(struct its_node *its, ...@@ -713,12 +713,15 @@ static void its_wait_for_range_completion(struct its_node *its,
count--; count--;
if (!count) { if (!count) {
pr_err_ratelimited("ITS queue timeout\n"); pr_err_ratelimited("ITS queue timeout (%llu %llu %llu)\n",
return; from_idx, to_idx, rd_idx);
return -1;
} }
cpu_relax(); cpu_relax();
udelay(1); udelay(1);
} }
return 0;
} }
/* Warning, macro hell follows */ /* Warning, macro hell follows */
...@@ -754,7 +757,8 @@ post: \ ...@@ -754,7 +757,8 @@ post: \
next_cmd = its_post_commands(its); \ next_cmd = its_post_commands(its); \
raw_spin_unlock_irqrestore(&its->lock, flags); \ raw_spin_unlock_irqrestore(&its->lock, flags); \
\ \
its_wait_for_range_completion(its, cmd, next_cmd); \ if (its_wait_for_range_completion(its, cmd, next_cmd)) \
pr_err_ratelimited("ITS cmd %ps failed\n", builder); \
} }
static void its_build_sync_cmd(struct its_cmd_block *sync_cmd, static void its_build_sync_cmd(struct its_cmd_block *sync_cmd,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment