• Paul Fulghum's avatar
    synclink_gt: fix per device locking · ffd7d6ba
    Paul Fulghum authored
    Fix a long standing bug with per device locking.
    
    Each device has an associated spinlock for synchronizing access to
    hardware and state information with the ISR.  A single hardware card has
    one or more devices.
    
    Bug: Non ISR code correctly acquires and releases the per device lock.
    ISR incorrectly always acquires and releases the lock of the first device
    on the card.
    
    The decoupled and list based nature of the ISR and deferred processing
    interaction allowed this to work in normal operation.  Exceptional events
    like an application forcing hardware shutdown, reset, or reconfiguration
    while active can trigger the bug.
    
    Fixed ISR to acquire and release the per device lock.
    
    One exception is manipulation of the GPIO card resource which is global
    and effectively owned by the first device of the card.  Non-ISR access to
    GPIO resource is changed to use lock of first device on card.
    Signed-off-by: default avatarPaul Fulghum <paulkf@microgate.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    ffd7d6ba
synclink_gt.c 129 KB