]> git.baikalelectronics.ru Git - kernel.git/commit
synclink_gt: fix per device locking
authorPaul Fulghum <paulkf@microgate.com>
Wed, 27 Oct 2010 22:34:20 +0000 (15:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Oct 2010 01:03:14 +0000 (18:03 -0700)
commit2f8eeef28ecb7eba7d95eb83a15ff9e714cdec8b
treed54651c55afcdc57a23b6aae48782b616219f2e3
parent774353c9f6035ef8f5f9072e2b4db2ff6e9cc8bd
synclink_gt: fix per device locking

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: Paul Fulghum <paulkf@microgate.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/synclink_gt.c