Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3330926ybz; Mon, 20 Apr 2020 00:10:42 -0700 (PDT) X-Google-Smtp-Source: APiQypKM4Z+Nc6tN+epLE3+MUPunQJkH/Cf5JurHEWPdBEiZGoaxGkfC/aokoHQCrU49Cx0bYyKR X-Received: by 2002:a17:907:11de:: with SMTP id va30mr14721857ejb.121.1587366642795; Mon, 20 Apr 2020 00:10:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587366642; cv=none; d=google.com; s=arc-20160816; b=GmwQvPVJOWJfc0xcyBG3Jx58mSMrVD3y6Y42yUQdUXcY4adu2uOIBspiwkb9h4YAm7 mJd26XOFkDKg+cyBBux9ktnb7Er858D5SpKB6HaC+1mlr8M0AZKsPDuA6KjgHKnciWrd F3vaeZiSOXPWgki8zWVzzvvaANFKsnxK1eMDu0UrJHahg44J7pPZt88yPa8Dn6Wtri56 HVt5eVRSN7AsCqaxMFOjrXnCIhUkzQgptC2hUbe8bg2HhP2BLiHIsFkgXedrD2vfxzJv r4bJOhepGNMWdGGgWrES4svEZvvypcQ3EWSzFsV4mv5Lqm7NdcCBe9JRm96pqKKTSxL9 kQMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ZFTvUBniMnOgkrRExu5askOEdn96R/KVp3qePoAVn6U=; b=l57+dFwzRTaA9RNf/7KP7QodVvMFnIDXpQlE8Kws/mRB1gv88aFfjh2pSdTspBD3RG wQLBb3cwks6GSsaY85GDBE1xRsthDEKQPdQYrLs2W4m0bmfYjRUohKKJaG79/RF5imdI 6UrVtJG08ZRjPdA+FDnwsVoW+Xw7SG5D6Ng7A2nL3XmWT7FhOTRy9eE4WOw2j1D+pWQu v+SPftvtArIExK4PUfO48htj4+uv2uEHMzH3O8xyp8hJ3r+3YgprMV5D3fzHnovw0pni BsQJU3hfGRWcj3eWkGjwZw/7u9WPp4N2uWSta1mWFZHQpCcUU3aIec35em3yyYDIMuqB Waqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QKp98wB9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u3si40230edp.525.2020.04.20.00.10.19; Mon, 20 Apr 2020 00:10:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QKp98wB9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726063AbgDTHIi (ORCPT + 99 others); Mon, 20 Apr 2020 03:08:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726017AbgDTHIi (ORCPT ); Mon, 20 Apr 2020 03:08:38 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54867C061A0C for ; Mon, 20 Apr 2020 00:08:38 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id p8so4607540pgi.5 for ; Mon, 20 Apr 2020 00:08:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ZFTvUBniMnOgkrRExu5askOEdn96R/KVp3qePoAVn6U=; b=QKp98wB9GMSRtHLO5NspGdujoHvPoUeArRvvkQZr2iHLy5rnm4LVW8/987njYm9uhj JdeZIF+IFQadILVdklQ34vEfxMxFRlZ+xsueOVmhrbOoFfl4h/38xxUBEMNv15CQ/lfc 0YcmiWPgfXx0hNh9lK6Xf/9jEaz3MNFxbRJaKE4g5CElwqlIlKTpG7FLmGbnX9y9HYGK Q47tO0EXlEHxfHI5DISKBTyaVg7E8FZK8+JSMcmyB6aRIKDVxCUHGGeZovcZXj42zfPD XcYHL/f1TZJLkNYj23KrDftSqzJLxjinXHWmiOqKjrQP6cYEzifWlPyeJCpmqu6as7Ek GSjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ZFTvUBniMnOgkrRExu5askOEdn96R/KVp3qePoAVn6U=; b=f4efmtp87EXr7CeIR0xkF6qdHCkFGt5SmrxBQ0gV5Ui20a8ZleRJSSpmlVcFqsSWDb 3scdCenVDaHnCwG7dlxL3pp/47O0kI2r7vHcJEorShUhjbEBfoW6eJcPChZ8FpWfODTQ U1+lDKKJBF17ATDoIJMrSpRHBtEzemWQvOnWNdqhRjxRHvGsbbrfyAaQ+sZA+HI/yoFp s1uiYkt8yS/uMUOg0gE6fu1TWCZE5SSshXpWlFDYWuKXHib6zlWnDn1jXLoV8zttRLKC dFIl0uv19TKjmQPtkZ10s8TOI0S/RTxYsgtDnIJOyQOqToMxjg5oHVIXYnembCSq8DMK HBRQ== X-Gm-Message-State: AGi0PuaHN3a2o4wDFAzfdBJ2KHLDsFrT9RR9rnuj87gD9mBD6+H6GbUt fO7ORQMHET9WhF1DgpBOwkyZeg== X-Received: by 2002:a05:6a00:a:: with SMTP id h10mr9544646pfk.160.1587366517818; Mon, 20 Apr 2020 00:08:37 -0700 (PDT) Received: from builder.lan (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id x185sm166115pfx.155.2020.04.20.00.08.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 00:08:37 -0700 (PDT) Date: Mon, 20 Apr 2020 00:09:00 -0700 From: Bjorn Andersson To: Siddharth Gupta Cc: agross@kernel.org, ohad@wizery.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tsoni@codeaurora.org, psodagud@codeaurora.org, rishabhb@codeaurora.org Subject: Re: [PATCH v2 3/6] remoteproc: sysmon: Inform current rproc about all active rprocs Message-ID: <20200420070900.GF1868936@builder.lan> References: <1586389003-26675-1-git-send-email-sidgup@codeaurora.org> <1586389003-26675-4-git-send-email-sidgup@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1586389003-26675-4-git-send-email-sidgup@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 08 Apr 16:36 PDT 2020, Siddharth Gupta wrote: > Clients/services running on a remoteproc that booted up might need to be > aware of the state of already running remoteprocs. When a remoteproc boots > up (fresh or after recovery) it is not aware of the remoteprocs that booted > before it, i.e., the system state is incomplete. So to keep track of it we > send sysmon on behalf of all 'ONLINE' remoteprocs. > > Signed-off-by: Siddharth Gupta Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > drivers/remoteproc/qcom_sysmon.c | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sysmon.c > index 851664e..8d8996d 100644 > --- a/drivers/remoteproc/qcom_sysmon.c > +++ b/drivers/remoteproc/qcom_sysmon.c > @@ -453,10 +453,20 @@ static int sysmon_prepare(struct rproc_subdev *subdev) > return 0; > } > > +/** > + * sysmon_start() - start callback for the sysmon remoteproc subdevice > + * @subdev: instance of the sysmon subdevice > + * > + * Inform all the listners of sysmon notifications that the rproc associated > + * to @subdev has booted up. The rproc that booted up also needs to know > + * which rprocs are already up and running, so send start notifications > + * on behalf of all the online rprocs. > + */ > static int sysmon_start(struct rproc_subdev *subdev) > { > struct qcom_sysmon *sysmon = container_of(subdev, struct qcom_sysmon, > subdev); > + struct qcom_sysmon *target; > struct sysmon_event event = { > .subsys_name = sysmon->name, > .ssr_event = SSCTL_SSR_EVENT_AFTER_POWERUP > @@ -464,6 +474,21 @@ static int sysmon_start(struct rproc_subdev *subdev) > > blocking_notifier_call_chain(&sysmon_notifiers, 0, (void *)&event); > > + mutex_lock(&sysmon_lock); > + list_for_each_entry(target, &sysmon_list, node) { > + if (target == sysmon || > + target->rproc->state != RPROC_RUNNING) > + continue; > + > + event.subsys_name = target->name; > + > + if (sysmon->ssctl_version == 2) > + ssctl_send_event(sysmon, &event); > + else if (sysmon->ept) > + sysmon_send_event(sysmon, &event); > + } > + mutex_unlock(&sysmon_lock); > + > return 0; > } > > -- > Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project