iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Nicolin Chen <nicoleotsuka@gmail.com>,
	thierry.reding@gmail.com, joro@8bytes.org
Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	jonathanh@nvidia.com, hch@infradead.org,
	linux-tegra@vger.kernel.org
Subject: Re: [PATCH v4 2/2] iommu/tegra-smmu: Expand mutex protection range
Date: Tue, 29 Sep 2020 20:42:52 +0300	[thread overview]
Message-ID: <184163e9-01d4-dcc5-0adf-a3d175e56f16@gmail.com> (raw)
In-Reply-To: <20200929061325.10197-3-nicoleotsuka@gmail.com>

29.09.2020 09:13, Nicolin Chen пишет:
> This is used to protect potential race condition at use_count.
> since probes of client drivers, calling attach_dev(), may run
> concurrently.
> 
> Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
> ---

It's always better not to mix success and error code paths in order to
keep code readable, but not a big deal in the case of this particular
patch since the changed code is quite simple. Please try to avoid doing
this in the future patches.

Also, please note that in general it's better to use locked/unlocked
versions for the functions like it's already done for
tegra_smmu_map/unmap, this will remove the need to maintain lockings in
the code. The code touched by this patch doesn't have complicated code
paths, so it's good enough to me.

Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2020-09-29 17:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29  6:13 [PATCH v4 0/2] iommu/tegra-smmu: Two followup changes Nicolin Chen
2020-09-29  6:13 ` [PATCH v4 1/2] iommu/tegra-smmu: Unwrap tegra_smmu_group_get Nicolin Chen
2020-09-29 17:41   ` Dmitry Osipenko
2020-10-03 14:27     ` Dmitry Osipenko
2020-10-08  9:55   ` Thierry Reding
2020-09-29  6:13 ` [PATCH v4 2/2] iommu/tegra-smmu: Expand mutex protection range Nicolin Chen
2020-09-29 17:42   ` Dmitry Osipenko [this message]
2020-09-30  0:31     ` Nicolin Chen
2020-10-03 14:28     ` Dmitry Osipenko
2020-10-08  9:56   ` Thierry Reding
2020-11-07  8:35 ` [PATCH v4 0/2] iommu/tegra-smmu: Two followup changes Nicolin Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=184163e9-01d4-dcc5-0adf-a3d175e56f16@gmail.com \
    --to=digetx@gmail.com \
    --cc=hch@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jonathanh@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).