Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3330282ybz; Mon, 20 Apr 2020 00:09:45 -0700 (PDT) X-Google-Smtp-Source: APiQypLCWdwqtVrepKUzGh+9YvWlikMZ8zXKRf8SatSPgl7AK0ZQ3KSg+j5ZuJLBz0KK4c63V7yt X-Received: by 2002:a17:906:30d9:: with SMTP id b25mr15143015ejb.168.1587366585324; Mon, 20 Apr 2020 00:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587366585; cv=none; d=google.com; s=arc-20160816; b=DXmArG2q3tLo0wQ91NYj/Ah7bI02XEvnFG4V+NIaeVoevDz/ELLl/d05wdytZkBhyR m/qj9/ThtVVYqyWjxd/+h8e4liOsXGfC9gcP0RGedrugzgNZ/owSXInBdzTfExphBL41 w8Kam8uwV4wjb6D4laaLXYP2GbVomBa7BZF+haxnEYN5z0+QRaZ5+wokrORICAdUsCDg 2OCw//wCPeNlktqaauzJ5yu2bm8Apb+xQ5X8dtoL9kjktrb9iQsgEuJDlAGhC94z3pXh vLutdwOreqni1YWbvWiLIL1obOUc2obbp+MVMoD3xzGuZsn1MRLpn0hJowpqOXwB6DnG KdXg== 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=yfnkSN5f2gaTrJl0GVeCylF5vdCJFRacL3iq4ImD+rk=; b=a5jZcczQRcmCIqg8OM1WB1FzmnEY4B4Dgc4CiJPrEAU5Ib2Ut6XcP3r49K7s37w8XL B86thMHVVC4TJnqHJYVE50yXNuHBdlzbP+0tz/SotlKDnuCO1QbHv9MNgWqrsItVT5Nx AgZgEtgRox4Vjhbkjhah611CqdQGBUu8oXcCyatTxpYNi23K7R5MeaUS6BfVFIXqzbS1 /v9zGADHxHS7xqUrREizPXd33t2EsgUWOzxB6dvEpSNYLBE6VF9hV6jyRpKz6h7BxvZD 9GUKe7uLIQo7sqbVAIvdEClT1NWlATt/Uci/N7Ay/Hih0bZweNSLXEMiFWIo9TKYVBFE mQYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YhWj2yqj; 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 94si40951edk.562.2020.04.20.00.09.22; Mon, 20 Apr 2020 00:09:45 -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=YhWj2yqj; 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 S1726337AbgDTHFd (ORCPT + 99 others); Mon, 20 Apr 2020 03:05:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726323AbgDTHFd (ORCPT ); Mon, 20 Apr 2020 03:05:33 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 279DAC061A0F for ; Mon, 20 Apr 2020 00:05:33 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id x77so1897269pfc.0 for ; Mon, 20 Apr 2020 00:05:33 -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=yfnkSN5f2gaTrJl0GVeCylF5vdCJFRacL3iq4ImD+rk=; b=YhWj2yqjYltdCafwN1HzBemr26x7U2lwSkpvnlqo6IJo0NlbzNWOVa0N07A77EWWwn d2a91DgOA4DrtHAUYiC1clPD7zxtFe+huZYpKXsIUAJUUEanN3GbJHsHNOF5n5MBgrrL LmmvUp4PIBnrB8/LsF0QrAWKyybh3GTDovnmlNTpu1Yg6wQ7+djap5VrV+JIDH79s3+Z x6x1zTpH7AM0+tQzYgMdlPXBDXUWkONuEBwWbtR0+Qj9dCl2U3N3ZKKY4atYgK171p/6 T/6SojVqvnGwmoLFMhQt0EOkBStbxFKcI/VhdzCyb8PgZq+NWX6oktX01NeKbyuOnqGd qT8w== 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=yfnkSN5f2gaTrJl0GVeCylF5vdCJFRacL3iq4ImD+rk=; b=VDDzyxXyYnO3LKRJfR5eHzs5SLPCYcCU2VRQut2LuF+sceOzi9KNqzQoUEbKjP277G nRrsc5SzBWdGjDBy5xVIHX2bSgmKSL4pN+euHfEVLhshT2qyq7x3SuuUsHHpj7B4+n6n Iz/XE6tjmDrwvXN05NlGh+HMDSkc+s2kODCHIFx3N/E4TLCSXPYXoFdaNZcXJM/WQAlU q76W3p56gEO8ZAV4SEkEV+llSMJH37R9+kIP+DhHATinEuWt7Zf1ezirlgOXXSzF9MUS xcyGUaKfGdsfuiQd81CSasjEpVJmos/BaUQGr7FXhPd8WmD4urVx316rn4nk2xUbZ0Gg w6Hg== X-Gm-Message-State: AGi0PubJ6lNFy76nwnhQlPzbP6pYH+n0rr8RzOViSaa9eb+O6AS7xnM2 JLneWcIWos9o6tffd7FTIeAsqA== X-Received: by 2002:a63:4c2:: with SMTP id 185mr14296077pge.1.1587366332598; Mon, 20 Apr 2020 00:05:32 -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 b5sm161749pfb.190.2020.04.20.00.05.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 00:05:31 -0700 (PDT) Date: Mon, 20 Apr 2020 00:05:55 -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 2/6] remoteproc: sysmon: Add notifications for events Message-ID: <20200420070555.GE1868936@builder.lan> 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> 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: > 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 Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > 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