summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Dooley <dooleyc@google.com>2022-03-04 01:35:23 +0000
committeryixuanjiang <yixuanjiang@google.com>2022-05-24 13:10:59 +0800
commit2dcebe0fda48ca1da24b5e8b499583ce163922a8 (patch)
tree18eda7022da665e822ef6dde6127b543563f0a7d
parentd84a0d8dfeea9c87169ed474b1a8382ef7f2895e (diff)
downloadaoc-2dcebe0fda48ca1da24b5e8b499583ce163922a8.tar.gz
Send a "crash" mailbox message to AoC during AP restart
Bug: 222458256 Signed-off-by: Craig Dooley <dooleyc@google.com> Change-Id: I4db45a9f97dfb916b1fe9c5724b01ac3fed175cd
-rw-r--r--aoc.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/aoc.c b/aoc.c
index 4f331db..e570bbb 100644
--- a/aoc.c
+++ b/aoc.c
@@ -187,6 +187,7 @@ struct sscd_info {
u16 seg_count;
};
+static void trigger_aoc_ramdump(struct aoc_prvdata *prvdata);
static void sscd_release(struct device *dev);
static struct sscd_info sscd_info;
@@ -1903,6 +1904,16 @@ static struct aoc_service_dev *create_service_device(struct aoc_prvdata *prvdata
return dev;
}
+static void trigger_aoc_ramdump(struct aoc_prvdata *prvdata)
+{
+ struct mbox_chan *channel = prvdata->mbox_channels[15].channel;
+ static const uint32_t command[] = { 0, 0, 0, 0, 0x0deada0c, 0, 0, 0 };
+
+ dev_notice(prvdata->dev, "Attempting to force AoC coredump\n");
+
+ mbox_send_message(channel, (void *)&command);
+}
+
static void signal_aoc(struct mbox_chan *channel)
{
#ifdef AOC_JUNO
@@ -2396,11 +2407,16 @@ static void aoc_watchdog(struct work_struct *work)
goto err_coredump;
}
+ /* If this was a true watchdog timeout, the AoC may still be running, so
+ * the coredump will not be written. Attempt to force a coredump by sending
+ * a death message to the AoC to trigger a failure.
+ */
+ trigger_aoc_ramdump(prvdata);
+
if (prvdata->ap_triggered_reset) {
prvdata->ap_triggered_reset = false;
snprintf(crash_info, RAMDUMP_SECTION_CRASH_INFO_SIZE - 1,
"AP Triggered Reset: %s", prvdata->ap_reset_reason);
- goto coredump_submit;
}
ramdump_timeout = jiffies + (5 * HZ);
@@ -2460,7 +2476,6 @@ static void aoc_watchdog(struct work_struct *work)
sscd_info.segs[0].vaddr = (void *)carveout_vaddr_from_aoc;
sscd_info.seg_count = 1;
-coredump_submit:
/*
* sscd_report() returns -EAGAIN if there are no readers to consume a
* coredump. Retry sscd_report() with a sleep to handle the race condition