Skip to content

Commit

Permalink
iommu: Add a few printk messages to group handling code
Browse files Browse the repository at this point in the history
Write a message to the kernel log when a device is added or
removed from a group and add debug messages to group
allocation and release routines.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Joerg Roedel committed Jun 5, 2015
1 parent 92e7066 commit 269aa80
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/iommu/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ static void iommu_group_release(struct kobject *kobj)
{
struct iommu_group *group = to_iommu_group(kobj);

pr_debug("Releasing group %d\n", group->id);

if (group->iommu_data_release)
group->iommu_data_release(group->iommu_data);

Expand Down Expand Up @@ -207,6 +209,8 @@ struct iommu_group *iommu_group_alloc(void)
*/
kobject_put(&group->kobj);

pr_debug("Allocated group %d\n", group->id);

return group;
}
EXPORT_SYMBOL_GPL(iommu_group_alloc);
Expand Down Expand Up @@ -372,6 +376,9 @@ int iommu_group_add_device(struct iommu_group *group, struct device *dev)
IOMMU_GROUP_NOTIFY_ADD_DEVICE, dev);

trace_add_device_to_group(group->id, dev);

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

return 0;
}
EXPORT_SYMBOL_GPL(iommu_group_add_device);
Expand All @@ -388,6 +395,8 @@ void iommu_group_remove_device(struct device *dev)
struct iommu_group *group = dev->iommu_group;
struct iommu_device *tmp_device, *device = NULL;

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

/* Pre-notify listeners that a device is being removed. */
blocking_notifier_call_chain(&group->notifier,
IOMMU_GROUP_NOTIFY_DEL_DEVICE, dev);
Expand Down

0 comments on commit 269aa80

Please sign in to comment.