On 4/13/2018 8:08 PM, Mehta, Sohil wrote:
On Fri, 2018-04-06 at 08:17 -0500, Gary R Hook wrote:
+
+
+ÂÂÂ mutex_lock(&amd_iommu_debugfs_lock);
+ÂÂÂ if (!amd_iommu_debugfs) {
+ÂÂÂÂÂÂÂ d_top = iommu_debugfs_setup();
+ÂÂÂÂÂÂÂ if (d_top)
+ÂÂÂÂÂÂÂÂÂÂÂ amd_iommu_debugfs =
debugfs_create_dir("amd", d_top);
+ÂÂÂ }
+ÂÂÂ mutex_unlock(&amd_iommu_debugfs_lock);
You can do the above only once if you iterate over the IOMMUs here
ÂÂinstead of doing it inÂamd_iommu_init.
I'm not sure it matters, given the finite number of IOMMUs in a system, and the fact that this work is done exactly once. However, removal of a lock is fine thing, so I'll move this around.