1818#include <linux/errno.h>
1919#include <linux/iommu.h>
2020#include <linux/idr.h>
21- #include <linux/notifier.h>
2221#include <linux/err.h>
2322#include <linux/pci.h>
2423#include <linux/bitops.h>
@@ -40,7 +39,6 @@ struct iommu_group {
4039 struct kobject * devices_kobj ;
4140 struct list_head devices ;
4241 struct mutex mutex ;
43- struct blocking_notifier_head notifier ;
4442 void * iommu_data ;
4543 void (* iommu_data_release )(void * iommu_data );
4644 char * name ;
@@ -632,7 +630,6 @@ struct iommu_group *iommu_group_alloc(void)
632630 mutex_init (& group -> mutex );
633631 INIT_LIST_HEAD (& group -> devices );
634632 INIT_LIST_HEAD (& group -> entry );
635- BLOCKING_INIT_NOTIFIER_HEAD (& group -> notifier );
636633
637634 ret = ida_simple_get (& iommu_group_ida , 0 , 0 , GFP_KERNEL );
638635 if (ret < 0 ) {
@@ -905,10 +902,6 @@ int iommu_group_add_device(struct iommu_group *group, struct device *dev)
905902 if (ret )
906903 goto err_put_group ;
907904
908- /* Notify any listeners about change to group. */
909- blocking_notifier_call_chain (& group -> notifier ,
910- IOMMU_GROUP_NOTIFY_ADD_DEVICE , dev );
911-
912905 trace_add_device_to_group (group -> id , dev );
913906
914907 dev_info (dev , "Adding to iommu group %d\n" , group -> id );
@@ -950,10 +943,6 @@ void iommu_group_remove_device(struct device *dev)
950943
951944 dev_info (dev , "Removing from iommu group %d\n" , group -> id );
952945
953- /* Pre-notify listeners that a device is being removed. */
954- blocking_notifier_call_chain (& group -> notifier ,
955- IOMMU_GROUP_NOTIFY_DEL_DEVICE , dev );
956-
957946 mutex_lock (& group -> mutex );
958947 list_for_each_entry (tmp_device , & group -> devices , list ) {
959948 if (tmp_device -> dev == dev ) {
@@ -1075,36 +1064,6 @@ void iommu_group_put(struct iommu_group *group)
10751064}
10761065EXPORT_SYMBOL_GPL (iommu_group_put );
10771066
1078- /**
1079- * iommu_group_register_notifier - Register a notifier for group changes
1080- * @group: the group to watch
1081- * @nb: notifier block to signal
1082- *
1083- * This function allows iommu group users to track changes in a group.
1084- * See include/linux/iommu.h for actions sent via this notifier. Caller
1085- * should hold a reference to the group throughout notifier registration.
1086- */
1087- int iommu_group_register_notifier (struct iommu_group * group ,
1088- struct notifier_block * nb )
1089- {
1090- return blocking_notifier_chain_register (& group -> notifier , nb );
1091- }
1092- EXPORT_SYMBOL_GPL (iommu_group_register_notifier );
1093-
1094- /**
1095- * iommu_group_unregister_notifier - Unregister a notifier
1096- * @group: the group to watch
1097- * @nb: notifier block to signal
1098- *
1099- * Unregister a previously registered group notifier block.
1100- */
1101- int iommu_group_unregister_notifier (struct iommu_group * group ,
1102- struct notifier_block * nb )
1103- {
1104- return blocking_notifier_chain_unregister (& group -> notifier , nb );
1105- }
1106- EXPORT_SYMBOL_GPL (iommu_group_unregister_notifier );
1107-
11081067/**
11091068 * iommu_register_device_fault_handler() - Register a device fault handler
11101069 * @dev: the device
@@ -1650,14 +1609,8 @@ static int remove_iommu_group(struct device *dev, void *data)
16501609static int iommu_bus_notifier (struct notifier_block * nb ,
16511610 unsigned long action , void * data )
16521611{
1653- unsigned long group_action = 0 ;
16541612 struct device * dev = data ;
1655- struct iommu_group * group ;
16561613
1657- /*
1658- * ADD/DEL call into iommu driver ops if provided, which may
1659- * result in ADD/DEL notifiers to group->notifier
1660- */
16611614 if (action == BUS_NOTIFY_ADD_DEVICE ) {
16621615 int ret ;
16631616
@@ -1668,34 +1621,6 @@ static int iommu_bus_notifier(struct notifier_block *nb,
16681621 return NOTIFY_OK ;
16691622 }
16701623
1671- /*
1672- * Remaining BUS_NOTIFYs get filtered and republished to the
1673- * group, if anyone is listening
1674- */
1675- group = iommu_group_get (dev );
1676- if (!group )
1677- return 0 ;
1678-
1679- switch (action ) {
1680- case BUS_NOTIFY_BIND_DRIVER :
1681- group_action = IOMMU_GROUP_NOTIFY_BIND_DRIVER ;
1682- break ;
1683- case BUS_NOTIFY_BOUND_DRIVER :
1684- group_action = IOMMU_GROUP_NOTIFY_BOUND_DRIVER ;
1685- break ;
1686- case BUS_NOTIFY_UNBIND_DRIVER :
1687- group_action = IOMMU_GROUP_NOTIFY_UNBIND_DRIVER ;
1688- break ;
1689- case BUS_NOTIFY_UNBOUND_DRIVER :
1690- group_action = IOMMU_GROUP_NOTIFY_UNBOUND_DRIVER ;
1691- break ;
1692- }
1693-
1694- if (group_action )
1695- blocking_notifier_call_chain (& group -> notifier ,
1696- group_action , dev );
1697-
1698- iommu_group_put (group );
16991624 return 0 ;
17001625}
17011626
0 commit comments