• Michael Chan's avatar
    cnic: Decouple uio close from cnic shutdown · a3ceeeb8
    Michael Chan authored
    During cnic shutdown, the original driver code requires userspace to
    close the uio device within a few seconds.  This doesn't always happen
    as the userapp may be hung or otherwise take a long time to close.  The
    system may crash when this happens.
    
    We fix the problem by decoupling the uio structures from the cnic
    structures during cnic shutdown.  We do not unregister the uio device
    until the cnic driver is unloaded.  This eliminates the unreliable wait
    loop for uio to close.
    
    All uio structures are kept in a linked list.  If the device is shutdown
    and later brought back up again, the uio strcture will be found in the
    linked list and coupled back to the cnic structures.
    Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a3ceeeb8
cnic.c 125 KB