From: Siddharth Gupta <sidgup@codeaurora.org> To: agross@kernel.org, bjorn.andersson@linaro.org, ohad@wizery.com, linux-remoteproc@vger.kernel.org Cc: Siddharth Gupta <sidgup@codeaurora.org>, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tsoni@codeaurora.org, psodagud@codeaurora.org, rishabhb@codeaurora.org, linux-doc@vger.kernel.org, Gurbir Arora <gurbaror@codeaurora.org> Subject: [PATCH v5 1/3] remoteproc: core: Add ops to enable custom coredump functionality Date: Thu, 24 Sep 2020 16:51:26 -0700 [thread overview] Message-ID: <1600991488-17877-2-git-send-email-sidgup@codeaurora.org> (raw) In-Reply-To: <1600991488-17877-1-git-send-email-sidgup@codeaurora.org> Each remoteproc might have different requirements for coredumps and might want to choose the type of dumps it wants to collect. This change allows remoteproc drivers to specify their own custom dump function to be executed in place of rproc_coredump. If the coredump op is not specified by the remoteproc driver it will be set to rproc_coredump by default.The priv_cleanup op cleans up the private resources used by the remoteproc. Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org> Signed-off-by: Gurbir Arora <gurbaror@codeaurora.org> Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org> --- drivers/remoteproc/remoteproc_core.c | 6 +++++- include/linux/remoteproc.h | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 7f90eee..dcc1341 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1681,7 +1681,7 @@ int rproc_trigger_recovery(struct rproc *rproc) goto unlock_mutex; /* generate coredump */ - rproc_coredump(rproc); + rproc->ops->coredump(rproc); /* load firmware */ ret = request_firmware(&firmware_p, rproc->firmware, dev); @@ -2103,6 +2103,10 @@ static int rproc_alloc_ops(struct rproc *rproc, const struct rproc_ops *ops) if (!rproc->ops) return -ENOMEM; + /* Default to rproc_coredump if no coredump function is specified */ + if (!rproc->ops->coredump) + rproc->ops->coredump = rproc_coredump; + if (rproc->ops->load) return 0; diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 2fa68bf..a489aec 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -375,6 +375,8 @@ enum rsc_handling_status { * @get_boot_addr: get boot address to entry point specified in firmware * @panic: optional callback to react to system panic, core will delay * panic at least the returned number of milliseconds + * @coredump: collect firmware dump after the subsystem is shutdown + * @priv_cleanup: cleans up the private resources used by the rproc */ struct rproc_ops { int (*prepare)(struct rproc *rproc); @@ -393,6 +395,8 @@ struct rproc_ops { int (*sanity_check)(struct rproc *rproc, const struct firmware *fw); u64 (*get_boot_addr)(struct rproc *rproc, const struct firmware *fw); unsigned long (*panic)(struct rproc *rproc); + void (*coredump)(struct rproc *rproc); + void (*priv_cleanup)(struct rproc *rproc); }; /** -- Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
WARNING: multiple messages have this Message-ID (diff)
From: Siddharth Gupta <sidgup@codeaurora.org> To: agross@kernel.org, bjorn.andersson@linaro.org, ohad@wizery.com, linux-remoteproc@vger.kernel.org Cc: tsoni@codeaurora.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, Gurbir Arora <gurbaror@codeaurora.org>, linux-kernel@vger.kernel.org, rishabhb@codeaurora.org, Siddharth Gupta <sidgup@codeaurora.org>, psodagud@codeaurora.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 1/3] remoteproc: core: Add ops to enable custom coredump functionality Date: Thu, 24 Sep 2020 16:51:26 -0700 [thread overview] Message-ID: <1600991488-17877-2-git-send-email-sidgup@codeaurora.org> (raw) In-Reply-To: <1600991488-17877-1-git-send-email-sidgup@codeaurora.org> Each remoteproc might have different requirements for coredumps and might want to choose the type of dumps it wants to collect. This change allows remoteproc drivers to specify their own custom dump function to be executed in place of rproc_coredump. If the coredump op is not specified by the remoteproc driver it will be set to rproc_coredump by default.The priv_cleanup op cleans up the private resources used by the remoteproc. Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org> Signed-off-by: Gurbir Arora <gurbaror@codeaurora.org> Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org> --- drivers/remoteproc/remoteproc_core.c | 6 +++++- include/linux/remoteproc.h | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 7f90eee..dcc1341 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1681,7 +1681,7 @@ int rproc_trigger_recovery(struct rproc *rproc) goto unlock_mutex; /* generate coredump */ - rproc_coredump(rproc); + rproc->ops->coredump(rproc); /* load firmware */ ret = request_firmware(&firmware_p, rproc->firmware, dev); @@ -2103,6 +2103,10 @@ static int rproc_alloc_ops(struct rproc *rproc, const struct rproc_ops *ops) if (!rproc->ops) return -ENOMEM; + /* Default to rproc_coredump if no coredump function is specified */ + if (!rproc->ops->coredump) + rproc->ops->coredump = rproc_coredump; + if (rproc->ops->load) return 0; diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 2fa68bf..a489aec 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -375,6 +375,8 @@ enum rsc_handling_status { * @get_boot_addr: get boot address to entry point specified in firmware * @panic: optional callback to react to system panic, core will delay * panic at least the returned number of milliseconds + * @coredump: collect firmware dump after the subsystem is shutdown + * @priv_cleanup: cleans up the private resources used by the rproc */ struct rproc_ops { int (*prepare)(struct rproc *rproc); @@ -393,6 +395,8 @@ struct rproc_ops { int (*sanity_check)(struct rproc *rproc, const struct firmware *fw); u64 (*get_boot_addr)(struct rproc *rproc, const struct firmware *fw); unsigned long (*panic)(struct rproc *rproc); + void (*coredump)(struct rproc *rproc); + void (*priv_cleanup)(struct rproc *rproc); }; /** -- Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-09-24 23:52 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-09-24 23:51 [PATCH v5 0/3] Introduce mini-dump support for remoteproc Siddharth Gupta 2020-09-24 23:51 ` Siddharth Gupta 2020-09-24 23:51 ` Siddharth Gupta [this message] 2020-09-24 23:51 ` [PATCH v5 1/3] remoteproc: core: Add ops to enable custom coredump functionality Siddharth Gupta 2020-09-24 23:51 ` [PATCH v5 2/3] remoteproc: qcom: Add capability to collect minidumps Siddharth Gupta 2020-09-24 23:51 ` Siddharth Gupta 2020-09-26 4:10 ` Bjorn Andersson 2020-09-26 4:10 ` Bjorn Andersson 2020-09-28 19:38 ` Siddharth Gupta 2020-09-28 19:38 ` Siddharth Gupta 2020-09-29 23:04 ` kernel test robot 2020-09-29 23:04 ` kernel test robot 2020-09-24 23:51 ` [PATCH v5 3/3] remoteproc: qcom: Add minidump id for sm8150 modem remoteproc Siddharth Gupta 2020-09-24 23:51 ` Siddharth Gupta 2020-09-26 4:12 ` Bjorn Andersson 2020-09-26 4:12 ` Bjorn Andersson
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1600991488-17877-2-git-send-email-sidgup@codeaurora.org \ --to=sidgup@codeaurora.org \ --cc=agross@kernel.org \ --cc=bjorn.andersson@linaro.org \ --cc=gurbaror@codeaurora.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-arm-msm@vger.kernel.org \ --cc=linux-doc@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-remoteproc@vger.kernel.org \ --cc=ohad@wizery.com \ --cc=psodagud@codeaurora.org \ --cc=rishabhb@codeaurora.org \ --cc=tsoni@codeaurora.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.