mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@somainline.org>
To: Sibi Sankar <quic_sibis@quicinc.com>, bjorn.andersson@linaro.org
Cc: agross@kernel.org, mathieu.poirier@linaro.org,
	dmitry.baryshkov@linaro.org, linux-arm-msm@vger.kernel.org,
	linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Siddharth Gupta <sidgup@codeaurora.org>
Subject: Re: [V3 7/7] remoteproc: sysmon: Send sysmon state only for running rprocs
Date: Wed, 6 Jul 2022 14:43:43 +0200	[thread overview]
Message-ID: <3c6d6d13-0612-e808-d14c-81f9b312664a@somainline.org> (raw)
In-Reply-To: <1657022900-2049-8-git-send-email-quic_sibis@quicinc.com>



On 5.07.2022 14:08, Sibi Sankar wrote:
> From: Siddharth Gupta <sidgup@codeaurora.org>
> 
> When a new remoteproc boots up, send the sysmon state notification
> of only running remoteprocs. Sending state of remoteprocs booting
> up in parallel can cause a race between SSR clients of the remoteproc
> that is booting up and the sysmon notification for the same remoteproc,
> resulting in an inconsistency between which state the remoteproc that
> is booting up in parallel.
> 
> For example - if remoteproc A and B crash one after the other, after
> remoteproc A boots up, if the remoteproc A tries to get the state of
> remoteproc B before the sysmon subdevice for B is invoked but after
> the ssr subdevice of B has been invoked, clients on remoteproc A
> might get confused when the sysmon notification indicates a different
> state.
> 
> Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
> Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>

Konrad
>  drivers/remoteproc/qcom_sysmon.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sysmon.c
> index a9f04dd83ab6..57dde2a69b9d 100644
> --- a/drivers/remoteproc/qcom_sysmon.c
> +++ b/drivers/remoteproc/qcom_sysmon.c
> @@ -512,10 +512,12 @@ static int sysmon_start(struct rproc_subdev *subdev)
>  
>  	mutex_lock(&sysmon_lock);
>  	list_for_each_entry(target, &sysmon_list, node) {
> -		if (target == sysmon)
> +		mutex_lock(&target->state_lock);
> +		if (target == sysmon || target->state != SSCTL_SSR_EVENT_AFTER_POWERUP) {
> +			mutex_unlock(&target->state_lock);
>  			continue;
> +		}
>  
> -		mutex_lock(&target->state_lock);
>  		event.subsys_name = target->name;
>  		event.ssr_event = target->state;
>  

  reply	other threads:[~2022-07-06 12:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05 12:08 [V3 0/7] Miscellaneous PAS fixes Sibi Sankar
2022-07-05 12:08 ` [V3 1/7] remoteproc: qcom: pas: Add decrypt shutdown support for modem Sibi Sankar
2022-07-06 12:38   ` Konrad Dybcio
2022-07-07 10:59     ` Sibi Sankar
2022-07-05 12:08 ` [V3 2/7] remoteproc: qcom: pas: Mark va as io memory Sibi Sankar
2022-07-05 12:08 ` [V3 3/7] remoteproc: qcom: pas: Mark devices as wakeup capable Sibi Sankar
2022-07-05 12:08 ` [V3 4/7] remoteproc: qcom: pas: Check if coredump is enabled Sibi Sankar
2022-07-06 12:41   ` Konrad Dybcio
2022-07-05 12:08 ` [V3 5/7] remoteproc: q6v5: Set q6 state to offline on receiving wdog irq Sibi Sankar
2022-07-05 12:08 ` [V3 6/7] remoteproc: sysmon: Wait for SSCTL service to come up Sibi Sankar
2022-07-05 12:08 ` [V3 7/7] remoteproc: sysmon: Send sysmon state only for running rprocs Sibi Sankar
2022-07-06 12:43   ` Konrad Dybcio [this message]
2022-07-18 22:59 ` [V3 0/7] Miscellaneous PAS fixes 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=3c6d6d13-0612-e808-d14c-81f9b312664a@somainline.org \
    --to=konrad.dybcio@somainline.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=quic_sibis@quicinc.com \
    --cc=sidgup@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

all inboxes | Powered by JetHome®