[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200929011557.GA905@Asurada-Nvidia>
Date: Mon, 28 Sep 2020 18:15:57 -0700
From: Nicolin Chen <nicoleotsuka@...il.com>
To: Dmitry Osipenko <digetx@...il.com>
Cc: thierry.reding@...il.com, joro@...tes.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 v2 2/2] iommu/tegra-smmu: Expend mutex protection range
On Tue, Sep 29, 2020 at 03:17:58AM +0300, Dmitry Osipenko wrote:
> ...
> > static bool tegra_smmu_capable(enum iommu_cap cap)
> > @@ -420,17 +413,21 @@ static int tegra_smmu_as_prepare(struct tegra_smmu *smmu,
> > struct tegra_smmu_as *as)
> > {
> > u32 value;
> > - int err;
> > + int err = 0;
> > +
> > + mutex_lock(&smmu->lock);
> >
> > if (as->use_count > 0) {
> > as->use_count++;
> > - return 0;
> > + goto err_unlock;
>
> This looks a bit odd because it's not a error condition. Perhaps should
> be better to "goto bump_usecount"?
>
> Or make it similar to tegra_smmu_as_unprepare()?
Hmm...I think it's simple to just make it "goto unlock" then.
Powered by blists - more mailing lists