Linux-ARM-MSM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] remoteproc: qcom: Move glink_ssr notification after stop
@ 2019-07-16  5:03 Bjorn Andersson
  2019-07-23  9:00 ` Sibi Sankar
  0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Andersson @ 2019-07-16  5:03 UTC (permalink / raw)
  To: Ohad Ben-Cohen, Bjorn Andersson
  Cc: linux-arm-msm, linux-remoteproc, linux-kernel, Sibi Sankar,
	Arun Kumar Neelakantam, Chris Lew

glink_ssr is used to signal a remote processor "A" about the stopping of
another remote processor "B", so that in the event that remote processor
B is ever booted again the fifos of the glink channel between A and B is
in a known state.

But if remote processor A receives this notification before B is
actually stopped the newly reset fifo indices will be interpreted as
there being "data" on the channel and either side of the channel will
enter a fatal error handler.

Move the glink_ssr notification to the "unprepare" state of the
rproc_subdev to avoid this issue.

This has the side effect of us not notifying the dying remote processor
itself about its fate, which has been seen to block in certain resource
constraint scenarios.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 drivers/remoteproc/qcom_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c
index 6a448429f223..60650bcc8c67 100644
--- a/drivers/remoteproc/qcom_common.c
+++ b/drivers/remoteproc/qcom_common.c
@@ -200,7 +200,7 @@ void qcom_unregister_ssr_notifier(struct notifier_block *nb)
 }
 EXPORT_SYMBOL_GPL(qcom_unregister_ssr_notifier);
 
-static void ssr_notify_stop(struct rproc_subdev *subdev, bool crashed)
+static void ssr_notify_unprepare(struct rproc_subdev *subdev)
 {
 	struct qcom_rproc_ssr *ssr = to_ssr_subdev(subdev);
 
@@ -220,7 +220,7 @@ void qcom_add_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr,
 			 const char *ssr_name)
 {
 	ssr->name = ssr_name;
-	ssr->subdev.stop = ssr_notify_stop;
+	ssr->subdev.unprepare = ssr_notify_unprepare;
 
 	rproc_add_subdev(rproc, &ssr->subdev);
 }
-- 
2.18.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] remoteproc: qcom: Move glink_ssr notification after stop
  2019-07-16  5:03 [PATCH] remoteproc: qcom: Move glink_ssr notification after stop Bjorn Andersson
@ 2019-07-23  9:00 ` Sibi Sankar
  0 siblings, 0 replies; 2+ messages in thread
From: Sibi Sankar @ 2019-07-23  9:00 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Ohad Ben-Cohen, linux-arm-msm, linux-remoteproc, linux-kernel,
	Arun Kumar Neelakantam, Chris Lew

Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Tested-by: Sibi Sankar <sibis@codeaurora.org>

On 2019-07-16 10:33, Bjorn Andersson wrote:
> glink_ssr is used to signal a remote processor "A" about the stopping 
> of
> another remote processor "B", so that in the event that remote 
> processor
> B is ever booted again the fifos of the glink channel between A and B 
> is
> in a known state.
> 
> But if remote processor A receives this notification before B is
> actually stopped the newly reset fifo indices will be interpreted as
> there being "data" on the channel and either side of the channel will
> enter a fatal error handler.
> 
> Move the glink_ssr notification to the "unprepare" state of the
> rproc_subdev to avoid this issue.
> 
> This has the side effect of us not notifying the dying remote processor
> itself about its fate, which has been seen to block in certain resource
> constraint scenarios.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>  drivers/remoteproc/qcom_common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_common.c 
> b/drivers/remoteproc/qcom_common.c
> index 6a448429f223..60650bcc8c67 100644
> --- a/drivers/remoteproc/qcom_common.c
> +++ b/drivers/remoteproc/qcom_common.c
> @@ -200,7 +200,7 @@ void qcom_unregister_ssr_notifier(struct 
> notifier_block *nb)
>  }
>  EXPORT_SYMBOL_GPL(qcom_unregister_ssr_notifier);
> 
> -static void ssr_notify_stop(struct rproc_subdev *subdev, bool crashed)
> +static void ssr_notify_unprepare(struct rproc_subdev *subdev)
>  {
>  	struct qcom_rproc_ssr *ssr = to_ssr_subdev(subdev);
> 
> @@ -220,7 +220,7 @@ void qcom_add_ssr_subdev(struct rproc *rproc,
> struct qcom_rproc_ssr *ssr,
>  			 const char *ssr_name)
>  {
>  	ssr->name = ssr_name;
> -	ssr->subdev.stop = ssr_notify_stop;
> +	ssr->subdev.unprepare = ssr_notify_unprepare;
> 
>  	rproc_add_subdev(rproc, &ssr->subdev);
>  }

-- 
-- Sibi Sankar --
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-16  5:03 [PATCH] remoteproc: qcom: Move glink_ssr notification after stop Bjorn Andersson
2019-07-23  9:00 ` Sibi Sankar

Linux-ARM-MSM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-msm/0 linux-arm-msm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-msm linux-arm-msm/ https://lore.kernel.org/linux-arm-msm \
		linux-arm-msm@vger.kernel.org linux-arm-msm@archiver.kernel.org
	public-inbox-index linux-arm-msm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-arm-msm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox