@@ -126,14 +126,22 @@ int mlx5_set_msix_vec_count(struct mlx5_core_dev *dev, int function_id,
126
126
return ret ;
127
127
}
128
128
129
- static void irq_release (struct mlx5_irq * irq )
129
+ /* mlx5_system_free_irq - Free an IRQ
130
+ * @irq: IRQ to free
131
+ *
132
+ * Free the IRQ and other resources such as rmap from the system.
133
+ * BUT doesn't free or remove reference from mlx5.
134
+ * This function is very important for the shutdown flow, where we need to
135
+ * cleanup system resoruces but keep mlx5 objects alive,
136
+ * see mlx5_irq_table_free_irqs().
137
+ */
138
+ static void mlx5_system_free_irq (struct mlx5_irq * irq )
130
139
{
131
140
struct mlx5_irq_pool * pool = irq -> pool ;
132
141
#ifdef CONFIG_RFS_ACCEL
133
142
struct cpu_rmap * rmap ;
134
143
#endif
135
144
136
- xa_erase (& pool -> irqs , irq -> pool_index );
137
145
/* free_irq requires that affinity_hint and rmap will be cleared before
138
146
* calling it. To satisfy this requirement, we call
139
147
* irq_cpu_rmap_remove() to remove the notifier
@@ -145,10 +153,18 @@ static void irq_release(struct mlx5_irq *irq)
145
153
irq_cpu_rmap_remove (rmap , irq -> map .virq );
146
154
#endif
147
155
148
- free_cpumask_var (irq -> mask );
149
156
free_irq (irq -> map .virq , & irq -> nh );
150
157
if (irq -> map .index && pci_msix_can_alloc_dyn (pool -> dev -> pdev ))
151
158
pci_msix_free_irq (pool -> dev -> pdev , irq -> map );
159
+ }
160
+
161
+ static void irq_release (struct mlx5_irq * irq )
162
+ {
163
+ struct mlx5_irq_pool * pool = irq -> pool ;
164
+
165
+ xa_erase (& pool -> irqs , irq -> pool_index );
166
+ mlx5_system_free_irq (irq );
167
+ free_cpumask_var (irq -> mask );
152
168
kfree (irq );
153
169
}
154
170
@@ -705,7 +721,8 @@ static void mlx5_irq_pool_free_irqs(struct mlx5_irq_pool *pool)
705
721
unsigned long index ;
706
722
707
723
xa_for_each (& pool -> irqs , index , irq )
708
- free_irq (irq -> map .virq , & irq -> nh );
724
+ mlx5_system_free_irq (irq );
725
+
709
726
}
710
727
711
728
static void mlx5_irq_pools_free_irqs (struct mlx5_irq_table * table )
0 commit comments