Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1592798pxb; Mon, 22 Feb 2021 06:11:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJynCs70KEbG1UaqfGb5HJqrBJEL8whw4Ytv/3Xhc5t11+dIA2zOifpdRWqXYx4Ly5333GhR X-Received: by 2002:a17:906:68e:: with SMTP id u14mr20318187ejb.380.1614003093932; Mon, 22 Feb 2021 06:11:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614003093; cv=none; d=google.com; s=arc-20160816; b=FfqkZ0TdVgdeK2GLBgXKxrKGp9lfE4vq3z63p16c5AjMHa77KshlAYezKjzX7bgLVS OYAshS1tLwgK696FG5f4tsAQNx3JhU0NYmDh+VsEuPEnu2yWFmG7j377G2mG24WuyNUG wI57fO7ixsdQHWYfkltl0Ep0V/SbE62ONbLRDRLHYn/FMbrC3iSrkrNEpKU5X3eXpOur hCi11v0XKMRySs9vpTr2/fh7ONCRH1nvbVdjUf6dOAMpCH2dBDc/b5dhdH6UqXK1LbOG PtctVMBNceLFa6FZya8k70mKYv/nxgfgN6lueNdVa8++ny5EhWg4w+DfKP/Xhx1HMPiE TgwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=vTvz1Rlh+a/xm1qU+/h7ftcmlRtB57uODsxUw7FcbpY=; b=pfFvDMd1BSZY9dLcGCzgnkBbQWPzBriys9d03zgclChgWq0Kut93vjKJkzE7QPjrwo YmeAZdehOV7PU1Y4t7Xz0CyD+x6rrWjLDeY+bWbgiWCf8237V13PI5KFjcFlnJt9tDKT j58QivYz05eomjR3Fs4iiT/p6LdovvCD8/GUqnmO4DlB8TjfdDlmu3JQPaicdKDGnr8v aekP3svMNHO5liJcX3qyZG68pytime82iBJ93KdqIhst07JFxocMlUsfRxQzlgxVETvh Tv4nGOfaz0pcLR2bIIRveQBDdaeWG033PmYpoCDo1Vx758v5IibEfJUvlLnX1Uv+VA52 L4uQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i23si12638428ejj.317.2021.02.22.06.11.11; Mon, 22 Feb 2021 06:11:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230364AbhBVOHl (ORCPT + 99 others); Mon, 22 Feb 2021 09:07:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231481AbhBVNQ1 (ORCPT ); Mon, 22 Feb 2021 08:16:27 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3776C061574; Mon, 22 Feb 2021 05:15:44 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gtucker) with ESMTPSA id 4087B1F44D43 Subject: Re: [PATCH] iommu/tegra-smmu: Fix mc errors on tegra124-nyan To: Nicolin Chen , joro@8bytes.org, thierry.reding@gmail.com, will@kernel.org Cc: vdumpa@nvidia.com, jonathanh@nvidia.com, digetx@gmail.com, linux-tegra@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Collabora Kernel ML References: <20210218220702.1962-1-nicoleotsuka@gmail.com> From: Guillaume Tucker Message-ID: <7a664911-41bf-2647-716d-0836acd8078a@collabora.com> Date: Mon, 22 Feb 2021 13:15:41 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210218220702.1962-1-nicoleotsuka@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/02/2021 22:07, Nicolin Chen wrote: > Commit 25938c73cd79 ("iommu/tegra-smmu: Rework tegra_smmu_probe_device()") > removed certain hack in the tegra_smmu_probe() by relying on IOMMU core to > of_xlate SMMU's SID per device, so as to get rid of tegra_smmu_find() and > tegra_smmu_configure() that are typically done in the IOMMU core also. > > This approach works for both existing devices that have DT nodes and other > devices (like PCI device) that don't exist in DT, on Tegra210 and Tegra3 > upon testing. However, Page Fault errors are reported on tegra124-Nyan: > > tegra-mc 70019000.memory-controller: display0a: read @0xfe056b40: > EMEM address decode error (SMMU translation error [--S]) > tegra-mc 70019000.memory-controller: display0a: read @0xfe056b40: > Page fault (SMMU translation error [--S]) > > After debugging, I found that the mentioned commit changed some function > callback sequence of tegra-smmu's, resulting in enabling SMMU for display > client before display driver gets initialized. I couldn't reproduce exact > same issue on Tegra210 as Tegra124 (arm-32) differs at arch-level code. > > Actually this Page Fault is a known issue, as on most of Tegra platforms, > display gets enabled by the bootloader for the splash screen feature, so > it keeps filling the framebuffer memory. A proper fix to this issue is to > 1:1 linear map the framebuffer memory to IOVA space so the SMMU will have > the same address as the physical address in its page table. Yet, Thierry > has been working on the solution above for a year, and it hasn't merged. > > Therefore, let's partially revert the mentioned commit to fix the errors. > > The reason why we do a partial revert here is that we can still set priv > in ->of_xlate() callback for PCI devices. Meanwhile, devices existing in > DT, like display, will go through tegra_smmu_configure() at the stage of > bus_set_iommu() when SMMU gets probed(), as what it did before we merged > the mentioned commit. > > Once we have the linear map solution for framebuffer memory, this change > can be cleaned away. > > [Big thank to Guillaume who reported and helped debugging/verification] > > Fixes: 25938c73cd79 ("iommu/tegra-smmu: Rework tegra_smmu_probe_device()") > Reported-by: Guillaume Tucker You're welcome. I would actually prefer to see it as reported by kernelci.org since I wouldn't have found it without the automated testing and bisection. If you're OK to change this trailer: Reported-by: "kernelci.org bot" > Signed-off-by: Nicolin Chen > --- > > Guillaume, would you please give a "Tested-by" to this change? Thanks! Sure. https://lava.collabora.co.uk/scheduler/job/3249387 Tested-by: Guillaume Tucker Thanks, Guillaume