Skip to content

Commit 68ea809

Browse files
David Altobelligregkh
authored andcommitted
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>
1 parent d71cb81 commit 68ea809

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎drivers/misc/hpilo.h‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,20 @@ struct ilo_hwinfo {
4444

4545
struct pci_dev *ilo_dev;
4646

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;
4759
spinlock_t alloc_lock;
4860
spinlock_t fifo_lock;
49-
spinlock_t open_lock;
5061

5162
struct cdev cdev;
5263
};

0 commit comments

Comments
 (0)