Merge tag 'asoc-fix-v5.19-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / drivers / thunderbolt / domain.c
index 7018d95..2889a21 100644 (file)
@@ -7,9 +7,7 @@
  */
 
 #include <linux/device.h>
-#include <linux/dmar.h>
 #include <linux/idr.h>
-#include <linux/iommu.h>
 #include <linux/module.h>
 #include <linux/pm_runtime.h>
 #include <linux/slab.h>
@@ -257,13 +255,9 @@ static ssize_t iommu_dma_protection_show(struct device *dev,
                                         struct device_attribute *attr,
                                         char *buf)
 {
-       /*
-        * Kernel DMA protection is a feature where Thunderbolt security is
-        * handled natively using IOMMU. It is enabled when IOMMU is
-        * enabled and ACPI DMAR table has DMAR_PLATFORM_OPT_IN set.
-        */
-       return sprintf(buf, "%d\n",
-                      iommu_present(&pci_bus_type) && dmar_platform_optin());
+       struct tb *tb = container_of(dev, struct tb, dev);
+
+       return sysfs_emit(buf, "%d\n", tb->nhi->iommu_dma_protection);
 }
 static DEVICE_ATTR_RO(iommu_dma_protection);