Message ID | 20231107052824.29418-1-amhetre@nvidia.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:aa0b:0:b0:403:3b70:6f57 with SMTP id k11csp28468vqo; Mon, 6 Nov 2023 21:29:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTr9UrDCQUR3677Wvvf2gVpuD0oBzCFszegVzDtnvnqSJw0UYqhy406XeDy3tbXy7liuFq X-Received: by 2002:a17:903:2286:b0:1cc:43ca:b5b3 with SMTP id b6-20020a170903228600b001cc43cab5b3mr29430036plh.28.1699334953365; Mon, 06 Nov 2023 21:29:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699334953; cv=pass; d=google.com; s=arc-20160816; b=dzuPUWMgj0MvZEFhgTeTrZRveN+/30UtXrO5NSGx0ZHw6vvzunO+oT51/pUDfIGkiT Lnbv2uKNMAut/Y51y3fAMDwBGBahz69cWtXiPjLslEPVnKCtH8WgHmV/kZeOfhl2+C1i ks7bYj0VrAXO7GVIHNAvJq6IeCJ008ejkwezNz401PTK95G2tH+djoE1Q9z30i/tdc0W Gh17mxeHtYwlTuA7ci0IfUGp5o8AsN3G213yHZGuxM4Ra4YXrErkHzfLCxbQyzuy6qok cm5XilSg6fks+HkrF+6IBF1/LPlbp6bQ0YkEXajbZ/3idnwA3QyaMjM+1AG1yvftpDFd aYrA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=nWkoOPQd9wEw4lwgt1r3Q9/dbemcT0u4OxkWteHSfQ4=; fh=crlTn9NTKez8TWLShAVSeRzgY6Hr6D9yRR7Yam9Ul9M=; b=j/41GnCMGnWboVr60l7YC6rCPMrGvonGLn40+FH0jMya/XTimRs0Z9HniN84Sa1uJb 00Px9+BbFO8WFHs3Y31zG+7wckd8AVVNSHmqZrD+Bz9QlYMP7YMinae+WhNP6moaYqbb LQXaKvgC+If1BcGJIbhtM4qHIqsHUYo5cdvdxPgZ3IxzGoBlhMmh/+0ahNEuBjo8kbpM fB36+N6holHLHd024RySPeoGy9taHErCyi/12QIWoYeAOY9j7nEPai7kGGmceK0O08DE LEbOL7qhkivbxX8v9ACe1Plitn+vMIYsVmhScZU6ykaL7wlkdgIEy7wcYZVn4tJpBDxG Q6zw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="SjV/dtke"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h4-20020a170902f54400b001b9c992945fsi10348616plf.555.2023.11.06.21.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 21:29:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="SjV/dtke"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5D340801B301; Mon, 6 Nov 2023 21:29:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233451AbjKGF3B (ORCPT <rfc822;heyuhang3455@gmail.com> + 33 others); Tue, 7 Nov 2023 00:29:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229558AbjKGF27 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 7 Nov 2023 00:28:59 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2070.outbound.protection.outlook.com [40.107.237.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6612D94; Mon, 6 Nov 2023 21:28:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eLk+TLJ+FyaliNWFJYw3GJfi8LIMxAS1nITWpjGDyMFxtxYaSyRkoOU9FLiLG2du06jkIXV3ASinQ0qVhKQjfg75HF45TrrOl6pj04HM9/z5yZpy/o8r/RA5b7/ebwHwtimBURYiDEjQ3+n08+966Mk+CZkgN4oYL13Y5MLzaES6g6bJ+JQAh7Qi3I1SvzB70bKCGqzAmci8Nka+BrN7p9gZttbbozzxo944KBMaTmYtYnbBaQgJiODXR+RR7EW1FIUu9f3eDB9AJfknroQpWgELdog0anya16qWZKDBvkPwxw7Fil4c4uvODuDv9Aa0OZ4egnrJ/vMAgNkiDuu7xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nWkoOPQd9wEw4lwgt1r3Q9/dbemcT0u4OxkWteHSfQ4=; b=D8APz58DME25NTQwYX6SBj3Y/Kjg9XDdhPWQ6FDm5j5poOoUl6pQk6SOQtIu0RLfXWQAOT2iDyouR5igg3Wl/SYnSR7ly58p/sjWfY5E4DWIfvnpHkf5pw/qW7zI32wxrK6uNA4mR8Sp5Z7hlThJ+XKS8BVevEEl1TeNtT9M+vYHHGSxJiI9jJGWP/WljiNpa0wNpL2H0i5syKJI7xohdKySK7DhAnNmTwgOqKeLs46q0MyBXmQTTFC6UufR9DSSAiva4U1VPGGa6J7c0WwQX7GpttPV2Wn3tBI5L26XfQdRA0dkWne0406nteqFCrD7Wh716o3TTgg/S2FWRZWCFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=linaro.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nWkoOPQd9wEw4lwgt1r3Q9/dbemcT0u4OxkWteHSfQ4=; b=SjV/dtkeGvc9yCGAO2YaN6YnBT78HeWWG0v+dzieQaRX3tMFdBTo30Ar3Z6dh0umjA8sJerQJs6ZwkmKCGOMVjMErbLvNDcKkrKxtQMUcdtD5Z2HU1/hIfuDlqfNebJsBo2MgCX39cvxPjmnr49kdivVGmnk1e4u5XsYrLaocYh6zEEyx/u6v/8urXdgm63QKnMKScPU38/pBIJCQK6hlZZCTyWONP2ZkNXJpNb18dsrJBn6XcXORtrIzETljetuM07TvDp6mL7Nv3z38k4kSU7yhDQiyNBAXYLxCK8cf1TM5bFOGIrJZqtMtGQAGAPWV15T3PvhrkTvBeagJqvKRA== Received: from DS7PR05CA0106.namprd05.prod.outlook.com (2603:10b6:8:56::24) by PH8PR12MB8605.namprd12.prod.outlook.com (2603:10b6:510:1cc::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Tue, 7 Nov 2023 05:28:52 +0000 Received: from DS3PEPF000099D8.namprd04.prod.outlook.com (2603:10b6:8:56:cafe::c7) by DS7PR05CA0106.outlook.office365.com (2603:10b6:8:56::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.16 via Frontend Transport; Tue, 7 Nov 2023 05:28:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DS3PEPF000099D8.mail.protection.outlook.com (10.167.17.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.16 via Frontend Transport; Tue, 7 Nov 2023 05:28:52 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 6 Nov 2023 21:28:39 -0800 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 6 Nov 2023 21:28:39 -0800 Received: from amhetre.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Mon, 6 Nov 2023 21:28:37 -0800 From: Ashish Mhetre <amhetre@nvidia.com> To: <krzysztof.kozlowski@linaro.org>, <thierry.reding@gmail.com>, <jonathanh@nvidia.com>, <dmitry.osipenko@collabora.com> CC: <linux-tegra@vger.kernel.org>, <linux-kernel@vger.kernel.org>, "Ashish Mhetre" <amhetre@nvidia.com> Subject: [PATCH 1/2] memory: tegra: Add SID override programming for MC clients Date: Tue, 7 Nov 2023 10:58:23 +0530 Message-ID: <20231107052824.29418-1-amhetre@nvidia.com> X-Mailer: git-send-email 2.17.1 X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D8:EE_|PH8PR12MB8605:EE_ X-MS-Office365-Filtering-Correlation-Id: 2105b388-b073-42c9-1635-08dbdf526dae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z+wD4Y3gyzP6J7Lvz9bTHHBuQX5ou/s/mBtTQko7hniweLocww3baAtJNMEO+p52x4wKefEgcxwlE8WWjAqpPhlgX4vtq+cTvA4wenpTngYkXrIqs5dvRgAYwNcHCEH2Vsk3GwKvrFrpk+yjhv+1odvEeh91PfJ/i4s2ZcbtJS2UnxbQ/zRYGT6kyM4QMUK6jcx0Rp21nep61aM6xcDEJAZoikgFlwprZ9TgB6MGtVlJulXtpLK4uI+GyQjF90YYvxVP9Zug8v3FUW5wB999jwkELoUu4ymOLALFOWZOki4sNszncXzkSs21oi0agWcrzcQRCHu4TTfHKaVZNVIeZJCoSxUhIA6DfyuRe827RyKOJXAPv6ZOgiHHTjclzbY1etqUoh4P3iC2TwG7k5Y/8Ld4u8cZVfkWDHp0mpi4dOo5zAcomVjnqsnLtnsTOGTfSefWkBwYa6U+lZXRhhwg/mK6nVLTGyfG3dRcnXZhH3vYr9ZmzApDV6oCgc46L7J6Y6lecQd9n9V/mlzZyItTXDKCHznX0+ldabYVpo/1ZiTwLEv/6N55vzLzTuNy3v9Yku6IhZRWnzOXl9gdx5p/ywD0/TL0kcwkEZ5yc74lZMPgxLMrjguEq2rztTrgCLY2K/xudpPNY+CjmEDNvZ4SVXVbEY3dqvipv8aQTCBwFJDAzLfHHIjkbz8zDh5jDi/jRl1Ee53jlsreqgPu2BaCPQ/b4orhiPwbpU/T9x2WWa9yVyFcIse/8bfwfksM895R X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(136003)(396003)(346002)(376002)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(82310400011)(46966006)(40470700004)(36840700001)(40460700003)(40480700001)(36756003)(4326008)(336012)(5660300002)(426003)(8936002)(8676002)(83380400001)(26005)(316002)(70586007)(70206006)(1076003)(110136005)(54906003)(36860700001)(2906002)(47076005)(41300700001)(478600001)(2616005)(6666004)(7696005)(107886003)(82740400003)(86362001)(356005)(7636003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2023 05:28:52.1932 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2105b388-b073-42c9-1635-08dbdf526dae X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099D8.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB8605 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 06 Nov 2023 21:29:12 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781881847746545834 X-GMAIL-MSGID: 1781881847746545834 |
Series |
[1/2] memory: tegra: Add SID override programming for MC clients
|
|
Commit Message
Ashish Mhetre
Nov. 7, 2023, 5:28 a.m. UTC
For some devices the bootloader/firmware may set up the device in
bypass. Memory clients like display needs kernel to program SID after
resume because bootloader/firmware programs the SID of display device to
bypass. In order to make sure that kernel IOMMU mappings for these
devices work after resume, add SID override programming support for all
memory clients on memory controller resume.
This partially reverts 'commit ef86b2c2807f ("memory: tegra: Remove
clients SID override programming")'
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
---
drivers/memory/tegra/tegra186.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
Comments
Hi Ashish,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tegra/for-next]
[also build test WARNING on linus/master v6.6 next-20231107]
[cannot apply to tegra-drm/drm/tegra/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Ashish-Mhetre/memory-tegra-Skip-SID-programming-if-SID-registers-aren-t-set/20231107-133149
base: https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
patch link: https://lore.kernel.org/r/20231107052824.29418-1-amhetre%40nvidia.com
patch subject: [PATCH 1/2] memory: tegra: Add SID override programming for MC clients
config: arm64-defconfig (https://download.01.org/0day-ci/archive/20231107/202311071607.IzbwSn2f-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231107/202311071607.IzbwSn2f-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311071607.IzbwSn2f-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/memory/tegra/tegra186.c: In function 'tegra186_mc_resume':
drivers/memory/tegra/tegra186.c:78:17: error: implicit declaration of function 'tegra186_mc_client_sid_override' [-Werror=implicit-function-declaration]
78 | tegra186_mc_client_sid_override(mc, client, client->sid);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/memory/tegra/tegra186.c: At top level:
>> drivers/memory/tegra/tegra186.c:85:13: warning: conflicting types for 'tegra186_mc_client_sid_override'; have 'void(struct tegra_mc *, const struct tegra_mc_client *, unsigned int)'
85 | static void tegra186_mc_client_sid_override(struct tegra_mc *mc,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/memory/tegra/tegra186.c:85:13: error: static declaration of 'tegra186_mc_client_sid_override' follows non-static declaration
drivers/memory/tegra/tegra186.c:78:17: note: previous implicit declaration of 'tegra186_mc_client_sid_override' with type 'void(struct tegra_mc *, const struct tegra_mc_client *, unsigned int)'
78 | tegra186_mc_client_sid_override(mc, client, client->sid);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +85 drivers/memory/tegra/tegra186.c
7355c7b9ae0d45 Thierry Reding 2021-06-02 70
142620fbbbbba0 Ashish Mhetre 2023-11-07 71 static int tegra186_mc_resume(struct tegra_mc *mc)
142620fbbbbba0 Ashish Mhetre 2023-11-07 72 {
142620fbbbbba0 Ashish Mhetre 2023-11-07 73 unsigned int i;
142620fbbbbba0 Ashish Mhetre 2023-11-07 74
142620fbbbbba0 Ashish Mhetre 2023-11-07 75 for (i = 0; i < mc->soc->num_clients; i++) {
142620fbbbbba0 Ashish Mhetre 2023-11-07 76 const struct tegra_mc_client *client = &mc->soc->clients[i];
142620fbbbbba0 Ashish Mhetre 2023-11-07 77
142620fbbbbba0 Ashish Mhetre 2023-11-07 @78 tegra186_mc_client_sid_override(mc, client, client->sid);
142620fbbbbba0 Ashish Mhetre 2023-11-07 79 }
142620fbbbbba0 Ashish Mhetre 2023-11-07 80
142620fbbbbba0 Ashish Mhetre 2023-11-07 81 return 0;
142620fbbbbba0 Ashish Mhetre 2023-11-07 82 }
142620fbbbbba0 Ashish Mhetre 2023-11-07 83
eaf89f1cd38cf7 Arnd Bergmann 2021-07-22 84 #if IS_ENABLED(CONFIG_IOMMU_API)
393d66fd2cacba Thierry Reding 2021-06-03 @85 static void tegra186_mc_client_sid_override(struct tegra_mc *mc,
393d66fd2cacba Thierry Reding 2021-06-03 86 const struct tegra_mc_client *client,
393d66fd2cacba Thierry Reding 2021-06-03 87 unsigned int sid)
393d66fd2cacba Thierry Reding 2021-06-03 88 {
393d66fd2cacba Thierry Reding 2021-06-03 89 u32 value, old;
393d66fd2cacba Thierry Reding 2021-06-03 90
393d66fd2cacba Thierry Reding 2021-06-03 91 value = readl(mc->regs + client->regs.sid.security);
393d66fd2cacba Thierry Reding 2021-06-03 92 if ((value & MC_SID_STREAMID_SECURITY_OVERRIDE) == 0) {
393d66fd2cacba Thierry Reding 2021-06-03 93 /*
393d66fd2cacba Thierry Reding 2021-06-03 94 * If the secure firmware has locked this down the override
393d66fd2cacba Thierry Reding 2021-06-03 95 * for this memory client, there's nothing we can do here.
393d66fd2cacba Thierry Reding 2021-06-03 96 */
393d66fd2cacba Thierry Reding 2021-06-03 97 if (value & MC_SID_STREAMID_SECURITY_WRITE_ACCESS_DISABLED)
393d66fd2cacba Thierry Reding 2021-06-03 98 return;
393d66fd2cacba Thierry Reding 2021-06-03 99
393d66fd2cacba Thierry Reding 2021-06-03 100 /*
393d66fd2cacba Thierry Reding 2021-06-03 101 * Otherwise, try to set the override itself. Typically the
393d66fd2cacba Thierry Reding 2021-06-03 102 * secure firmware will never have set this configuration.
393d66fd2cacba Thierry Reding 2021-06-03 103 * Instead, it will either have disabled write access to
393d66fd2cacba Thierry Reding 2021-06-03 104 * this field, or it will already have set an explicit
393d66fd2cacba Thierry Reding 2021-06-03 105 * override itself.
393d66fd2cacba Thierry Reding 2021-06-03 106 */
393d66fd2cacba Thierry Reding 2021-06-03 107 WARN_ON((value & MC_SID_STREAMID_SECURITY_OVERRIDE) == 0);
393d66fd2cacba Thierry Reding 2021-06-03 108
393d66fd2cacba Thierry Reding 2021-06-03 109 value |= MC_SID_STREAMID_SECURITY_OVERRIDE;
393d66fd2cacba Thierry Reding 2021-06-03 110 writel(value, mc->regs + client->regs.sid.security);
393d66fd2cacba Thierry Reding 2021-06-03 111 }
393d66fd2cacba Thierry Reding 2021-06-03 112
393d66fd2cacba Thierry Reding 2021-06-03 113 value = readl(mc->regs + client->regs.sid.override);
393d66fd2cacba Thierry Reding 2021-06-03 114 old = value & MC_SID_STREAMID_OVERRIDE_MASK;
393d66fd2cacba Thierry Reding 2021-06-03 115
393d66fd2cacba Thierry Reding 2021-06-03 116 if (old != sid) {
393d66fd2cacba Thierry Reding 2021-06-03 117 dev_dbg(mc->dev, "overriding SID %x for %s with %x\n", old,
393d66fd2cacba Thierry Reding 2021-06-03 118 client->name, sid);
393d66fd2cacba Thierry Reding 2021-06-03 119 writel(sid, mc->regs + client->regs.sid.override);
393d66fd2cacba Thierry Reding 2021-06-03 120 }
393d66fd2cacba Thierry Reding 2021-06-03 121 }
eaf89f1cd38cf7 Arnd Bergmann 2021-07-22 122 #endif
393d66fd2cacba Thierry Reding 2021-06-03 123
On 11/7/2023 2:46 PM, kernel test robot wrote: > External email: Use caution opening links or attachments > > > Hi Ashish, > > kernel test robot noticed the following build warnings: > > [auto build test WARNING on tegra/for-next] > [also build test WARNING on linus/master v6.6 next-20231107] > [cannot apply to tegra-drm/drm/tegra/for-next] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Ashish-Mhetre/memory-tegra-Skip-SID-programming-if-SID-registers-aren-t-set/20231107-133149 > base: https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next > patch link: https://lore.kernel.org/r/20231107052824.29418-1-amhetre%40nvidia.com > patch subject: [PATCH 1/2] memory: tegra: Add SID override programming for MC clients > config: arm64-defconfig (https://download.01.org/0day-ci/archive/20231107/202311071607.IzbwSn2f-lkp@intel.com/config) > compiler: aarch64-linux-gcc (GCC) 13.2.0 > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231107/202311071607.IzbwSn2f-lkp@intel.com/reproduce) > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot <lkp@intel.com> > | Closes: https://lore.kernel.org/oe-kbuild-all/202311071607.IzbwSn2f-lkp@intel.com/ > > All warnings (new ones prefixed by >>): > > drivers/memory/tegra/tegra186.c: In function 'tegra186_mc_resume': > drivers/memory/tegra/tegra186.c:78:17: error: implicit declaration of function 'tegra186_mc_client_sid_override' [-Werror=implicit-function-declaration] > 78 | tegra186_mc_client_sid_override(mc, client, client->sid); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/memory/tegra/tegra186.c: At top level: >>> drivers/memory/tegra/tegra186.c:85:13: warning: conflicting types for 'tegra186_mc_client_sid_override'; have 'void(struct tegra_mc *, const struct tegra_mc_client *, unsigned int)' > 85 | static void tegra186_mc_client_sid_override(struct tegra_mc *mc, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/memory/tegra/tegra186.c:85:13: error: static declaration of 'tegra186_mc_client_sid_override' follows non-static declaration > drivers/memory/tegra/tegra186.c:78:17: note: previous implicit declaration of 'tegra186_mc_client_sid_override' with type 'void(struct tegra_mc *, const struct tegra_mc_client *, unsigned int)' > 78 | tegra186_mc_client_sid_override(mc, client, client->sid); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > cc1: some warnings being treated as errors > Fixed all of the warnings and errors in V2 of this series. V1 wasn't applied properly in our testing because of which these build errors weren't caught. Sorry for sending V1 with build issues. Please use V2 of this series for the reviews. Thanks and Regards, Ashish Mhetre > vim +85 drivers/memory/tegra/tegra186.c > > 7355c7b9ae0d45 Thierry Reding 2021-06-02 70 > 142620fbbbbba0 Ashish Mhetre 2023-11-07 71 static int tegra186_mc_resume(struct tegra_mc *mc) > 142620fbbbbba0 Ashish Mhetre 2023-11-07 72 { > 142620fbbbbba0 Ashish Mhetre 2023-11-07 73 unsigned int i; > 142620fbbbbba0 Ashish Mhetre 2023-11-07 74 > 142620fbbbbba0 Ashish Mhetre 2023-11-07 75 for (i = 0; i < mc->soc->num_clients; i++) { > 142620fbbbbba0 Ashish Mhetre 2023-11-07 76 const struct tegra_mc_client *client = &mc->soc->clients[i]; > 142620fbbbbba0 Ashish Mhetre 2023-11-07 77 > 142620fbbbbba0 Ashish Mhetre 2023-11-07 @78 tegra186_mc_client_sid_override(mc, client, client->sid); > 142620fbbbbba0 Ashish Mhetre 2023-11-07 79 } > 142620fbbbbba0 Ashish Mhetre 2023-11-07 80 > 142620fbbbbba0 Ashish Mhetre 2023-11-07 81 return 0; > 142620fbbbbba0 Ashish Mhetre 2023-11-07 82 } > 142620fbbbbba0 Ashish Mhetre 2023-11-07 83 > eaf89f1cd38cf7 Arnd Bergmann 2021-07-22 84 #if IS_ENABLED(CONFIG_IOMMU_API) > 393d66fd2cacba Thierry Reding 2021-06-03 @85 static void tegra186_mc_client_sid_override(struct tegra_mc *mc, > 393d66fd2cacba Thierry Reding 2021-06-03 86 const struct tegra_mc_client *client, > 393d66fd2cacba Thierry Reding 2021-06-03 87 unsigned int sid) > 393d66fd2cacba Thierry Reding 2021-06-03 88 { > 393d66fd2cacba Thierry Reding 2021-06-03 89 u32 value, old; > 393d66fd2cacba Thierry Reding 2021-06-03 90 > 393d66fd2cacba Thierry Reding 2021-06-03 91 value = readl(mc->regs + client->regs.sid.security); > 393d66fd2cacba Thierry Reding 2021-06-03 92 if ((value & MC_SID_STREAMID_SECURITY_OVERRIDE) == 0) { > 393d66fd2cacba Thierry Reding 2021-06-03 93 /* > 393d66fd2cacba Thierry Reding 2021-06-03 94 * If the secure firmware has locked this down the override > 393d66fd2cacba Thierry Reding 2021-06-03 95 * for this memory client, there's nothing we can do here. > 393d66fd2cacba Thierry Reding 2021-06-03 96 */ > 393d66fd2cacba Thierry Reding 2021-06-03 97 if (value & MC_SID_STREAMID_SECURITY_WRITE_ACCESS_DISABLED) > 393d66fd2cacba Thierry Reding 2021-06-03 98 return; > 393d66fd2cacba Thierry Reding 2021-06-03 99 > 393d66fd2cacba Thierry Reding 2021-06-03 100 /* > 393d66fd2cacba Thierry Reding 2021-06-03 101 * Otherwise, try to set the override itself. Typically the > 393d66fd2cacba Thierry Reding 2021-06-03 102 * secure firmware will never have set this configuration. > 393d66fd2cacba Thierry Reding 2021-06-03 103 * Instead, it will either have disabled write access to > 393d66fd2cacba Thierry Reding 2021-06-03 104 * this field, or it will already have set an explicit > 393d66fd2cacba Thierry Reding 2021-06-03 105 * override itself. > 393d66fd2cacba Thierry Reding 2021-06-03 106 */ > 393d66fd2cacba Thierry Reding 2021-06-03 107 WARN_ON((value & MC_SID_STREAMID_SECURITY_OVERRIDE) == 0); > 393d66fd2cacba Thierry Reding 2021-06-03 108 > 393d66fd2cacba Thierry Reding 2021-06-03 109 value |= MC_SID_STREAMID_SECURITY_OVERRIDE; > 393d66fd2cacba Thierry Reding 2021-06-03 110 writel(value, mc->regs + client->regs.sid.security); > 393d66fd2cacba Thierry Reding 2021-06-03 111 } > 393d66fd2cacba Thierry Reding 2021-06-03 112 > 393d66fd2cacba Thierry Reding 2021-06-03 113 value = readl(mc->regs + client->regs.sid.override); > 393d66fd2cacba Thierry Reding 2021-06-03 114 old = value & MC_SID_STREAMID_OVERRIDE_MASK; > 393d66fd2cacba Thierry Reding 2021-06-03 115 > 393d66fd2cacba Thierry Reding 2021-06-03 116 if (old != sid) { > 393d66fd2cacba Thierry Reding 2021-06-03 117 dev_dbg(mc->dev, "overriding SID %x for %s with %x\n", old, > 393d66fd2cacba Thierry Reding 2021-06-03 118 client->name, sid); > 393d66fd2cacba Thierry Reding 2021-06-03 119 writel(sid, mc->regs + client->regs.sid.override); > 393d66fd2cacba Thierry Reding 2021-06-03 120 } > 393d66fd2cacba Thierry Reding 2021-06-03 121 } > eaf89f1cd38cf7 Arnd Bergmann 2021-07-22 122 #endif > 393d66fd2cacba Thierry Reding 2021-06-03 123 > > -- > 0-DAY CI Kernel Test Service > https://github.com/intel/lkp-tests/wiki
On 07/11/2023 12:40, Ashish Mhetre wrote: > > On 11/7/2023 2:46 PM, kernel test robot wrote: >> External email: Use caution opening links or attachments >> >> >> Hi Ashish, >> >> kernel test robot noticed the following build warnings: >> >> [auto build test WARNING on tegra/for-next] >> [also build test WARNING on linus/master v6.6 next-20231107] >> [cannot apply to tegra-drm/drm/tegra/for-next] >> [If your patch is applied to the wrong git tree, kindly drop us a note. >> And when submitting patch, we suggest to use '--base' as documented in >> https://git-scm.com/docs/git-format-patch#_base_tree_information] >> >> url: https://github.com/intel-lab-lkp/linux/commits/Ashish-Mhetre/memory-tegra-Skip-SID-programming-if-SID-registers-aren-t-set/20231107-133149 >> base: https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next >> patch link: https://lore.kernel.org/r/20231107052824.29418-1-amhetre%40nvidia.com >> patch subject: [PATCH 1/2] memory: tegra: Add SID override programming for MC clients >> config: arm64-defconfig (https://download.01.org/0day-ci/archive/20231107/202311071607.IzbwSn2f-lkp@intel.com/config) >> compiler: aarch64-linux-gcc (GCC) 13.2.0 >> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231107/202311071607.IzbwSn2f-lkp@intel.com/reproduce) >> >> If you fix the issue in a separate patch/commit (i.e. not just a new version of >> the same patch/commit), kindly add following tags >> | Reported-by: kernel test robot <lkp@intel.com> >> | Closes: https://lore.kernel.org/oe-kbuild-all/202311071607.IzbwSn2f-lkp@intel.com/ >> >> All warnings (new ones prefixed by >>): >> >> drivers/memory/tegra/tegra186.c: In function 'tegra186_mc_resume': >> drivers/memory/tegra/tegra186.c:78:17: error: implicit declaration of function 'tegra186_mc_client_sid_override' [-Werror=implicit-function-declaration] >> 78 | tegra186_mc_client_sid_override(mc, client, client->sid); >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/memory/tegra/tegra186.c: At top level: >>>> drivers/memory/tegra/tegra186.c:85:13: warning: conflicting types for 'tegra186_mc_client_sid_override'; have 'void(struct tegra_mc *, const struct tegra_mc_client *, unsigned int)' >> 85 | static void tegra186_mc_client_sid_override(struct tegra_mc *mc, >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/memory/tegra/tegra186.c:85:13: error: static declaration of 'tegra186_mc_client_sid_override' follows non-static declaration >> drivers/memory/tegra/tegra186.c:78:17: note: previous implicit declaration of 'tegra186_mc_client_sid_override' with type 'void(struct tegra_mc *, const struct tegra_mc_client *, unsigned int)' >> 78 | tegra186_mc_client_sid_override(mc, client, client->sid); >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> cc1: some warnings being treated as errors >> > Fixed all of the warnings and errors in V2 of this series. > V1 wasn't applied properly in our testing because of which these build I would suggest to test what you develop, not apply it somewhere else. Unless you develop on entirely different tree, but then this is the problem. > errors weren't caught. Sorry for sending V1 with build issues. Please > use V2 of this series for the reviews. One version per day. Anyway you could wait till merge window finishes. Nothing is going to happen with your patch now. Best regards, Krzysztof
diff --git a/drivers/memory/tegra/tegra186.c b/drivers/memory/tegra/tegra186.c index 533f85a4b2bd..bd8cecc3cde2 100644 --- a/drivers/memory/tegra/tegra186.c +++ b/drivers/memory/tegra/tegra186.c @@ -68,6 +68,19 @@ static void tegra186_mc_remove(struct tegra_mc *mc) of_platform_depopulate(mc->dev); } +static int tegra186_mc_resume(struct tegra_mc *mc) +{ + unsigned int i; + + for (i = 0; i < mc->soc->num_clients; i++) { + const struct tegra_mc_client *client = &mc->soc->clients[i]; + + tegra186_mc_client_sid_override(mc, client, client->sid); + } + + return 0; +} + #if IS_ENABLED(CONFIG_IOMMU_API) static void tegra186_mc_client_sid_override(struct tegra_mc *mc, const struct tegra_mc_client *client, @@ -139,6 +152,7 @@ static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev) const struct tegra_mc_ops tegra186_mc_ops = { .probe = tegra186_mc_probe, .remove = tegra186_mc_remove, + .resume = tegra186_mc_resume, .probe_device = tegra186_mc_probe_device, .handle_irq = tegra30_mc_handle_irq, };