From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Jon Hunter <jonathanh@nvidia.com>
Cc: Rishabh Bhatnagar <rishabhb@codeaurora.org>,
linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
tsoni@codeaurora.org, psodagud@codeaurora.org,
sidgup@codeaurora.org, elder@ieee.org,
linux-tegra <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH v6 1/2] remoteproc: qcom: Add per subsystem SSR notification
Date: Mon, 13 Jul 2020 12:09:11 -0700 [thread overview]
Message-ID: <20200713190911.GC388985@builder.lan> (raw)
In-Reply-To: <98e3a18e-1491-6f20-6507-d6e6817b76fe@nvidia.com>
On Mon 13 Jul 09:26 PDT 2020, Jon Hunter wrote:
>
> On 24/06/2020 03:23, Rishabh Bhatnagar wrote:
> > 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.
> >
> > Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
> > Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
> > ---
> > drivers/remoteproc/qcom_common.c | 90 ++++++++++++++++++++++++++++++-----
> > drivers/remoteproc/qcom_common.h | 5 +-
> > include/linux/remoteproc/qcom_rproc.h | 20 ++++++--
> > 3 files changed, 95 insertions(+), 20 deletions(-)
> >
> > diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c
> > index 9028cea..7a7384c 100644
> > --- a/drivers/remoteproc/qcom_common.c
> > +++ b/drivers/remoteproc/qcom_common.c
> > @@ -12,6 +12,7 @@
> > #include <linux/module.h>
> > #include <linux/notifier.h>
> > #include <linux/remoteproc.h>
> > +#include <linux/remoteproc/qcom_rproc.h>
> > #include <linux/rpmsg/qcom_glink.h>
> > #include <linux/rpmsg/qcom_smd.h>
> > #include <linux/soc/qcom/mdt_loader.h>
> > @@ -23,7 +24,14 @@
> > #define to_smd_subdev(d) container_of(d, struct qcom_rproc_subdev, subdev)
> > #define to_ssr_subdev(d) container_of(d, struct qcom_rproc_ssr, subdev)
> >
> > -static BLOCKING_NOTIFIER_HEAD(ssr_notifiers);
> > +struct qcom_ssr_subsystem {
> > + const char *name;
> > + struct srcu_notifier_head notifier_list;
> > + struct list_head list;
> > +};
> > +
> > +static LIST_HEAD(qcom_ssr_subsystem_list);
> > +static DEFINE_MUTEX(qcom_ssr_subsys_lock);
> >
> > static int glink_subdev_start(struct rproc_subdev *subdev)
> > {
> > @@ -189,37 +197,83 @@ void qcom_remove_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd)
> > }
> > EXPORT_SYMBOL_GPL(qcom_remove_smd_subdev);
> >
> > +static struct qcom_ssr_subsystem *qcom_ssr_get_subsys(const char *name)
> > +{
> > + struct qcom_ssr_subsystem *info;
> > +
> > + mutex_lock(&qcom_ssr_subsys_lock);
> > + /* Match in the global qcom_ssr_subsystem_list with name */
> > + list_for_each_entry(info, &qcom_ssr_subsystem_list, list)
> > + if (!strcmp(info->name, name))
> > + goto out;
> > +
> > + info = kzalloc(sizeof(*info), GFP_KERNEL);
> > + if (!info) {
> > + info = ERR_PTR(-ENOMEM);
> > + goto out;
> > + }
>
>
> The above appears to be breaking the ARM64 build on the latest -next
> when building the modules ...
>
> CC [M] drivers/remoteproc/qcom_common.o
> drivers/remoteproc/qcom_common.c: In function 'qcom_ssr_get_subsys':
> remoteproc/qcom_common.c:210:9: error: implicit declaration of function 'kzalloc' [-Werror=implicit-function-declaration]
> info = kzalloc(sizeof(*info), GFP_KERNEL);
> ^~~~~~~
> drivers/remoteproc/qcom_common.c:210:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
> info = kzalloc(sizeof(*info), GFP_KERNEL);
>
You're right, not sure why the test build completes successfully for
me...
I've applied a fix from Kefeng Wang for this, sorry for the disruption.
Regards,
Bjorn
next prev parent reply other threads:[~2020-07-13 19:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-24 2:23 [PATCH v6 0/2] Extend SSR notifications framework Rishabh Bhatnagar
2020-06-24 2:23 ` [PATCH v6 1/2] remoteproc: qcom: Add per subsystem SSR notification Rishabh Bhatnagar
2020-07-08 23:56 ` Alex Elder
2020-07-13 16:26 ` Jon Hunter
2020-07-13 19:09 ` Bjorn Andersson [this message]
2020-06-24 2:23 ` [PATCH v6 2/2] remoteproc: qcom: Add notification types to SSR Rishabh Bhatnagar
2020-07-08 23:56 ` Alex Elder
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=20200713190911.GC388985@builder.lan \
--to=bjorn.andersson@linaro.org \
--cc=elder@ieee.org \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=psodagud@codeaurora.org \
--cc=rishabhb@codeaurora.org \
--cc=sidgup@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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).