From: Robin Murphy <robin.murphy@arm.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: maz@kernel.org, iommu@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, julien.grall@arm.com
Subject: Re: [PATCH] iommu/dma: Relax locking in iommu_dma_prepare_msi()
Date: Fri, 18 Oct 2019 14:51:25 +0100 [thread overview]
Message-ID: <2309c311-7378-385d-bf97-57965d36c18b@arm.com> (raw)
In-Reply-To: <20191017162453.GA6012@infradead.org>
On 17/10/2019 17:24, Christoph Hellwig wrote:
> On Wed, Oct 16, 2019 at 06:07:36PM +0100, Robin Murphy wrote:
>> @@ -1180,7 +1179,7 @@ int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr)
>> struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
>> struct iommu_dma_cookie *cookie;
>> struct iommu_dma_msi_page *msi_page;
>> - unsigned long flags;
>> + static DEFINE_MUTEX(msi_prepare_lock);
>
> Just a style nitpick, but I find locks declared inside functions
> really weird. In addition to that locks not embedded into a structure
> and not directly next to variables or data structures they protect
> really need a comment explaining what they are trying to serialize.
Hmm, the lock itself is merely a glorified comment, it's named for the
operation it protects, its entire existence spans 15 consecutive lines,
and 27% of those lines are dedicated to explaining that it's technically
redundant. Is there *really* anything that isn't clear from the context?
Robin.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
prev parent reply other threads:[~2019-10-18 13:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-16 17:07 [PATCH] iommu/dma: Relax locking in iommu_dma_prepare_msi() Robin Murphy
2019-10-17 16:24 ` Christoph Hellwig
2019-10-18 13:51 ` Robin Murphy [this message]
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=2309c311-7378-385d-bf97-57965d36c18b@arm.com \
--to=robin.murphy@arm.com \
--cc=hch@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=julien.grall@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
/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