Commit 68ea809af47d8a4dd92dd3a8720882767fdf51b6

Authored by David Altobelli
Committed by Greg Kroah-Hartman
1 parent d71cb81af3

hpilo: add locking comment

Add explanation about lock nesting and purpose of each lock in hpilo.

Signed-off-by: David Altobelli <david.altobelli@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 1 changed file with 12 additions and 1 deletions Side-by-side Diff

drivers/misc/hpilo.h
... ... @@ -44,9 +44,20 @@
44 44  
45 45 struct pci_dev *ilo_dev;
46 46  
  47 + /*
  48 + * open_lock serializes ccb_cnt during open and close
  49 + * [ irq disabled ]
  50 + * -> alloc_lock used when adding/removing/searching ccb_alloc,
  51 + * which represents all ccbs open on the device
  52 + * --> fifo_lock controls access to fifo queues shared with hw
  53 + *
  54 + * Locks must be taken in this order, but open_lock and alloc_lock
  55 + * are optional, they do not need to be held in order to take a
  56 + * lower level lock.
  57 + */
  58 + spinlock_t open_lock;
47 59 spinlock_t alloc_lock;
48 60 spinlock_t fifo_lock;
49   - spinlock_t open_lock;
50 61  
51 62 struct cdev cdev;
52 63 };