Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp719700ybz; Wed, 15 Apr 2020 17:27:37 -0700 (PDT) X-Google-Smtp-Source: APiQypKmAxjAIPzscHgpLsVXUbHOMSXyNiazDEgErNlCa+7zo5chNfjUxovaAqG74pcNsB5mfKD4 X-Received: by 2002:a17:906:3296:: with SMTP id 22mr7576004ejw.195.1586996857544; Wed, 15 Apr 2020 17:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586996857; cv=none; d=google.com; s=arc-20160816; b=jXF4LmkOeP6op3Ii+wzQzz3v1IWNGwy3NKDhgE1wSJbfp6200xpRsD/15dPuUofCtc QnflY0Q9qvuyXolQLgrIldimaWt27Z2mCBj1GYcLpfKEi52lqfTAgv1buTFM+LURj3Kl DG6yCVFI/J5H1zJvfkOzgXpCfv6emQRHw2zr8nSVczwW6EuPTx+Qc55yJf56AURqlNK+ +zKeo+PgWZz6qsr2ywbU7kGK9J+z/RjuPsJajP/0ltMvHZMnLX/w8KfAPVb6xvJGfYCw ff2YFD/Z7ltm7vp6lutC+sUrvrTKuh0efG70clZx5TyrbcwIdRDrU67g8QXp1geFGAt0 Hm3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Izg8ue8YhxY7H2kruJlEEdGPr0daRyfDG5yf987D9nU=; b=px7OxqlgAPL41wKiLwjgJ/++yhqfqi4/qpKkNf76Nv1zJRBM27UymecJmgbzwxzw30 UCQWHpWnqKFJiu2VKx2w/dXXOpybbX4QCb94W9s0dkSvFlPWYGldP2iyylWsvM9JUg8v imeiQ4nbokZhoGDyFwE5hjGbhdxVxbV4nz2NJYxyVRsq5Z7+yKtkXAc+U9TE5GuNe0Fv It0/hv3ISmrnAg38cb7iTXd+6R33QyXjgbTQm3uF/aAdjvpDqfeFssusXslU4VCOPmmb ed2+DIWN4PkxAWWBHSAIgcxueGIT8T85ZxXGGb2hD4O3jHFXa7dP0s+F5QK3oCaJhqRD 8rAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vTyEIRCF; 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 ([23.128.96.18]) by mx.google.com with ESMTP id z92si3604470ede.45.2020.04.15.17.27.14; Wed, 15 Apr 2020 17:27:37 -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=vTyEIRCF; 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 S1416514AbgDORQ1 (ORCPT + 99 others); Wed, 15 Apr 2020 13:16:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1416503AbgDORQY (ORCPT ); Wed, 15 Apr 2020 13:16:24 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03673C061A0C for ; Wed, 15 Apr 2020 10:16:24 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id g32so215301pgb.6 for ; Wed, 15 Apr 2020 10:16:23 -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:user-agent; bh=Izg8ue8YhxY7H2kruJlEEdGPr0daRyfDG5yf987D9nU=; b=vTyEIRCFkbm/7cTNcpVWop+cR+0/QClCSDkUDVPtYAu7XEXkE2QPRNxHxymFQZR2Nj EKtN6f2MwtzpKVWkII8qfFECUdlvef4AtBgQbIx+cw1AFwa0hxhBN/Ckhipus8m1r0y0 PaDtt5Ep1oV8ZTtV9liF/XKuf+IuBz9xw/1OaShQJUJgYNcgZmpkRQ9z3MfzdKp8pUFA CzIul5KZNqOShlWKg7nCWkAaK0nzehFlLHH4ZJ2j+3kjaeBKqiOryjcuyOIPTR5WuaAH +G1FYIft7HFjwx1EHCPl+YG7c+MqiVSo6sIKmtckJSVtzNh/8LRxxcj9nLSpNQIjWBfs PLgA== 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:user-agent; bh=Izg8ue8YhxY7H2kruJlEEdGPr0daRyfDG5yf987D9nU=; b=SGszWiuu3Rpvftoq84w2mFcq50IciliDt9DzoNFRmyMpobeuVY6MEhU3LXCG0T7MsU SPqBPUl4w2mhnYiAa5OxkyLMVbqoGgyrgwoOAy8PZEcr7UHIFQm1UNY2LVodFAeSJANB 3X/biabRtiCkX0F0WEGNgMXh7ETQdjMqaKOGagmQDT3lpv6GOq4OnT+noForqfZRGgrm tvZJwztKoyaD6EDh3ZOY1tDusvNNXiH0OC6qJkwDax1Nt7EiobRrCor9id84iEC6Y1MM X6SuPCQTlMteodjPpEjvStiqv5FdiuVFxdwgEfphttnl8/U0mSPXiB0V/3J1Ag2McnLu 9KaA== X-Gm-Message-State: AGi0PuZKnBUlCEPAXQG5iMD3fJhtKRmJcN+nkaYLHUwf9J3CDs7FOTXR XReLIjHPt41xadjIJv+HbYf7WA== X-Received: by 2002:a63:2057:: with SMTP id r23mr28157163pgm.232.1586970983425; Wed, 15 Apr 2020 10:16:23 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id x27sm14559225pfj.74.2020.04.15.10.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 10:16:22 -0700 (PDT) Date: Wed, 15 Apr 2020 11:16:20 -0600 From: Mathieu Poirier To: Siddharth Gupta Cc: agross@kernel.org, bjorn.andersson@linaro.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: <20200415171620.GC16583@xps15> 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> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 08, 2020 at 04:36:40PM -0700, 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 > --- > 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); > + Acked-by: Mathieu Poirier > return 0; > } > > -- > Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project