Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp779533ybz; Wed, 15 Apr 2020 18:53:14 -0700 (PDT) X-Google-Smtp-Source: APiQypLseGLAJ7dYV0Zd0Z5rXgPrHUO9kxGlIc/AM6Bws3OMQ8lXm3o/TYIAPvZgYQib1AmwJuu1 X-Received: by 2002:aa7:d745:: with SMTP id a5mr21941291eds.43.1587001993949; Wed, 15 Apr 2020 18:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587001993; cv=none; d=google.com; s=arc-20160816; b=XcaiG6nP1/j+hkqdzrJrC2Z8tKK1VV6Vksva8+sxep8shh2NyTA2p2wmHQCt9aYUMy mh0NkK0eEnIHt/9Lo65WSvQk/eV/3Df4H8ZrX4i+CjKoEjjmxPqt+cqutxE7r3Nv7Sfq bN+0+YjORN3jIaQUyAfxr1QK0ZUNyRBRldvG4D7ktsIAzBzeXw+ZwTe4wlSzOifc/KwF eFpUPq6aSoP8/7/d1ZrBbpusKKJJbiuxcdgvhyWBFrdsq1rQtBaJ6LwhAZNDP4ug1+Vb fPbM7EMwkSyuSdo6oCAOIQyJjF/NdDPcf0JoWf4FXO97VdP35ZzcCorG5L/Wthc4NB72 tt9A== 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=TXmBTmjlGDdkYJ5YaS9MFQANC5ZQIcUdQZgB+/qVJcg=; b=d2159ngZV60LjrV1ixF2kKU0Y1nH4VUu2+RRBoEnb7nqr+7XTHLnyXKZ3ATJv8uXm/ ZI+glfGR/hig4SStt0okpiE8gqTbJF76GWMNJsyHGDAbhaCXMdjKESukqGKSRxc40f06 1OTWAmGq33xNyyW/n3A9gLNCJ86X2YmAgz7f8dNIIVLclz9opQGCTC4KBhokZC5xRFGO +idISz34oy9hh+81z3HPtqzqHt6mOzHlzgErQUCFdKDkh1gGHroDTwfBvJT14iBd0RtX +ZSWuoukR+j2tOUzK/iZWsXBKO32whi43EF0c7nz+HpvZNkKi2mPsh44CLvYSSF5X7or 1tRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="FaDHsxJ/"; 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 b3si10911278edn.402.2020.04.15.18.52.50; Wed, 15 Apr 2020 18:53:13 -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="FaDHsxJ/"; 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 S2410658AbgDORD7 (ORCPT + 99 others); Wed, 15 Apr 2020 13:03:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2410653AbgDORDz (ORCPT ); Wed, 15 Apr 2020 13:03:55 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 099ADC061A0F for ; Wed, 15 Apr 2020 10:03:55 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id t11so205926pgg.2 for ; Wed, 15 Apr 2020 10:03:55 -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=TXmBTmjlGDdkYJ5YaS9MFQANC5ZQIcUdQZgB+/qVJcg=; b=FaDHsxJ/Bsq5/mrz/KAm6LRhZzJ4oycH4qGHGQN9l033vBRXCFWhhDAHZx0+xkwcn6 3d9mqYrLsMXHMiqUyBOvrSZgysqBewL5VEDFgtVWtZ5r5R4iKx0idNL1JXlvFWZkTJG1 z4/YrF5Wga+eRnhDgvfXrFjJEwsFIlqlBzlRcSojTuj2fo9hu1Gco/ImeqCdmYAyEG7h ladEsxtLlmQSyVLOdLCdz9Y6RtEjYQKZnB+Ofr1ZjLsx6jSBvrP7LBYE5Itxoaazm7tz FI4TPa2wRScdEcGxXCnlV1c5PskOclAIjNWYYB/RjLot4De6rh4OvuWVsPpy2MGobT+R vnAw== 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=TXmBTmjlGDdkYJ5YaS9MFQANC5ZQIcUdQZgB+/qVJcg=; b=AhueSTTpvm9ctAxtNpdSMkPya7zostGy9O8MdbmPviOZdXV1GS4r5sEQhdRbzotDGu /gn1n8QxmU7heDUshtTXE8evZAulwM1Bp9SyIZrMywd5WZTvR7B0ta8wg/v5An8lnitd vejTmkS4Nl6ufXV/+4unXBAzeptyauYlBHWBE6NBZIr4+Z5FaDXBgJjJCf1P7dNp30Hu /ZUTlt0H7MmHYP2LoqNchrKhO60KRjxjpQwf9K20I47TUnUF+9EHvhodKtGwVqXx6VtN uAeb3Sok30EGv5nLJGUabJoaAMgJXv0JiTW/yA9M+Guw4NS3tWRj8Ok5rqibdaE4Aflf tQVg== X-Gm-Message-State: AGi0PuaiyP4UolsoOgzl7rEWpt46C/Efh5g18/ftgjg3Y/FQOi9spwzZ JixacafuC1xoYByYLTttsa8ZSw== X-Received: by 2002:a62:2506:: with SMTP id l6mr24888469pfl.184.1586970234265; Wed, 15 Apr 2020 10:03:54 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id i124sm14308027pfg.14.2020.04.15.10.03.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 10:03:53 -0700 (PDT) Date: Wed, 15 Apr 2020 11:03:51 -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 2/6] remoteproc: sysmon: Add notifications for events Message-ID: <20200415170351.GB16583@xps15> References: <1586389003-26675-1-git-send-email-sidgup@codeaurora.org> <1586389003-26675-3-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-3-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:39PM -0700, Siddharth Gupta wrote: > Add notification for other stages of remoteproc boot and shutdown. This > includes adding callback functions for the prepare and unprepare events, > and fleshing out the callback function for start. > > Signed-off-by: Siddharth Gupta Acked-by: Mathieu Poirier > --- > drivers/remoteproc/qcom_sysmon.c | 37 +++++++++++++++++++++++++++++++++++++ > 1 file changed, 37 insertions(+) > > diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sysmon.c > index 1366050..851664e 100644 > --- a/drivers/remoteproc/qcom_sysmon.c > +++ b/drivers/remoteproc/qcom_sysmon.c > @@ -439,8 +439,31 @@ static const struct qmi_ops ssctl_ops = { > .del_server = ssctl_del_server, > }; > > +static int sysmon_prepare(struct rproc_subdev *subdev) > +{ > + struct qcom_sysmon *sysmon = container_of(subdev, struct qcom_sysmon, > + subdev); > + struct sysmon_event event = { > + .subsys_name = sysmon->name, > + .ssr_event = SSCTL_SSR_EVENT_BEFORE_POWERUP > + }; > + > + blocking_notifier_call_chain(&sysmon_notifiers, 0, (void *)&event); > + > + return 0; > +} > + > static int sysmon_start(struct rproc_subdev *subdev) > { > + struct qcom_sysmon *sysmon = container_of(subdev, struct qcom_sysmon, > + subdev); > + struct sysmon_event event = { > + .subsys_name = sysmon->name, > + .ssr_event = SSCTL_SSR_EVENT_AFTER_POWERUP > + }; > + > + blocking_notifier_call_chain(&sysmon_notifiers, 0, (void *)&event); > + > return 0; > } > > @@ -464,6 +487,18 @@ static void sysmon_stop(struct rproc_subdev *subdev, bool crashed) > sysmon_request_shutdown(sysmon); > } > > +static void sysmon_unprepare(struct rproc_subdev *subdev) > +{ > + struct qcom_sysmon *sysmon = container_of(subdev, struct qcom_sysmon, > + subdev); > + struct sysmon_event event = { > + .subsys_name = sysmon->name, > + .ssr_event = SSCTL_SSR_EVENT_AFTER_SHUTDOWN > + }; > + > + blocking_notifier_call_chain(&sysmon_notifiers, 0, (void *)&event); > +} > + > /** > * sysmon_notify() - notify sysmon target of another's SSR > * @nb: notifier_block associated with sysmon instance > @@ -563,8 +598,10 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc, > > qmi_add_lookup(&sysmon->qmi, 43, 0, 0); > > + sysmon->subdev.prepare = sysmon_prepare; > sysmon->subdev.start = sysmon_start; > sysmon->subdev.stop = sysmon_stop; > + sysmon->subdev.unprepare = sysmon_unprepare; > > rproc_add_subdev(rproc, &sysmon->subdev); > > -- > Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project