Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp386697rwd; Wed, 7 Jun 2023 01:02:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7G75OU8p2Az0msmA8KbI18Oo/LOInFQBprO17RNrmi0ZH3x2fJBIViOH/egmphBqvFy97/ X-Received: by 2002:a17:902:cec5:b0:1ae:6947:e63b with SMTP id d5-20020a170902cec500b001ae6947e63bmr5523840plg.16.1686124953099; Wed, 07 Jun 2023 01:02:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686124953; cv=none; d=google.com; s=arc-20160816; b=h1pHvFfTYKdjYqrfaF9IQHKnfy3mHYCqVJzJ93xLI95anFyR4SBUPqOPhQVbceXWYA SQd9ORgz7jkNjTOJjSiMGr3f0FWCow9i3pdLngozhkSQiXinthzHqBU8ZxEkN/13cQNb l98xLUBbO0pyK8XFb6tKvcR0n5ABIkSrsEGKdS4fUacAwpfL6uvLkOP3f+he/hushqsc Ma1Qdnuhh1aQj7NaiIBhA4ukIKztoTQZLZ+aSR5du8zGzqvncwdX1nciao8yRen43AVr x+5Kzhex6f1BJf0IBIOci/odrQ6Oye2Y0F1LI8/F0a62P3MlYr9sPYCuw8ILGi7LkIgQ 68Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=r7trNr0Ema86Rjx0WiKww+9mY0Izu55U1dJAyfFt4Fk=; b=IyV2CI8w6NdKYvkPOwl46rcyiZM5kCFx2Mesq6Lxq02lbwithOyvrL6j76M2mllgwX e842VTeRllFLrj+6l1VwijabpKDfvkuF/Hkh1M/Ev1hDMMQBV0FZvvMoqb55LMo7oQ6O UOSmV3CfAPf5+Pcm325BnEGmqqM6m0b4djTyteNwT77qEvTkGeDC0Di2t94MXgrZEbU3 CTSMpUqSLaFZwSrS2nPla55GJjzfEMi7UGaaQLF8i25/zVW2xZOB0Lxbo70zrqK3sde/ 1/ZOgStMY7Edx0w+B/eo4UActw8U3jShqjeUO24lkei+akpT4hJE0Z/AzD497/t9IbAd WT+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=YB4veNFv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j11-20020a170902690b00b001ae0691dfdbsi8268171plk.158.2023.06.07.01.02.12; Wed, 07 Jun 2023 01:02:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=YB4veNFv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239401AbjFGHvj (ORCPT + 99 others); Wed, 7 Jun 2023 03:51:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239393AbjFGHvC (ORCPT ); Wed, 7 Jun 2023 03:51:02 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C24A10D7; Wed, 7 Jun 2023 00:49:37 -0700 (PDT) Received: from [IPV6:2001:b07:2ed:14ed:a962:cd4d:a84:1eab] (unknown [IPv6:2001:b07:2ed:14ed:a962:cd4d:a84:1eab]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 1FA686606EF8; Wed, 7 Jun 2023 08:49:35 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1686124175; bh=btdp22YPcE4rcsqawF/Dzg9wpsgaMB/+rd1QkI94JJs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=YB4veNFvvKChhZJyxJdNkRiWGLv0BqdmQ2Jvm3MluU20wVsRbStjIAdp0YBsMIO1s UAmp5RRx0zee1Mj5aSasJlPssCpjLjs36+rwXH6g8L8h725EaOR+7J5o87rtgtNfSV p5Q6Vt6RVOkxeMQMju4jD81D56lvNb3FjvN7P+QAko0nbMF5plJk1JnYRgJx83+q7R jZtzKDNObC0D6o4zdZKJQNqiJTzFcoYhVJCTOVC5JRqoYPJn+oWMK45ykvmlYpZKC2 z3dfrTXRMsUYW1edEUalyb/rpyZa4V932lwbR6M8ZJNdmXyps6tLE1NE1Jn9CgAWGQ uJytNuNohHNnw== Message-ID: <3024a2a8-8e64-dfab-a9a3-0d4f51b345d9@collabora.com> Date: Wed, 7 Jun 2023 09:49:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH v13 07/11] remoteproc: mediatek: Add scp_boot_peers and scp_shutdown_peers operations Content-Language: en-US To: Tinghan Shen , Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger Cc: linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com References: <20230607072222.8628-1-tinghan.shen@mediatek.com> <20230607072222.8628-8-tinghan.shen@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20230607072222.8628-8-tinghan.shen@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 07/06/23 09:22, Tinghan Shen ha scritto: > Due to that SCP core 0 controls the SCP clock and SRAM power, add two > new mtk_scp_of_data operations, scp_boot_peers and scp_shutdown_peers, > to manage the boot sequence and watchdog timeout handling of SCP core 1. > It ensures that core 1 boots after or shuts down before core 0 for > maintaining the proper control flow over SCP core 1. > > Signed-off-by: Tinghan Shen > --- > drivers/remoteproc/mtk_common.h | 3 ++ > drivers/remoteproc/mtk_scp.c | 55 +++++++++++++++++++++++++++++++++ > 2 files changed, 58 insertions(+) > > diff --git a/drivers/remoteproc/mtk_common.h b/drivers/remoteproc/mtk_common.h > index 56395e8664cb..0bfd242c41cc 100644 > --- a/drivers/remoteproc/mtk_common.h > +++ b/drivers/remoteproc/mtk_common.h > @@ -93,6 +93,8 @@ struct mtk_scp_of_data { > void (*scp_reset_deassert)(struct mtk_scp *scp); > void (*scp_stop)(struct mtk_scp *scp); > void *(*scp_da_to_va)(struct mtk_scp *scp, u64 da, size_t len); > + void (*scp_boot_peers)(struct mtk_scp *scp); > + void (*scp_shutdown_peers)(struct mtk_scp *scp); > > u32 host_to_scp_reg; > u32 host_to_scp_int_bit; > @@ -130,6 +132,7 @@ struct mtk_scp { > struct rproc_subdev *rpmsg_subdev; > > struct list_head elem; > + struct list_head *cluster; > }; > > /** > diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c > index d644e232dfec..edbf71f4c21e 100644 > --- a/drivers/remoteproc/mtk_scp.c > +++ b/drivers/remoteproc/mtk_scp.c > @@ -74,8 +74,21 @@ void scp_put(struct mtk_scp *scp) > } > EXPORT_SYMBOL_GPL(scp_put); > > +static void mt8195_scp_shutdown_peers(struct mtk_scp *scp) > +{ > + struct mtk_scp *next_scp; > + > + next_scp = list_next_entry(scp, elem); > + list_for_each_entry_from(next_scp, scp->cluster, elem) { > + rproc_shutdown(next_scp->rproc); > + } braces are not needed here; after fixing that, Reviewed-by: AngeloGioacchino Del Regno