remoteproc: qcom: Add per subsystem SSR notification

Currently there is a single notification chain which is called whenever any
remoteproc shuts down. This leads to all the listeners being notified, and
is not an optimal design as kernel drivers might only be interested in
listening to notifications from a particular remoteproc. Create a global
list of remoteproc notification info data structures. This will hold the
name and notifier_list information for a particular remoteproc. The API
to register for notifications will use name argument to retrieve the
notification info data structure and the notifier block will be added to
that data structure's notification chain. Also move from blocking notifier
to srcu notifer based implementation to support dynamic notifier head
creation.

Reviewed-by: Alex Elder <elder@linaro.org>
Co-developed-by: Siddharth Gupta <sidgup@codeaurora.org>
Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
Link: https://lore.kernel.org/r/1592965408-16908-2-git-send-email-rishabhb@codeaurora.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Rishabh Bhatnagar
2020-06-23 19:23:27 -07:00
committed by Bjorn Andersson
parent d4c78d2167
commit 5abfe5cf0b
3 changed files with 95 additions and 20 deletions

View File

@@ -5,18 +5,28 @@ struct notifier_block;
#if IS_ENABLED(CONFIG_QCOM_RPROC_COMMON)
int qcom_register_ssr_notifier(struct notifier_block *nb);
void qcom_unregister_ssr_notifier(struct notifier_block *nb);
struct qcom_ssr_notify_data {
const char *name;
bool crashed;
};
void *qcom_register_ssr_notifier(const char *name, struct notifier_block *nb);
int qcom_unregister_ssr_notifier(void *notify, struct notifier_block *nb);
#else
static inline int qcom_register_ssr_notifier(struct notifier_block *nb)
static inline void *qcom_register_ssr_notifier(const char *name,
struct notifier_block *nb)
{
return NULL;
}
static inline int qcom_unregister_ssr_notifier(void *notify,
struct notifier_block *nb)
{
return 0;
}
static inline void qcom_unregister_ssr_notifier(struct notifier_block *nb) {}
#endif
#endif