@@ -126,14 +126,22 @@ int mlx5_set_msix_vec_count(struct mlx5_core_dev *dev, int function_id,
126126	return  ret ;
127127}
128128
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 )
130139{
131140	struct  mlx5_irq_pool  * pool  =  irq -> pool ;
132141#ifdef  CONFIG_RFS_ACCEL 
133142	struct  cpu_rmap  * rmap ;
134143#endif 
135144
136- 	xa_erase (& pool -> irqs , irq -> pool_index );
137145	/* free_irq requires that affinity_hint and rmap will be cleared before 
138146	 * calling it. To satisfy this requirement, we call 
139147	 * irq_cpu_rmap_remove() to remove the notifier 
@@ -145,10 +153,18 @@ static void irq_release(struct mlx5_irq *irq)
145153		irq_cpu_rmap_remove (rmap , irq -> map .virq );
146154#endif 
147155
148- 	free_cpumask_var (irq -> mask );
149156	free_irq (irq -> map .virq , & irq -> nh );
150157	if  (irq -> map .index  &&  pci_msix_can_alloc_dyn (pool -> dev -> pdev ))
151158		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 );
152168	kfree (irq );
153169}
154170
@@ -705,7 +721,8 @@ static void mlx5_irq_pool_free_irqs(struct mlx5_irq_pool *pool)
705721	unsigned long  index ;
706722
707723	xa_for_each (& pool -> irqs , index , irq )
708- 		free_irq (irq -> map .virq , & irq -> nh );
724+ 		mlx5_system_free_irq (irq );
725+ 
709726}
710727
711728static  void  mlx5_irq_pools_free_irqs (struct  mlx5_irq_table  * table )
0 commit comments