• Leon Romanovsky's avatar
    liquidio: Overcome missing device lock protection in init/remove flows · 8d44b5cf
    Leon Romanovsky authored
    The liquidio driver is broken by design. It initialize PCI devices
    in separate delayed works. It causes to the situation where device lock
    is dropped during initialize and remove sequences.
    
    That lock is part of driver/core and needed to protect from races during
    init, destroy and bus invocations.
    
    In addition to lack of locking protection, it has incorrect order of
    destroy flows and very questionable synchronization scheme based on
    atomic_t.
    
    This change doesn't fix that driver but makes sure that rest of the
    netdev subsystem doesn't suffer from such basic protection by adding
    device_lock over devlink_*() APIs and by moving devlink_register()
    to be last command in setup_nic_devices().
    Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    8d44b5cf
lio_main.c 116 KB