18
18
#include <linux/errno.h>
19
19
#include <linux/iommu.h>
20
20
#include <linux/idr.h>
21
- #include <linux/notifier.h>
22
21
#include <linux/err.h>
23
22
#include <linux/pci.h>
24
23
#include <linux/bitops.h>
@@ -40,7 +39,6 @@ struct iommu_group {
40
39
struct kobject * devices_kobj ;
41
40
struct list_head devices ;
42
41
struct mutex mutex ;
43
- struct blocking_notifier_head notifier ;
44
42
void * iommu_data ;
45
43
void (* iommu_data_release )(void * iommu_data );
46
44
char * name ;
@@ -632,7 +630,6 @@ struct iommu_group *iommu_group_alloc(void)
632
630
mutex_init (& group -> mutex );
633
631
INIT_LIST_HEAD (& group -> devices );
634
632
INIT_LIST_HEAD (& group -> entry );
635
- BLOCKING_INIT_NOTIFIER_HEAD (& group -> notifier );
636
633
637
634
ret = ida_simple_get (& iommu_group_ida , 0 , 0 , GFP_KERNEL );
638
635
if (ret < 0 ) {
@@ -905,10 +902,6 @@ int iommu_group_add_device(struct iommu_group *group, struct device *dev)
905
902
if (ret )
906
903
goto err_put_group ;
907
904
908
- /* Notify any listeners about change to group. */
909
- blocking_notifier_call_chain (& group -> notifier ,
910
- IOMMU_GROUP_NOTIFY_ADD_DEVICE , dev );
911
-
912
905
trace_add_device_to_group (group -> id , dev );
913
906
914
907
dev_info (dev , "Adding to iommu group %d\n" , group -> id );
@@ -950,10 +943,6 @@ void iommu_group_remove_device(struct device *dev)
950
943
951
944
dev_info (dev , "Removing from iommu group %d\n" , group -> id );
952
945
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
-
957
946
mutex_lock (& group -> mutex );
958
947
list_for_each_entry (tmp_device , & group -> devices , list ) {
959
948
if (tmp_device -> dev == dev ) {
@@ -1075,36 +1064,6 @@ void iommu_group_put(struct iommu_group *group)
1075
1064
}
1076
1065
EXPORT_SYMBOL_GPL (iommu_group_put );
1077
1066
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
-
1108
1067
/**
1109
1068
* iommu_register_device_fault_handler() - Register a device fault handler
1110
1069
* @dev: the device
@@ -1650,14 +1609,8 @@ static int remove_iommu_group(struct device *dev, void *data)
1650
1609
static int iommu_bus_notifier (struct notifier_block * nb ,
1651
1610
unsigned long action , void * data )
1652
1611
{
1653
- unsigned long group_action = 0 ;
1654
1612
struct device * dev = data ;
1655
- struct iommu_group * group ;
1656
1613
1657
- /*
1658
- * ADD/DEL call into iommu driver ops if provided, which may
1659
- * result in ADD/DEL notifiers to group->notifier
1660
- */
1661
1614
if (action == BUS_NOTIFY_ADD_DEVICE ) {
1662
1615
int ret ;
1663
1616
@@ -1668,34 +1621,6 @@ static int iommu_bus_notifier(struct notifier_block *nb,
1668
1621
return NOTIFY_OK ;
1669
1622
}
1670
1623
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 );
1699
1624
return 0 ;
1700
1625
}
1701
1626
0 commit comments