From: David Altobelli <david.altobelli@hp.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, david.altobelli@hp.com
Subject: [PATCH] hpilo: add locking comment
Date: Wed, 19 Aug 2009 11:51:50 -0600 [thread overview]
Message-ID: <20090819175150.GA7053@ldl.fc.hp.com> (raw)
Add explanation about lock nesting and purpose of each lock in hpilo.
This applies on top of a set of patches I sent out to add polling to hpilo.
Please CC me on any replies, and thanks,
Dave
Signed-off-by: David Altobelli <david.altobelli@hp.com>
---
--- linux-2.6.30.3/drivers/misc/hpilo.h.orig 2009-08-19 10:38:23.000000000 -0500
+++ linux-2.6.30.3/drivers/misc/hpilo.h 2009-08-19 11:06:36.000000000 -0500
@@ -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;
};
reply other threads:[~2009-08-19 17:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090819175150.GA7053@ldl.fc.hp.com \
--to=david.altobelli@hp.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome