Message ID | 20230324145557.27797-1-ddrokosov@sberdevices.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp690303vqo; Fri, 24 Mar 2023 08:01:32 -0700 (PDT) X-Google-Smtp-Source: AKy350Yv37mEio7IKTqGe45+jHsm8QRm9oU2eIrnKxuwvKqw00lzFl8QqTyz3/w/REGwv91LQuO7 X-Received: by 2002:a17:90b:3e84:b0:23f:91cf:58e1 with SMTP id rj4-20020a17090b3e8400b0023f91cf58e1mr3133137pjb.7.1679670092696; Fri, 24 Mar 2023 08:01:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679670092; cv=none; d=google.com; s=arc-20160816; b=V1Cp4zrk4v1zstlvZl+ain77ITfCxep300bEMgcV6dofrUoAryDdtCeMi/gCG9Za77 35LDF3NK067MMDCk1N1d4ClGB7zoYESXPN8tDlWDufRAD6JE9n99kZKMRoszM9lgzAFY gupOaeWxuKFE7zoXyeAMnNr4jqtDKsom3X6uGm9vsOq4yWcIi4YJcNO7TnKsWWoCytXL NSacd1yw7BsiqCsBuFh+YmeUViEKeUFAs6zzHukF6X3axTIcKYMjGLoaSUmE0ISLn171 sRWHRONHLk1yjFLJLf6prnwmK8Oo4KQQbHKgezIytZTiGt/OmvF63NKbjVP0vOq0YOq5 CBFA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=jKGFF0Da4+1cXaHKpDC/eneHomsmAiAzeGToPU73Ezw=; b=d0HqgL8+uvaOPP6xhgAwL41VQ6V27hr7YiSysNAH3Z7v+dZuHkPuZ6nKBAjS22bfTp VhnqFyPfuiSTn/vsY4dDEjizkQgS6g+yqUU60G5EeFtWkwKuFYnOOxVCkHW7TziiNLuS aUbj0/B1TIONHw1o9ozPUY1cwbhZ/ON0OiiNpgQWpw4A2gqC2ls6KSNBiKVLsrolTkCS lgV+2Fbz/LQvHn/umWmPkHGd17rqk3wcLXZRAnXqeIxbkYK//hnvnQEfVMdUVT6RRabW v7OSFq/q6DX903arCmfp/EmEYf+/w+krG0bMx722JeOGEC2DCILN6WG+BmDv+4WkV+Yx mrnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=n9hzZend; 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=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g11-20020a17090a300b00b00228e80888c9si58734pjb.14.2023.03.24.08.01.18; Fri, 24 Mar 2023 08:01:32 -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=@sberdevices.ru header.s=mail header.b=n9hzZend; 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=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232195AbjCXO4O (ORCPT <rfc822;ezelljr.billy@gmail.com> + 99 others); Fri, 24 Mar 2023 10:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231877AbjCXO4M (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 24 Mar 2023 10:56:12 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9513F2D5F; Fri, 24 Mar 2023 07:56:10 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 23C035FD35; Fri, 24 Mar 2023 17:56:08 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1679669768; bh=jKGFF0Da4+1cXaHKpDC/eneHomsmAiAzeGToPU73Ezw=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=n9hzZenddFoehGW/bLJK8iYJ1+F+cmLzgGNjzI05HGrl0Dbm9UYRrZOoPP09iAy7W gKUbM5uO2+5SDZWi16LZdE7mRi2Xxhg+Am1QSs0i3jd7ylClla2wTVMZjGex/WgZPY 6i4FOs0642yY94YTdoRTfq3LP7K3OmxroX4Auqy3TuNUwVZ7U7yvgzgt6H5PVaE6HJ hNf4Ehyy4P+32/cAZbdTXsJ/0vKUC18x3q5i8tRtA6fGnNKJS5dfr+6YcoJLzBeego XK2DWZGWgq7HkrcpsCyBvyjfuAeSM0N9gbR4gt6wOBYwxHe8yl9hCLa25DwLpUnnb5 o2xr2q6GEBeVA== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Fri, 24 Mar 2023 17:56:07 +0300 (MSK) From: Dmitry Rokosov <ddrokosov@sberdevices.ru> To: <krzysztof.kozlowski@linaro.org>, <robh@kernel.org>, <neil.armstrong@linaro.org>, <khilman@baylibre.com>, <jbrunet@baylibre.com>, <martin.blumenstingl@googlemail.com>, <jianxin.pan@amlogic.com> CC: <kernel@sberdevices.ru>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-amlogic@lists.infradead.org>, <devicetree@vger.kernel.org>, <rockosov@gmail.com>, Dmitry Rokosov <ddrokosov@sberdevices.ru> Subject: [PATCH v3] firmware: meson_sm: populate platform devices from sm device tree data Date: Fri, 24 Mar 2023 17:55:57 +0300 Message-ID: <20230324145557.27797-1-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/03/24 06:52:00 #21002836 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761258554333222843?= X-GMAIL-MSGID: =?utf-8?q?1761261747044518244?= |
Series |
[v3] firmware: meson_sm: populate platform devices from sm device tree data
|
|
Commit Message
Dmitry Rokosov
March 24, 2023, 2:55 p.m. UTC
In some meson boards, secure monitor device has children, for example,
power secure controller. By default, secure monitor isn't the bus in terms
of device tree subsystem, so the of_platform initialization code doesn't
populate its device tree data. As a result, secure monitor's children
aren't probed at all.
Run the 'of_platform_populate()' routine manually to resolve such issues.
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
---
Changes v3 since v2 at [2]:
- unmap meson sm shmem region if devm_of_platform_populate() failed
- move pr_info() log about successfully enabled secure-monitor to
the end of probe() routine
Changes v2 since v1 at [1]:
- decline the device tree /firmware based solution
- introduce devm_of_platform_populate() solution in the meson sm driver
Links:
[1] https://lore.kernel.org/all/20230323185548.13731-1-ddrokosov@sberdevices.ru/
[2] https://lore.kernel.org/linux-amlogic/20230324140141.6743-1-ddrokosov@sberdevices.ru/
---
drivers/firmware/meson/meson_sm.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
On Fri, Mar 24, 2023 at 3:56 PM Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote: > > In some meson boards, secure monitor device has children, for example, > power secure controller. By default, secure monitor isn't the bus in terms > of device tree subsystem, so the of_platform initialization code doesn't > populate its device tree data. As a result, secure monitor's children > aren't probed at all. > > Run the 'of_platform_populate()' routine manually to resolve such issues. > > Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru> Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Hi, On Fri, 24 Mar 2023 17:55:57 +0300, Dmitry Rokosov wrote: > In some meson boards, secure monitor device has children, for example, > power secure controller. By default, secure monitor isn't the bus in terms > of device tree subsystem, so the of_platform initialization code doesn't > populate its device tree data. As a result, secure monitor's children > aren't probed at all. > > Run the 'of_platform_populate()' routine manually to resolve such issues. > > [...] Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v6.4/drivers) [1/1] firmware: meson_sm: populate platform devices from sm device tree data https://git.kernel.org/amlogic/c/e45f243409db98d610248c843b25435e7fb0baf3 These changes has been applied on the intermediate git tree [1]. The v6.4/drivers branch will then be sent via a formal Pull Request to the Linux SoC maintainers for inclusion in their intermediate git branches in order to be sent to Linus during the next merge window, or sooner if it's a set of fixes. In the cases of fixes, those will be merged in the current release candidate kernel and as soon they appear on the Linux master branch they will be backported to the previous Stable and Long-Stable kernels [2]. The intermediate git branches are merged daily in the linux-next tree [3], people are encouraged testing these pre-release kernels and report issues on the relevant mailing-lists. If problems are discovered on those changes, please submit a signed-off-by revert patch followed by a corrective changeset. [1] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git [3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/meson_sm.c index 77aa5c6398aa..1a99dbc274fa 100644 --- a/drivers/firmware/meson/meson_sm.c +++ b/drivers/firmware/meson/meson_sm.c @@ -311,11 +311,14 @@ static int __init meson_sm_probe(struct platform_device *pdev) platform_set_drvdata(pdev, fw); - pr_info("secure-monitor enabled\n"); + if (devm_of_platform_populate(dev)) + goto out_in_base; if (sysfs_create_group(&pdev->dev.kobj, &meson_sm_sysfs_attr_group)) goto out_in_base; + pr_info("secure-monitor enabled\n"); + return 0; out_in_base: