diff options
author | Siddharth Gupta <sidgup@codeaurora.org> | 2023-02-24 13:17:07 -0800 |
---|---|---|
committer | Bjorn Andersson <andersson@kernel.org> | 2023-07-15 12:56:49 -0700 |
commit | 5c43ed8ad20b29c89991c03d4c84afb9c53608a3 (patch) | |
tree | ce89a05d97251b57aa1f1c460139248dd98e9af4 /drivers/remoteproc/qcom_common.c | |
parent | f247f08da0ce822de0d6b2feec811dd6d4d599ce (diff) |
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 <sidgup@codeaurora.org>
Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
Link: https://lore.kernel.org/r/20230224211707.30916-3-quic_gokukris@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Diffstat (limited to 'drivers/remoteproc/qcom_common.c')
-rw-r--r-- | drivers/remoteproc/qcom_common.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c index a0d4238492e9..4bbb47dda05e 100644 --- a/drivers/remoteproc/qcom_common.c +++ b/drivers/remoteproc/qcom_common.c @@ -168,12 +168,21 @@ void qcom_minidump(struct rproc *rproc, unsigned int minidump_id, */ if (subsystem->regions_baseptr == 0 || le32_to_cpu(subsystem->status) != 1 || - le32_to_cpu(subsystem->enabled) != MD_SS_ENABLED || - le32_to_cpu(subsystem->encryption_status) != MD_SS_ENCR_DONE) { + le32_to_cpu(subsystem->enabled) != MD_SS_ENABLED) { + return rproc_coredump(rproc); + } + + if (le32_to_cpu(subsystem->encryption_status) != MD_SS_ENCR_DONE) { dev_err(&rproc->dev, "Minidump not ready, skipping\n"); return; } + /** + * Clear out the dump segments populated by parse_fw before + * re-populating them with minidump segments. + */ + rproc_coredump_cleanup(rproc); + ret = qcom_add_minidump_segments(rproc, subsystem, rproc_dumpfn_t); if (ret) { dev_err(&rproc->dev, "Failed with error: %d while adding minidump entries\n", ret); |