Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1428659ybf; Thu, 27 Feb 2020 10:48:44 -0800 (PST) X-Google-Smtp-Source: APXvYqyMLF5PtiFyzOeCFI0BgVZ/RwEBW9AL6AGvK5t0yDJquQhUXbIAbudzsDfdv8muhe8v73hh X-Received: by 2002:a9d:6251:: with SMTP id i17mr293534otk.14.1582829323991; Thu, 27 Feb 2020 10:48:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582829323; cv=none; d=google.com; s=arc-20160816; b=iMCQN6LSnvVOC3xf06AsZNr6EVk2tlMLxNMjQfH4TwX48b+h7kiEYuVrFzombsUUgW ji5otwu2FmUnqDgTbadKr+ASQzvFFb+PHNP30RPebwX3answnWb7WS1SAbU+2vTPedKH qosKHgljC08vLDNhGyY+wZDWSqyjGy2oKEHFla3ZHTKxT0cPADXhDr5hIP58B5BtaUb+ 7TP3wh8LbymZTUsF+0Vrj6U/DCCBrkN70+6XNwImNME/RsMsVbOezIwGV5mL3EWS2ICU bFRf5IhhzYUD1A3wEsFTJDusPmDEjxR31d3XbfEvn9Mno+F03PeoE9lqS7XjYGztZQmb DcqQ== 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=lcrpnq/b6/hpdUjJ7BPbI1dg5z0iJwDYFP4cImRT74Q=; b=S/2bwEESYuQDlNiW/b++mhhuI6EWdlNyySuMojv4ePhxdT97C0QEraIQEA0O4JGXYt /hjBagdXEDiZzpWOhl7diOzNT+mGYz7OLWz+lWRsNs5QuuD+7SAgFe07U37x15xg4NHW 4UPjKtCdeOYnj3B2pFmTBpqVcIfFcBfF+cGopqXZ0b+VvAoNj/WVcQTZDO52dzsFDnao p/SvhPX/L/fuhmlJCkfOko1PeArsTg3fbu5l/R0kgMaTQmyWBJRxk8plItaAazB0FqW1 iwXN32OkwekIliyiUhqevRRxw0W70kTKktcGXzqfmGpBJ2AfeLGF2ONZDab3ImvCkxu2 cxHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EBgRVvpA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id x12si32484oto.194.2020.02.27.10.48.29; Thu, 27 Feb 2020 10:48:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EBgRVvpA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729799AbgB0SrK (ORCPT + 99 others); Thu, 27 Feb 2020 13:47:10 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:47031 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729172AbgB0SrK (ORCPT ); Thu, 27 Feb 2020 13:47:10 -0500 Received: by mail-pl1-f195.google.com with SMTP id y8so137761pll.13 for ; Thu, 27 Feb 2020 10:47:09 -0800 (PST) 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=lcrpnq/b6/hpdUjJ7BPbI1dg5z0iJwDYFP4cImRT74Q=; b=EBgRVvpATZd+QdllWh7NgaqS+BEpB4r+tKv0NcGj8T6IejQ3JSGblsVlM3JqSpvkUp KFswIxe3vj9uVxeHURFe7KHbkZfbgW5bpPj2+sz2YA5/jW2xsej+si7DyS+cHQnuFKpo Grytv0YQSoYqUtgbsgqWNtco4yYJYJU/3/kItHoEyRlzenpJIgYyjHD9vjzxocZOgYPn TGXazEmGe9xX8g35FKQZAe9OTufWqwCCCUsQdMEqjbOJR993VDCAfV4BipMoCXNtpAEn 8ob3I4Isj6uIVUuuo1HrvNHQT8xlcmUKu/UapSmtGiuvC/+nGD4eGDbki6Jg2Lrk4yAQ xqEA== 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=lcrpnq/b6/hpdUjJ7BPbI1dg5z0iJwDYFP4cImRT74Q=; b=gFJdf/cKT4Mi00WVKObpd2eNPhNyXTo6Yqyjed/L2/fyJLLO/omtZTCPPTaJ5/84dN uT3mLL/F46gTOCwTYWSNt9N201a+AzAmBQ9NiEAtQDOVLiDmBohUzl+vQ3fh9nmjOj+r 2/Kuro+hOuJDCzYCT22YpNp2CaHS+4owc9XhUwi6/r3llXqrbQiAW2YQdkBHH0da/jvk z/U54o0KCwksQOw7K0H1/m4tOLVIc5mhHv/THeebroVW/qknMTiYCXbkdLcG5HnBsX9J qu+6lQWM9q6WCMMSZZ8XjfaCIZU+W44sqQ6e8O3VOMC1XCMcba9nSlAKjfM+DQITEKIK GFrg== X-Gm-Message-State: APjAAAWQCMdySumLY8QCNZOnj6TkmmTeFnUORVUDOvkl7BPPfbOaOmix AAn0UUjoOE392DcAunIpH9g4AA== X-Received: by 2002:a17:90a:b386:: with SMTP id e6mr354511pjr.106.1582829229170; Thu, 27 Feb 2020 10:47:09 -0800 (PST) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id e2sm3343567pfh.151.2020.02.27.10.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 10:47:08 -0800 (PST) Date: Thu, 27 Feb 2020 11:47:06 -0700 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 3/6] remoteproc: sysmon: Inform current rproc about all active rprocs Message-ID: <20200227184706.GA20116@xps15> References: <1582167465-2549-1-git-send-email-sidgup@codeaurora.org> <1582167465-2549-4-git-send-email-sidgup@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1582167465-2549-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, Feb 19, 2020 at 06:57:42PM -0800, Siddharth Gupta wrote: > A remoteproc that has just recovered from a crash will not be aware of the > state of other remoteprocs. Send sysmon notifications on behalf of all the > active/online remoteprocs to the one that just booted up. > > Signed-off-by: Siddharth Gupta > --- > drivers/remoteproc/qcom_sysmon.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sysmon.c > index 851664e..d0d59d5 100644 > --- a/drivers/remoteproc/qcom_sysmon.c > +++ b/drivers/remoteproc/qcom_sysmon.c > @@ -457,6 +457,7 @@ 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 +465,17 @@ 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; > + ssctl_send_event(sysmon, &event); > + } > + mutex_unlock(&sysmon_lock); > + The changelog is specific about crash recovery but to me this code will run every time an MCU is switched on. If I understand correctly, in a crash recovery situation or simply an MCU coming on line, you want to make sure the subdevices associated to the booting (or recovering) MCU knows about subdevices that were registered with the sysmon_notifiers before it. If that is the case, the changelog needs to be modified and a good chunk of comments need to be added to this patch. Lastly, shouldn't there be a provision for sysmon->ssctl_version == 2? Thanks, Mathieu > return 0; > } > > -- > Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project