2017-11-17 00:23:10

by Chris Lew

[permalink] [raw]
Subject: Re: [PATCH v3 4/5] remoteproc: qcom: Introduce sysmon

Hi Bjorn,

Question about the SSR events for sysmon.

Thanks,
Chris

On 11/15/2017 12:10 PM, Bjorn Andersson wrote:

[..]
> +/**
> + * ssctl_send_event() - send notification of other remote's SSR event
> + * @sysmon: sysmon context
> + * @name: other remote's name
> + */
> +static void ssctl_send_event(struct qcom_sysmon *sysmon, const char *name)
> +{
> + struct ssctl_subsys_event_resp resp;
> + struct ssctl_subsys_event_req req;
> + struct qmi_txn txn;
> + int ret;
> +
> + memset(&resp, 0, sizeof(resp));
> + ret = qmi_txn_init(&sysmon->qmi, &txn, ssctl_subsys_event_resp_ei, &resp);
> + if (ret < 0) {
> + dev_err(sysmon->dev, "failed to allocate QMI txn\n");
> + return;
> + }
> +
> + memset(&req, 0, sizeof(req));
> + strlcpy(req.subsys_name, name, sizeof(req.subsys_name));
> + req.subsys_name_len = strlen(req.subsys_name);
> + req.event = SSCTL_SSR_EVENT_BEFORE_SHUTDOWN;

Are there plans to add the other SSR events to sysmon notifiers? I think
the SSCTL service expects to receive events about remote procs starting
as well.

> + req.evt_driven_valid = true;
> + req.evt_driven = SSCTL_SSR_EVENT_FORCED;
> +
> + ret = qmi_send_request(&sysmon->qmi, &sysmon->ssctl, &txn,
> + SSCTL_SUBSYS_EVENT_REQ, 40,
> + ssctl_subsys_event_req_ei, &req);
> + if (ret < 0) {
> + dev_err(sysmon->dev, "failed to send shutdown request\n");
> + qmi_txn_cancel(&txn);
> + return;
> + }
> +
> + ret = qmi_txn_wait(&txn, 5 * HZ);
> + if (ret < 0)
> + dev_err(sysmon->dev, "failed receiving QMI response\n");
> + else if (resp.resp.result)
> + dev_err(sysmon->dev, "ssr event send failed\n");
> + else
> + dev_dbg(sysmon->dev, "ssr event send completed\n");
> +}

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

From 1584169667655788003@xxx Wed Nov 15 21:38:44 +0000 2017
X-GM-THRID: 1584169667655788003
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread