aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2022-04-11 13:36:32 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-05-22 21:01:18 +0200
commit77c97a7ea85f3a1f8d2c3bf54869c0b6638519c7 (patch)
tree482297b10151cab6d63ef5ee173efe52545559ff /drivers/misc
parenthabanalabs: support debugfs Byte access to device DRAM (diff)
downloadlinux-dev-77c97a7ea85f3a1f8d2c3bf54869c0b6638519c7.tar.xz
linux-dev-77c97a7ea85f3a1f8d2c3bf54869c0b6638519c7.zip
habanalabs: Stop using iommu_present()
Even if an IOMMU might be present for some PCI segment in the system, that doesn't necessarily mean it provides translation for the device we care about. Replace iommu_present() with a more appropriate check. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/habanalabs/common/debugfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/common/debugfs.c b/drivers/misc/habanalabs/common/debugfs.c
index 7c4a4d504e4c..a94f01713efd 100644
--- a/drivers/misc/habanalabs/common/debugfs.c
+++ b/drivers/misc/habanalabs/common/debugfs.c
@@ -722,7 +722,7 @@ static int hl_access_mem(struct hl_device *hdev, u64 addr, u64 *val,
if (found)
return 0;
- if (!user_address || iommu_present(&pci_bus_type)) {
+ if (!user_address || device_iommu_mapped(&hdev->pdev->dev)) {
rc = -EINVAL;
goto err;
}