[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5713902d-823b-63ca-00c9-aa6c64c1af41@gmail.com>
Date: Thu, 9 Dec 2021 17:47:18 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Nicolin Chen <nicolinc@...dia.com>, thierry.reding@...il.com,
joro@...tes.org, will@...nel.org
Cc: vdumpa@...dia.com, jonathanh@...dia.com,
linux-tegra@...r.kernel.org, iommu@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8 6/6] iommu/tegra-smmu: Add pagetable mappings to
debugfs
09.12.2021 10:38, Nicolin Chen пишет:
> @@ -545,6 +719,15 @@ static void tegra_smmu_detach_as(struct tegra_smmu *smmu,
> if (group->swgrp != swgrp)
> continue;
> group->as = NULL;
> +
> + if (smmu->debugfs_mappings) {
Do we really need this check?
Looks like all debugfs_create_dir() usages in this driver are incorrect,
that function never returns NULL. Please fix this.
> + struct dentry *d;
The file name is wrong here.
if (group->soc)
name = group->soc->name;
else
name = group->swgrp->name;
> + d = debugfs_lookup(group->swgrp->name,
> + smmu->debugfs_mappings);
> + debugfs_remove(d);
> + }
This now looks problematic to me. You created debugfs file when the
first member of the shared group was attached to AS, now you remove this
file when any device is detached. The shared debugfs file should be
refcounted or something.
Powered by blists - more mailing lists