@@ -1042,7 +1042,7 @@ static void free_event_attributes(struct i915_pmu *pmu)
1042
1042
1043
1043
static int i915_pmu_cpu_online (unsigned int cpu , struct hlist_node * node )
1044
1044
{
1045
- struct i915_pmu * pmu = hlist_entry_safe (node , typeof (* pmu ), node );
1045
+ struct i915_pmu * pmu = hlist_entry_safe (node , typeof (* pmu ), cpuhp . node );
1046
1046
1047
1047
GEM_BUG_ON (!pmu -> base .event_init );
1048
1048
@@ -1055,7 +1055,7 @@ static int i915_pmu_cpu_online(unsigned int cpu, struct hlist_node *node)
1055
1055
1056
1056
static int i915_pmu_cpu_offline (unsigned int cpu , struct hlist_node * node )
1057
1057
{
1058
- struct i915_pmu * pmu = hlist_entry_safe (node , typeof (* pmu ), node );
1058
+ struct i915_pmu * pmu = hlist_entry_safe (node , typeof (* pmu ), cpuhp . node );
1059
1059
unsigned int target ;
1060
1060
1061
1061
GEM_BUG_ON (!pmu -> base .event_init );
@@ -1072,8 +1072,6 @@ static int i915_pmu_cpu_offline(unsigned int cpu, struct hlist_node *node)
1072
1072
return 0 ;
1073
1073
}
1074
1074
1075
- static enum cpuhp_state cpuhp_slot = CPUHP_INVALID ;
1076
-
1077
1075
static int i915_pmu_register_cpuhp_state (struct i915_pmu * pmu )
1078
1076
{
1079
1077
enum cpuhp_state slot ;
@@ -1087,21 +1085,22 @@ static int i915_pmu_register_cpuhp_state(struct i915_pmu *pmu)
1087
1085
return ret ;
1088
1086
1089
1087
slot = ret ;
1090
- ret = cpuhp_state_add_instance (slot , & pmu -> node );
1088
+ ret = cpuhp_state_add_instance (slot , & pmu -> cpuhp . node );
1091
1089
if (ret ) {
1092
1090
cpuhp_remove_multi_state (slot );
1093
1091
return ret ;
1094
1092
}
1095
1093
1096
- cpuhp_slot = slot ;
1094
+ pmu -> cpuhp . slot = slot ;
1097
1095
return 0 ;
1098
1096
}
1099
1097
1100
1098
static void i915_pmu_unregister_cpuhp_state (struct i915_pmu * pmu )
1101
1099
{
1102
- WARN_ON (cpuhp_slot == CPUHP_INVALID );
1103
- WARN_ON (cpuhp_state_remove_instance (cpuhp_slot , & pmu -> node ));
1104
- cpuhp_remove_multi_state (cpuhp_slot );
1100
+ WARN_ON (pmu -> cpuhp .slot == CPUHP_INVALID );
1101
+ WARN_ON (cpuhp_state_remove_instance (pmu -> cpuhp .slot , & pmu -> cpuhp .node ));
1102
+ cpuhp_remove_multi_state (pmu -> cpuhp .slot );
1103
+ pmu -> cpuhp .slot = CPUHP_INVALID ;
1105
1104
}
1106
1105
1107
1106
static bool is_igp (struct drm_i915_private * i915 )
@@ -1128,6 +1127,7 @@ void i915_pmu_register(struct drm_i915_private *i915)
1128
1127
spin_lock_init (& pmu -> lock );
1129
1128
hrtimer_init (& pmu -> timer , CLOCK_MONOTONIC , HRTIMER_MODE_REL );
1130
1129
pmu -> timer .function = i915_sample ;
1130
+ pmu -> cpuhp .slot = CPUHP_INVALID ;
1131
1131
1132
1132
if (!is_igp (i915 )) {
1133
1133
pmu -> name = kasprintf (GFP_KERNEL ,
0 commit comments