[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20211209200657.GB35858@Asurada-Nvidia>
Date: Thu, 9 Dec 2021 12:06:57 -0800
From: Nicolin Chen <nicolinc@...dia.com>
To: Dmitry Osipenko <digetx@...il.com>
CC: <thierry.reding@...il.com>, <joro@...tes.org>, <will@...nel.org>,
<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
On Thu, Dec 09, 2021 at 10:58:15PM +0300, Dmitry Osipenko wrote:
> External email: Use caution opening links or attachments
>
>
> 09.12.2021 22:51, Nicolin Chen пишет:
> > On Thu, Dec 09, 2021 at 10:40:42PM +0300, Dmitry Osipenko wrote:
> >> External email: Use caution opening links or attachments
> >>
> >>
> >> 09.12.2021 22:32, Nicolin Chen пишет:
> >>> On Thu, Dec 09, 2021 at 05:47:18PM +0300, Dmitry Osipenko wrote:
> >>>> External email: Use caution opening links or attachments
> >>>>
> >>>>
> >>>> 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.
> >>> debugfs_create_dir returns ERR_PTR on failure. So here should be
> >>> to check !IS_ERR. Thanks for pointing it out!
> >>>
> >>
> >> All debugfs functions handle IS_ERR(). GregKH removes all such checks
> >> all over the kernel. So the check shouldn't be needed at all, please
> >> remove it if it's unneeded or prove that it's needed.
> >
> > debugfs_create_file can handle a NULL parent, but not ERR_PTR one,
> > and then it puts the new node under the root. So either passing an
> > ERR_PTR parent or creating orphan nodes here doesn't sound good...
> >
>
> What makes you say so? Please show the exact source code that will cause
> the problem.
>
> The smmu->debugfs_mappings can't ever be NULL and debugfs_create_file
> handles the ERR_PTR [1][2].
Ah...my tool jumps to start_creating in fs/tracefs/inode.c instead.
Thanks for the reply. I will remove the if line then.
Powered by blists - more mailing lists