Skip to content

Commit

Permalink
hpilo: add locking comment
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Altobelli authored and Greg Kroah-Hartman committed Dec 11, 2009
1 parent d71cb81 commit 68ea809
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion drivers/misc/hpilo.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,20 @@ struct ilo_hwinfo {

struct pci_dev *ilo_dev;

/*
* open_lock serializes ccb_cnt during open and close
* [ irq disabled ]
* -> alloc_lock used when adding/removing/searching ccb_alloc,
* which represents all ccbs open on the device
* --> fifo_lock controls access to fifo queues shared with hw
*
* Locks must be taken in this order, but open_lock and alloc_lock
* are optional, they do not need to be held in order to take a
* lower level lock.
*/
spinlock_t open_lock;
spinlock_t alloc_lock;
spinlock_t fifo_lock;
spinlock_t open_lock;

struct cdev cdev;
};
Expand Down

0 comments on commit 68ea809

Please sign in to comment.