File tree 1 file changed +15
-0
lines changed
drivers/net/ethernet/mellanox/mlx5/core
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -320,6 +320,16 @@ int mlx5_attach_device(struct mlx5_core_dev *dev)
320
320
}
321
321
} else {
322
322
adev = & priv -> adev [i ]-> adev ;
323
+
324
+ /* Pay attention that this is not PCI driver that
325
+ * mlx5_core_dev is connected, but auxiliary driver.
326
+ *
327
+ * Here we can race of module unload with devlink
328
+ * reload, but we don't need to take extra lock because
329
+ * we are holding global mlx5_intf_mutex.
330
+ */
331
+ if (!adev -> dev .driver )
332
+ continue ;
323
333
adrv = to_auxiliary_drv (adev -> dev .driver );
324
334
325
335
if (adrv -> resume )
@@ -350,13 +360,18 @@ void mlx5_detach_device(struct mlx5_core_dev *dev)
350
360
continue ;
351
361
352
362
adev = & priv -> adev [i ]-> adev ;
363
+ /* Auxiliary driver was unbind manually through sysfs */
364
+ if (!adev -> dev .driver )
365
+ goto skip_suspend ;
366
+
353
367
adrv = to_auxiliary_drv (adev -> dev .driver );
354
368
355
369
if (adrv -> suspend ) {
356
370
adrv -> suspend (adev , pm );
357
371
continue ;
358
372
}
359
373
374
+ skip_suspend :
360
375
del_adev (& priv -> adev [i ]-> adev );
361
376
priv -> adev [i ] = NULL ;
362
377
}
You can’t perform that action at this time.
0 commit comments