Skip to content

Commit 780da9e

Browse files
bjorn-helgaasjoergroedel
authored andcommitted
iommu: Use dev_printk() when possible
Use dev_printk() when possible so the IOMMU messages are more consistent with other messages related to the device. E.g., I think these messages related to surprise hotplug: pciehp 0000:80:10.0:pcie004: Slot(36): Link Down iommu: Removing device 0000:87:00.0 from group 12 pciehp 0000:80:10.0:pcie004: Slot(36): Card present pcieport 0000:80:10.0: Data Link Layer Link Active not set in 1000 msec would be easier to read as these (also requires some PCI changes not included here): pci 0000:80:10.0: Slot(36): Link Down pci 0000:87:00.0: Removing from iommu group 12 pci 0000:80:10.0: Slot(36): Card present pci 0000:80:10.0: Data Link Layer Link Active not set in 1000 msec Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent b77cf11 commit 780da9e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/iommu/iommu.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ int iommu_group_add_device(struct iommu_group *group, struct device *dev)
668668

669669
trace_add_device_to_group(group->id, dev);
670670

671-
pr_info("Adding device %s to group %d\n", dev_name(dev), group->id);
671+
dev_info(dev, "Adding to iommu group %d\n", group->id);
672672

673673
return 0;
674674

@@ -684,7 +684,7 @@ int iommu_group_add_device(struct iommu_group *group, struct device *dev)
684684
sysfs_remove_link(&dev->kobj, "iommu_group");
685685
err_free_device:
686686
kfree(device);
687-
pr_err("Failed to add device %s to group %d: %d\n", dev_name(dev), group->id, ret);
687+
dev_err(dev, "Failed to add to iommu group %d: %d\n", group->id, ret);
688688
return ret;
689689
}
690690
EXPORT_SYMBOL_GPL(iommu_group_add_device);
@@ -701,7 +701,7 @@ void iommu_group_remove_device(struct device *dev)
701701
struct iommu_group *group = dev->iommu_group;
702702
struct group_device *tmp_device, *device = NULL;
703703

704-
pr_info("Removing device %s from group %d\n", dev_name(dev), group->id);
704+
dev_info(dev, "Removing from iommu group %d\n", group->id);
705705

706706
/* Pre-notify listeners that a device is being removed. */
707707
blocking_notifier_call_chain(&group->notifier,
@@ -1951,7 +1951,7 @@ int iommu_request_dm_for_dev(struct device *dev)
19511951
iommu_domain_free(group->default_domain);
19521952
group->default_domain = dm_domain;
19531953

1954-
pr_info("Using direct mapping for device %s\n", dev_name(dev));
1954+
dev_info(dev, "Using iommu direct mapping\n");
19551955

19561956
ret = 0;
19571957
out:

0 commit comments

Comments
 (0)