Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1769435rdb; Wed, 20 Sep 2023 21:15:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHm65ihjqwFxdQI0FYa5th6OFvuak7k29Dqz3DGGlQAVLZUJS+7ySyHy2uY2yzQC5jgXoQZ X-Received: by 2002:a05:6a21:3e0a:b0:14c:d105:2d16 with SMTP id bk10-20020a056a213e0a00b0014cd1052d16mr4043802pzc.32.1695269708488; Wed, 20 Sep 2023 21:15:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695269708; cv=none; d=google.com; s=arc-20160816; b=NTcDxF0YjK3fEYiL6nfPoUdZ5SM2crLX1tQJgfmxARr3T07AMWZCfCVU34fc/fiK8e DAMdO2mngGlzc9kcV9Lxw2z7+T6PbVtxB5M5wHe5OemcOtDFmGSwHd+B3uLPpCkPmnRk YtaUzaDVTuNVdj7z35i2sOqLXOwjkoi/zEIl0fZf5lPo5WZttNHtmT3Tgqdggj2VfnYU WoPtTGYLEImJLpcdp08p9aGTTaLvYBfO48ef9u2WIYzwcXX/xT2CQj2dIWnq+7Nkohd8 fbbEKBJpWINPGLVCmkE8E2yXIJDmnpMMh9oDSsocU90j0j5QqhbmrC4qJzP6CEcJN8aI nnkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/u+c/OyaKyOk11f46yXtObgpP9VhuVOVWmm05nxlM9E=; fh=rLw7XcMiPWPC8Fr0zjcO7MWNlfqDqt6pUNrPx/ajGmY=; b=cc5APo2VG2lcoibpUfL8NNRoRny6KGTTSoP1nK7ol1amFD6djBJ3Wu6e5jnVoQ7Q7t jFwBZDkKHgQpQeEe6OwIZAHkn4LFDkWOwIavlVFJ5ZbLWUA/fBVAhW4tldrO6UCgp3xy z3djSLlnojam+uQT7UBDBMYrJKDhjblHtqFJGLakdqHeqKfffc13BtoXrBcKaGZEJ0Au /xUdW+IXQ6FhoZ6lU9qAUTxW+wrgGtUi9goebyB/ux6q3paNdI2PG/yR2FUgYn8WpiVT QutunqhvVC0ZW/DfFVr80K9U9Qph3nKHNTSmH+8iJp00rd2c3Z9B113YYvMehD3ayKjK nreg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="I9LsKxu/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id p1-20020a17090adf8100b0027540ebd2absi2813345pjv.187.2023.09.20.21.15.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 21:15:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="I9LsKxu/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 52A2A82295EB; Wed, 20 Sep 2023 08:04:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236309AbjITPD7 (ORCPT + 99 others); Wed, 20 Sep 2023 11:03:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235680AbjITPD6 (ORCPT ); Wed, 20 Sep 2023 11:03:58 -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 A54C7AD; Wed, 20 Sep 2023 08:03:52 -0700 (PDT) Received: from localhost.localdomain (unknown [IPv6:2001:b07:646b:e2:e4be:399f:af39:e0db]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: laura.nao) by madras.collabora.co.uk (Postfix) with ESMTPSA id 43EEE66071DC; Wed, 20 Sep 2023 16:03:50 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1695222231; bh=0HPlpQakJrXjW7SQHdHHGKTtA1MdZ9XLz+FFXgI3KvA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I9LsKxu/5SkYzDko1gEYhQqW2EhOn2AaMzI4Uemgy9+L9fiLIEyKpJXwKApxOgBzr ZIwSSO45NeACSR5G5Vy0T1sE2+S9fixrrpQmdiw4JVapyZgQxMQDmYyQ+zwCkuTBEl 3DoTuwEJ5LVq/52PkVB69a/bCpAolPPdKKg5FVK53dkS2ECcAyKM2FKjoyRxuLVaUv MbmQB5fNUXM55rbnD4za8myRBz2CDnguAkYYOKVV9qXM5CuwYm6DOBCAdQqxTqwLO6 jY/swgWX97zvfIbZwltfnibPzqM9y7vf3rTpVeeCvJ0q1ajVjBGzeNFL8ogwarSBgI mER0f7sSEDxNw== From: Laura Nao To: angelogioacchino.delregno@collabora.com Cc: andersson@kernel.org, kernel@collabora.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-remoteproc@vger.kernel.org, mathieu.poirier@linaro.org, matthias.bgg@gmail.com, tinghan.shen@mediatek.com, wenst@chromium.org, Laura Nao Subject: Re: [PATCH] remoteproc: mediatek: Refactor single core check and fix retrocompatibility Date: Wed, 20 Sep 2023 17:03:32 +0200 Message-Id: <20230920150332.318851-1-laura.nao@collabora.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230919092336.51007-1-angelogioacchino.delregno@collabora.com> References: <20230919092336.51007-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 20 Sep 2023 08:04:13 -0700 (PDT) On 9/19/23 11:23, AngeloGioacchino Del Regno wrote: > In older devicetrees we had the ChromeOS EC in a node called "cros-ec" > instead of the newer "cros-ec-rpmsg", but this driver is now checking > only for the latter, breaking compatibility with those. > > Besides, we can check if the SCP is single or dual core by simply > walking through the children of the main SCP node and checking if > if there's more than one "mediatek,scp-core" compatible node. > > Fixes: 1fdbf0cdde98 ("remoteproc: mediatek: Probe SCP cluster on multi-core SCP") > Signed-off-by: AngeloGioacchino Del Regno > --- > drivers/remoteproc/mtk_scp.c | 18 +++++++----------- > 1 file changed, 7 insertions(+), 11 deletions(-) > Tested on asurada (spherion) and jacuzzi (juniper). The issue was detected by KernelCI, so: Reported-by: "kernelci.org bot" Tested-by: Laura Nao Thanks! Laura > diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c > index ea227b566c54..a35409eda0cf 100644 > --- a/drivers/remoteproc/mtk_scp.c > +++ b/drivers/remoteproc/mtk_scp.c > @@ -1144,29 +1144,25 @@ static int scp_add_multi_core(struct platform_device *pdev, > return ret; > } > > -static int scp_is_single_core(struct platform_device *pdev) > +static bool scp_is_single_core(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > struct device_node *np = dev_of_node(dev); > struct device_node *child; > + int num_cores = 0; > > - child = of_get_next_available_child(np, NULL); > - if (!child) > - return dev_err_probe(dev, -ENODEV, "No child node\n"); > + for_each_child_of_node(np, child) > + if (of_device_is_compatible(child, "mediatek,scp-core")) > + num_cores++; > > - of_node_put(child); > - return of_node_name_eq(child, "cros-ec-rpmsg"); > + return num_cores < 2; > } > > static int scp_cluster_init(struct platform_device *pdev, struct mtk_scp_of_cluster *scp_cluster) > { > int ret; > > - ret = scp_is_single_core(pdev); > - if (ret < 0) > - return ret; > - > - if (ret) > + if (scp_is_single_core(pdev)) > ret = scp_add_single_core(pdev, scp_cluster); > else > ret = scp_add_multi_core(pdev, scp_cluster);