linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Cc: Andy Gross <andy.gross@linaro.org>,
	Ohad Ben-Cohen <ohad@wizery.com>,
	Arun Kumar Neelakantam <aneela@codeaurora.org>,
	Chris Lew <clew@codeaurora.org>,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-soc@vger.kernel.org, linux-remoteproc@vger.kernel.org
Subject: Re: [PATCH v4 3/5] remoteproc: Pass type of shutdown to subdev remove
Date: Mon, 4 Dec 2017 22:46:11 -0800	[thread overview]
Message-ID: <20171205064611.GM28761@minitux> (raw)
In-Reply-To: <6d6d01bb-f8f4-3380-c9ee-3d14c707bdf0@st.com>

On Fri 01 Dec 06:50 PST 2017, Arnaud Pouliquen wrote:

> hello Bjorn,
> 
> Sorry for these late remarks/questions
> 

No worries, I'm happy to see you reading the patch!

> 
> On 11/30/2017 02:16 AM, Bjorn Andersson wrote:
[..]
> > diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c
[..]
> > @@ -785,17 +785,17 @@ static int rproc_probe_subdevices(struct rproc *rproc)
> >  
> >  unroll_registration:
> >  	list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node)
> > -		subdev->remove(subdev);
> > +		subdev->remove(subdev, false);
> Why do you need to do a non graceful remove in this case? This could
> lead to side effect like memory leakage...
> 

Regardless of this being true or false resources should always be
reclaimed.

The reason for introducing this is that the modem in the Qualcomm
platforms implements persistent storage and it's preferred to tell it to
flush the latest data to the storage server (on the Linux side) before
pulling the plug. But in the case of a firmware crash this mechanism
will not be operational and there's no point in attempting this
"graceful shutdown".

[..]
> > diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
> > index 44e630eb3d94..20a9467744ea 100644
> > --- a/include/linux/remoteproc.h
> > +++ b/include/linux/remoteproc.h
> > @@ -456,7 +456,7 @@ struct rproc_subdev {
> >  	struct list_head node;
> >  
> >  	int (*probe)(struct rproc_subdev *subdev);
> > -	void (*remove)(struct rproc_subdev *subdev);
> > +	void (*remove)(struct rproc_subdev *subdev, bool graceful);
> What about adding a new ops instead of a parameter, like a recovery
> callback?
> 

I think that for symmetry purposes it should be probe/remove in both
code paths. A possible alternative to the proposal would be to introduce
an operation "request_shutdown()" the would be called in the proposed
graceful code path.


However, in the Qualcomm SMD and GLINK (conceptually equivalent to
virtio-rpmsg) it is possible to open and close communication channels
and it's conceivable to see that the graceful case would close all
channels cleanly while the non-graceful case would just remove the rpmsg
devices (and leave the channel states/memory as is).

In this case a "request_shutdown()" would complicate things, compared to
the boolean.

Regards,
Bjorn

  reply	other threads:[~2017-12-05  6:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-30  1:16 [PATCH v4 0/5] In-kernel QMI helpers and sysmon Bjorn Andersson
2017-11-30  1:16 ` [PATCH v4 1/5] soc: qcom: Introduce QMI encoder/decoder Bjorn Andersson
2017-11-30 17:17   ` Chris Lew
2017-12-01  9:10   ` Jitendra Sharma
2017-12-05 17:33     ` Bjorn Andersson
2017-11-30  1:16 ` [PATCH v4 2/5] soc: qcom: Introduce QMI helpers Bjorn Andersson
2017-11-30  8:18   ` Philippe Ombredanne
2017-12-01  5:35     ` Bjorn Andersson
2017-12-01  7:48       ` Philippe Ombredanne
2017-11-30 17:33   ` Chris Lew
2017-11-30  1:16 ` [PATCH v4 3/5] remoteproc: Pass type of shutdown to subdev remove Bjorn Andersson
2017-11-30 17:35   ` Chris Lew
2017-12-01 14:50   ` Arnaud Pouliquen
2017-12-05  6:46     ` Bjorn Andersson [this message]
2017-12-05 10:54       ` Arnaud Pouliquen
2017-12-05 17:17         ` Bjorn Andersson
2017-12-06  8:55           ` Arnaud Pouliquen
2017-12-06 21:53             ` Bjorn Andersson
2017-12-07 12:14               ` Arnaud Pouliquen
2017-11-30  1:16 ` [PATCH v4 4/5] remoteproc: qcom: Introduce sysmon Bjorn Andersson
2017-12-01  1:52   ` Chris Lew
2017-12-01  5:31     ` Bjorn Andersson
2017-11-30  1:16 ` [PATCH v4 5/5] samples: Introduce Qualcomm QMI sample client Bjorn Andersson
2017-11-30 17:36   ` Chris Lew

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=20171205064611.GM28761@minitux \
    --to=bjorn.andersson@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=aneela@codeaurora.org \
    --cc=arnaud.pouliquen@st.com \
    --cc=clew@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=ohad@wizery.com \
    /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).