The fc_exch is public but em_lock is static to fc_exch.c,
so updated comment only in fc_exch.c on order of these locks.
Also removed seq.f_ctl from comments since this field is
already removed.
Signed-off-by: Vasu Dev <[EMAIL PROTECTED]>
---
drivers/scsi/libfc/fc_exch.c | 5 ++++-
include/scsi/libfc.h | 5 ++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index d81ed95..66db08a 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -68,7 +68,8 @@ static struct kmem_cache *fc_em_cachep; /* cache for
exchanges */
*/
struct fc_exch_mgr {
enum fc_class class; /* default class for sequences */
- spinlock_t em_lock; /* exchange manager lock */
+ spinlock_t em_lock; /* exchange manager lock,
+ must be taken before ex_lock */
u16 last_xid; /* last allocated exchange ID */
u16 min_xid; /* min exchange ID */
u16 max_xid; /* max exchange ID */
@@ -179,6 +180,8 @@ static struct fc_seq *fc_seq_start_next_locked(struct
fc_seq *sp);
* sequence allocation and deallocation must be locked.
* - exchange refcnt can be done atomicly without locks.
* - sequence allocation must be locked by exch lock.
+ * - If the em_lock and ex_lock must be taken at the same time, then the
+ * em_lock must be taken before the ex_lock.
*/
/*
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 9632898..374df9a 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -299,11 +299,10 @@ struct fc_seq {
/*
* Exchange.
*
- * Locking notes: The ex_lock protects changes to the following fields:
- * esb_stat, f_ctl, seq.ssb_stat, seq.f_ctl.
+ * Locking notes: The ex_lock protects following items:
+ * state, esb_stat, f_ctl, seq.ssb_stat
* seq_id
* sequence allocation
- *
*/
struct fc_exch {
struct fc_exch_mgr *em; /* exchange manager */
_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel