Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1811622pxb; Fri, 5 Feb 2021 01:55:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzaNxKL/KFjgn9fkboloDvz9A+999225KAsF8EyZnnsc491pyR4LTja5a/qjCdoyDkvaFSm X-Received: by 2002:a17:906:43d7:: with SMTP id j23mr3268343ejn.519.1612518916790; Fri, 05 Feb 2021 01:55:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612518916; cv=none; d=google.com; s=arc-20160816; b=g/RSTqBr9mQY/m/Ynrd13SScEUjl4uzj/UWFA/8JkZL+DYbe6Y64NgbvcbYFIZprnd QzCnsLYxt4P9np1p9NwKzEEYXpDFfjJbew9RQCNCpT5dwdN8WRNrjaRf0x7/frvB2KXd b/yyYhYZtNE7ouAECsSvpbzk4m1uhMjFs1/W2RMlMzLyV8M3rER+kts1KNHdWehytXeI Rd6rFjVaEw76doGY+fORDV250r7NJ1fcAlMQlsRSKbgK1fiwJq1RH1epu6i01Dlb7c2t Yu6S1K0zcoDxMdcK6STgS3oPaqRTrDfSeGFP1C+KpKi31ewJcpv5E3Ew2r9lVkLI1JxV 9wnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Ij/h85oXJKLKfOyNytBFaR/zwWNpKnRCXwdnAmKNlzA=; b=L7EStp75aO7qa23OrHdm2PYXm92F6yg6jUCSrh/v1K9RGNLElisl7q+TIplrPy2Dd0 +3upqbe/yyHfHgDsmMQM3u7mRi6RiqwvdZ+x4NZREuw1sM7TFRzteyJsEZVPefelxngF ntYnDasjhNYUrjDsGtX5s8EouMEqxIKG0xo4XdHFPoK3M91gx96LSZ8JUxg8WJcAGXAt Tgw+PT3UAa4Wai717JUCaba+f92QU/g9wEXVjE62x7zEFTAK0nenL1UlNnFaRKoPdN8i /fN8vc+tRkoyKIB8SDkVWzeYjooHnmeg+ZhWzxhdeyHzz7UrJa7EQWdaevBs95MF48C9 vDdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FyF9PPnS; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si6285113edv.513.2021.02.05.01.54.51; Fri, 05 Feb 2021 01:55:16 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FyF9PPnS; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230070AbhBEJyB (ORCPT + 99 others); Fri, 5 Feb 2021 04:54:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbhBEJqc (ORCPT ); Fri, 5 Feb 2021 04:46:32 -0500 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11421C0617AB; Fri, 5 Feb 2021 01:45:17 -0800 (PST) Received: by mail-pf1-x42e.google.com with SMTP id q131so3955135pfq.10; Fri, 05 Feb 2021 01:45:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Ij/h85oXJKLKfOyNytBFaR/zwWNpKnRCXwdnAmKNlzA=; b=FyF9PPnS5DuNfyg1/r5SwuLubGJE9DhIHqi0HstEy7Q26ja32WJclNimxmWBKfmYZe OOS0VirmPcRQJZU4SX+vYFm6FQ6cL3L86h8N40BvZTUq/RW5IJFLczEX4nb1ROXlkCX/ SZlLoOw627cl6PEB4XZXoq/eI+kicCRu9MxLL11TIB5WzAiqf0QQ2OUXKtvSrnnlJXR6 57DY7CMEtOGpSE0pIPa+dE20xIwHVwVoPf/H5vXWAmshPQ+iVZeFxwXu14hwIO2Hxlie 9IRF8WCdIqXysd7CwKv/Vbh4xkiKlFozWKfFCF8WsdFwpopJg2LNecPa9UrO9VoCEn7H D4IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Ij/h85oXJKLKfOyNytBFaR/zwWNpKnRCXwdnAmKNlzA=; b=BF3YQ55j9b+Irb9z7hGdc99irXOaQrj9Rm790L2W2aI9uNTJJvdSIuBz40EOsZkzbg FpY/wV8WGfkssftEXT7/Ijbu7l4MNtQAAMUAwivIKLLriBkrEywOLwBtbod9A7id/bYr zz03iy+bhIS7z5slD94rbG3/Ri/xchFz+bRHEzHHQPeZ81mNSWJ6TfXF6m97ERvdBZi3 GTo0EF43ze+9qA+13ZbQ301WmQnNrQTchlJREi1lhSDqi18XSaLibL/7VSqsE/dEoH2g F3OnvK2GqrS4A5gE4z6XKl/ky1Cwx/hnhOw8Cd0lzrJPhs2fHBcBpagv8clpC70fPT3U /Lxg== X-Gm-Message-State: AOAM531nONRK34RjaQbWIG6onKkDyS7g6Up7zOWEdVRF5eKCNhsWps75 MWks+HS/CnmwBa79wzEW5PY= X-Received: by 2002:a62:1a06:0:b029:1bc:21e:ed47 with SMTP id a6-20020a621a060000b02901bc021eed47mr3598773pfa.40.1612518316620; Fri, 05 Feb 2021 01:45:16 -0800 (PST) Received: from Asurada-Nvidia (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id c5sm8805679pfi.5.2021.02.05.01.45.15 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 01:45:16 -0800 (PST) Date: Fri, 5 Feb 2021 01:45:57 -0800 From: Nicolin Chen To: Guillaume Tucker Cc: will@kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-tegra@vger.kernel.org, jonathanh@nvidia.com, vdumpa@nvidia.com, thierry.reding@gmail.com, joro@8bytes.org, kernel@collabora.com, Dmitry Osipenko , "kernelci-results@groups.io" Subject: Re: [PATCH RESEND v2 4/5] iommu/tegra-smmu: Rework tegra_smmu_probe_device() Message-ID: <20210205094556.GA32677@Asurada-Nvidia> References: <20201125101013.14953-1-nicoleotsuka@gmail.com> <20201125101013.14953-5-nicoleotsuka@gmail.com> <46a96cf9-91cc-2ad4-702a-e95ba7200375@collabora.com> <20210205052422.GA11329@Asurada-Nvidia> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: <20210205052422.GA11329@Asurada-Nvidia> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Guillaume, On Thu, Feb 04, 2021 at 09:24:23PM -0800, Nicolin Chen wrote: > > Please let us know if you need any help debugging this issue or > > to try a fix on this platform. > > Yes, I don't have any Tegra124 platform to run. It'd be very nice > if you can run some debugging patch (I can provide you) and a fix > after I root cause the issue. Would it be possible for you to run with the given debugging patch? It'd be nicer if I can get both logs of the vanilla kernel (failing) and the commit-reverted version (passing), each applying this patch. Thanks in advance! Nicolin --EVF5PPMfhYS0aIcm Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-iommu-debug-tegra-smmu.patch" From 80f288d7101101fca0412c5c200cea7e203a675d Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Fri, 5 Feb 2021 01:41:07 -0800 Subject: [PATCH] iommu: debug tegra-smmu Signed-off-by: Nicolin Chen --- drivers/iommu/tegra-smmu.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 4a3f095a1c26..796b7df54b8f 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -363,6 +363,7 @@ static void tegra_smmu_enable(struct tegra_smmu *smmu, unsigned int swgroup, value |= SMMU_ASID_VALUE(asid); value |= SMMU_ASID_ENABLE; smmu_writel(smmu, value, group->reg); + pr_alert("--------%s, swgroup %d: writing %x to reg1 %x\n", __func__, swgroup, value, group->reg); } else { pr_warn("%s group from swgroup %u not found\n", __func__, swgroup); @@ -379,6 +380,7 @@ static void tegra_smmu_enable(struct tegra_smmu *smmu, unsigned int swgroup, value = smmu_readl(smmu, client->smmu.reg); value |= BIT(client->smmu.bit); smmu_writel(smmu, value, client->smmu.reg); + pr_alert("--------%s, swgroup %d: writing %x to reg2 %x\n", __func__, swgroup, value, client->smmu.reg); } } @@ -491,13 +493,19 @@ static int tegra_smmu_attach_dev(struct iommu_domain *domain, unsigned int index; int err; + dev_alert(dev, "-------%s: smmu %s\n", __func__, smmu ? "valid" : "NULL"); + dump_stack(); if (!fwspec) return -ENOENT; + dev_alert(dev, "-------%s: fwspec->num_ids %d\n", __func__, fwspec->num_ids); for (index = 0; index < fwspec->num_ids; index++) { err = tegra_smmu_as_prepare(smmu, as); - if (err) + if (err) { + dev_err(dev, "failed to prepare as(%d) for fwspec %d", + as->id, fwspec->ids[index]); goto disable; + } tegra_smmu_enable(smmu, fwspec->ids[index], as->id); } @@ -805,6 +813,8 @@ static struct iommu_device *tegra_smmu_probe_device(struct device *dev) if (!smmu) return ERR_PTR(-ENODEV); + dev_alert(dev, "--------%s, %d\n", __func__, __LINE__); + dump_stack(); return &smmu->iommu; } @@ -904,6 +914,8 @@ static int tegra_smmu_of_xlate(struct device *dev, dev_iommu_priv_set(dev, mc->smmu); + dev_alert(dev, "-------%s: id %d", __func__, id); + dump_stack(); return iommu_fwspec_add_ids(dev, &id, 1); } -- 2.17.1 --EVF5PPMfhYS0aIcm--