Skip to content

Commit

Permalink
remoteproc: sysmon: Send sysmon state only for running rprocs
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/1657022900-2049-8-git-send-email-quic_sibis@quicinc.com
  • Loading branch information
Siddharth Gupta authored and Bjorn Andersson committed Jul 18, 2022
1 parent 47c04e0 commit fd75c2d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/remoteproc/qcom_sysmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit fd75c2d

Please sign in to comment.