Skip to content

Commit 5c43ed8

Browse files
Siddharth Guptaandersson
authored andcommitted
remoteproc: qcom: Add full coredump fallback mechanism
If a remoteproc's firmware does not support minidump but the driver adds an ID, the minidump driver does not collect any coredumps when the remoteproc crashes. This hinders the purpose of coredump collection. This change adds a fallback mechanism in the event of a crash. Signed-off-by: Siddharth Gupta <[email protected]> Signed-off-by: Gokul krishna Krishnakumar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent f247f08 commit 5c43ed8

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

drivers/remoteproc/qcom_common.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,21 @@ void qcom_minidump(struct rproc *rproc, unsigned int minidump_id,
168168
*/
169169
if (subsystem->regions_baseptr == 0 ||
170170
le32_to_cpu(subsystem->status) != 1 ||
171-
le32_to_cpu(subsystem->enabled) != MD_SS_ENABLED ||
172-
le32_to_cpu(subsystem->encryption_status) != MD_SS_ENCR_DONE) {
171+
le32_to_cpu(subsystem->enabled) != MD_SS_ENABLED) {
172+
return rproc_coredump(rproc);
173+
}
174+
175+
if (le32_to_cpu(subsystem->encryption_status) != MD_SS_ENCR_DONE) {
173176
dev_err(&rproc->dev, "Minidump not ready, skipping\n");
174177
return;
175178
}
176179

180+
/**
181+
* Clear out the dump segments populated by parse_fw before
182+
* re-populating them with minidump segments.
183+
*/
184+
rproc_coredump_cleanup(rproc);
185+
177186
ret = qcom_add_minidump_segments(rproc, subsystem, rproc_dumpfn_t);
178187
if (ret) {
179188
dev_err(&rproc->dev, "Failed with error: %d while adding minidump entries\n", ret);

drivers/remoteproc/qcom_q6v5_pas.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ static const struct rproc_ops adsp_minidump_ops = {
426426
.start = adsp_start,
427427
.stop = adsp_stop,
428428
.da_to_va = adsp_da_to_va,
429+
.parse_fw = qcom_register_dump_segments,
429430
.load = adsp_load,
430431
.panic = adsp_panic,
431432
.coredump = adsp_minidump,

0 commit comments

Comments
 (0)