]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.drivers/libfc-updated-comment-for-orde.diff
Fix oinkmaster patch.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.drivers / libfc-updated-comment-for-orde.diff
CommitLineData
4d1e5b62
AF
1From: Vasu Dev <vasu.dev@intel.com>
2Subject: [FcOE] updated comment for order of em and ex locks
3References: bnc #459142
4
5The fc_exch is public but em_lock is static to fc_exch.c,
6so updated comment only in fc_exch.c on order of these locks.
7
8Also removed seq.f_ctl from comments since this field is
9already removed.
10
11Signed-off-by: Vasu Dev <vasu.dev@intel.com>
12Acked-by: Bernhard Walle <bwalle@suse.de>
13---
14
15 drivers/scsi/libfc/fc_exch.c | 5 ++++-
16 include/scsi/libfc.h | 5 ++---
17 2 files changed, 6 insertions(+), 4 deletions(-)
18
19
20--- a/drivers/scsi/libfc/fc_exch.c
21+++ b/drivers/scsi/libfc/fc_exch.c
22@@ -68,7 +68,8 @@ static struct kmem_cache *fc_em_cachep;
23 */
24 struct fc_exch_mgr {
25 enum fc_class class; /* default class for sequences */
26- spinlock_t em_lock; /* exchange manager lock */
27+ spinlock_t em_lock; /* exchange manager lock,
28+ must be taken before ex_lock */
29 u16 last_xid; /* last allocated exchange ID */
30 u16 min_xid; /* min exchange ID */
31 u16 max_xid; /* max exchange ID */
32@@ -179,6 +180,8 @@ static struct fc_seq *fc_seq_start_next_
33 * sequence allocation and deallocation must be locked.
34 * - exchange refcnt can be done atomicly without locks.
35 * - sequence allocation must be locked by exch lock.
36+ * - If the em_lock and ex_lock must be taken at the same time, then the
37+ * em_lock must be taken before the ex_lock.
38 */
39
40 /*
41--- a/include/scsi/libfc.h
42+++ b/include/scsi/libfc.h
43@@ -299,11 +299,10 @@ struct fc_seq {
44 /*
45 * Exchange.
46 *
47- * Locking notes: The ex_lock protects changes to the following fields:
48- * esb_stat, f_ctl, seq.ssb_stat, seq.f_ctl.
49+ * Locking notes: The ex_lock protects following items:
50+ * state, esb_stat, f_ctl, seq.ssb_stat
51 * seq_id
52 * sequence allocation
53- *
54 */
55 struct fc_exch {
56 struct fc_exch_mgr *em; /* exchange manager */