diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2006-10-30 01:46:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-30 15:08:40 -0500 |
commit | 7259f0d05d595b73ef312a082e628627c6414969 (patch) | |
tree | 6227c5e3cd0c31fa80c7a35113007caaf70bf3b6 | |
parent | 70812522b847bdb8fabee963191734f5fa3143f3 (diff) |
[PATCH] lockdep: annotate DECLARE_WAIT_QUEUE_HEAD
kernel: INFO: trying to register non-static key.
kernel: the code is fine but needs lockdep annotation.
kernel: turning off the locking correctness validator.
kernel: [<c04051ed>] show_trace_log_lvl+0x58/0x16a
kernel: [<c04057fa>] show_trace+0xd/0x10
kernel: [<c0405913>] dump_stack+0x19/0x1b
kernel: [<c043b1e2>] __lock_acquire+0xf0/0x90d
kernel: [<c043bf70>] lock_acquire+0x4b/0x6b
kernel: [<c061472f>] _spin_lock_irqsave+0x22/0x32
kernel: [<c04363d3>] prepare_to_wait+0x17/0x4b
kernel: [<f89a24b6>] lpfc_do_work+0xdd/0xcc2 [lpfc]
kernel: [<c04361b9>] kthread+0xc3/0xf2
kernel: [<c0402005>] kernel_thread_helper+0x5/0xb
Another case of non-static lockdep keys; duplicate the paradigm set by
DECLARE_COMPLETION_ONSTACK and introduce DECLARE_WAIT_QUEUE_HEAD_ONSTACK.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Greg KH <gregkh@suse.de>
Cc: Markus Lidel <markus.lidel@shadowconnect.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/bluetooth/bluecard_cs.c | 2 | ||||
-rw-r--r-- | drivers/message/i2o/exec-osm.c | 2 | ||||
-rw-r--r-- | drivers/scsi/dpt/dpti_i2o.h | 2 | ||||
-rw-r--r-- | drivers/scsi/imm.c | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 4 | ||||
-rw-r--r-- | drivers/scsi/ppa.c | 2 | ||||
-rw-r--r-- | drivers/usb/net/usbnet.c | 2 | ||||
-rw-r--r-- | include/linux/wait.h | 9 |
9 files changed, 18 insertions, 9 deletions
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index 845b8680032a..cbc07250b898 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c | |||
@@ -282,7 +282,7 @@ static void bluecard_write_wakeup(bluecard_info_t *info) | |||
282 | clear_bit(ready_bit, &(info->tx_state)); | 282 | clear_bit(ready_bit, &(info->tx_state)); |
283 | 283 | ||
284 | if (bt_cb(skb)->pkt_type & 0x80) { | 284 | if (bt_cb(skb)->pkt_type & 0x80) { |
285 | DECLARE_WAIT_QUEUE_HEAD(wq); | 285 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq); |
286 | DEFINE_WAIT(wait); | 286 | DEFINE_WAIT(wait); |
287 | 287 | ||
288 | unsigned char baud_reg; | 288 | unsigned char baud_reg; |
diff --git a/drivers/message/i2o/exec-osm.c b/drivers/message/i2o/exec-osm.c index 01a5a702b037..a2350640384b 100644 --- a/drivers/message/i2o/exec-osm.c +++ b/drivers/message/i2o/exec-osm.c | |||
@@ -124,7 +124,7 @@ static void i2o_exec_wait_free(struct i2o_exec_wait *wait) | |||
124 | int i2o_msg_post_wait_mem(struct i2o_controller *c, struct i2o_message *msg, | 124 | int i2o_msg_post_wait_mem(struct i2o_controller *c, struct i2o_message *msg, |
125 | unsigned long timeout, struct i2o_dma *dma) | 125 | unsigned long timeout, struct i2o_dma *dma) |
126 | { | 126 | { |
127 | DECLARE_WAIT_QUEUE_HEAD(wq); | 127 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq); |
128 | struct i2o_exec_wait *wait; | 128 | struct i2o_exec_wait *wait; |
129 | static u32 tcntxt = 0x80000000; | 129 | static u32 tcntxt = 0x80000000; |
130 | unsigned long flags; | 130 | unsigned long flags; |
diff --git a/drivers/scsi/dpt/dpti_i2o.h b/drivers/scsi/dpt/dpti_i2o.h index b3fa7ed71faf..5a49216fe4cf 100644 --- a/drivers/scsi/dpt/dpti_i2o.h +++ b/drivers/scsi/dpt/dpti_i2o.h | |||
@@ -49,7 +49,7 @@ | |||
49 | 49 | ||
50 | #include <linux/wait.h> | 50 | #include <linux/wait.h> |
51 | typedef wait_queue_head_t adpt_wait_queue_head_t; | 51 | typedef wait_queue_head_t adpt_wait_queue_head_t; |
52 | #define ADPT_DECLARE_WAIT_QUEUE_HEAD(wait) DECLARE_WAIT_QUEUE_HEAD(wait) | 52 | #define ADPT_DECLARE_WAIT_QUEUE_HEAD(wait) DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wait) |
53 | typedef wait_queue_t adpt_wait_queue_t; | 53 | typedef wait_queue_t adpt_wait_queue_t; |
54 | 54 | ||
55 | /* | 55 | /* |
diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index 2d95ac9c32c1..e31f6122106f 100644 --- a/drivers/scsi/imm.c +++ b/drivers/scsi/imm.c | |||
@@ -1153,7 +1153,7 @@ static int __imm_attach(struct parport *pb) | |||
1153 | { | 1153 | { |
1154 | struct Scsi_Host *host; | 1154 | struct Scsi_Host *host; |
1155 | imm_struct *dev; | 1155 | imm_struct *dev; |
1156 | DECLARE_WAIT_QUEUE_HEAD(waiting); | 1156 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(waiting); |
1157 | DEFINE_WAIT(wait); | 1157 | DEFINE_WAIT(wait); |
1158 | int ports; | 1158 | int ports; |
1159 | int modes, ppb; | 1159 | int modes, ppb; |
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index d586c3d3b0d0..19c79a0549a7 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -305,7 +305,7 @@ lpfc_do_work(void *p) | |||
305 | { | 305 | { |
306 | struct lpfc_hba *phba = p; | 306 | struct lpfc_hba *phba = p; |
307 | int rc; | 307 | int rc; |
308 | DECLARE_WAIT_QUEUE_HEAD(work_waitq); | 308 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(work_waitq); |
309 | 309 | ||
310 | set_user_nice(current, -20); | 310 | set_user_nice(current, -20); |
311 | phba->work_wait = &work_waitq; | 311 | phba->work_wait = &work_waitq; |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 24a1779b9af4..582f5ea4e84e 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -2983,7 +2983,7 @@ lpfc_sli_issue_iocb_wait(struct lpfc_hba * phba, | |||
2983 | struct lpfc_iocbq * prspiocbq, | 2983 | struct lpfc_iocbq * prspiocbq, |
2984 | uint32_t timeout) | 2984 | uint32_t timeout) |
2985 | { | 2985 | { |
2986 | DECLARE_WAIT_QUEUE_HEAD(done_q); | 2986 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(done_q); |
2987 | long timeleft, timeout_req = 0; | 2987 | long timeleft, timeout_req = 0; |
2988 | int retval = IOCB_SUCCESS; | 2988 | int retval = IOCB_SUCCESS; |
2989 | uint32_t creg_val; | 2989 | uint32_t creg_val; |
@@ -3061,7 +3061,7 @@ int | |||
3061 | lpfc_sli_issue_mbox_wait(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmboxq, | 3061 | lpfc_sli_issue_mbox_wait(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmboxq, |
3062 | uint32_t timeout) | 3062 | uint32_t timeout) |
3063 | { | 3063 | { |
3064 | DECLARE_WAIT_QUEUE_HEAD(done_q); | 3064 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(done_q); |
3065 | DECLARE_WAITQUEUE(wq_entry, current); | 3065 | DECLARE_WAITQUEUE(wq_entry, current); |
3066 | uint32_t timeleft = 0; | 3066 | uint32_t timeleft = 0; |
3067 | int retval; | 3067 | int retval; |
diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c index b0eba39f208a..89a2a9f11e41 100644 --- a/drivers/scsi/ppa.c +++ b/drivers/scsi/ppa.c | |||
@@ -1012,7 +1012,7 @@ static LIST_HEAD(ppa_hosts); | |||
1012 | static int __ppa_attach(struct parport *pb) | 1012 | static int __ppa_attach(struct parport *pb) |
1013 | { | 1013 | { |
1014 | struct Scsi_Host *host; | 1014 | struct Scsi_Host *host; |
1015 | DECLARE_WAIT_QUEUE_HEAD(waiting); | 1015 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(waiting); |
1016 | DEFINE_WAIT(wait); | 1016 | DEFINE_WAIT(wait); |
1017 | ppa_struct *dev; | 1017 | ppa_struct *dev; |
1018 | int ports; | 1018 | int ports; |
diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c index cf3d20eb781c..40873635d80e 100644 --- a/drivers/usb/net/usbnet.c +++ b/drivers/usb/net/usbnet.c | |||
@@ -554,7 +554,7 @@ static int usbnet_stop (struct net_device *net) | |||
554 | { | 554 | { |
555 | struct usbnet *dev = netdev_priv(net); | 555 | struct usbnet *dev = netdev_priv(net); |
556 | int temp; | 556 | int temp; |
557 | DECLARE_WAIT_QUEUE_HEAD (unlink_wakeup); | 557 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK (unlink_wakeup); |
558 | DECLARE_WAITQUEUE (wait, current); | 558 | DECLARE_WAITQUEUE (wait, current); |
559 | 559 | ||
560 | netif_stop_queue (net); | 560 | netif_stop_queue (net); |
diff --git a/include/linux/wait.h b/include/linux/wait.h index b3b9048421d8..e820d00e1383 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -79,6 +79,15 @@ struct task_struct; | |||
79 | 79 | ||
80 | extern void init_waitqueue_head(wait_queue_head_t *q); | 80 | extern void init_waitqueue_head(wait_queue_head_t *q); |
81 | 81 | ||
82 | #ifdef CONFIG_LOCKDEP | ||
83 | # define __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) \ | ||
84 | ({ init_waitqueue_head(&name); name; }) | ||
85 | # define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) \ | ||
86 | wait_queue_head_t name = __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) | ||
87 | #else | ||
88 | # define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) DECLARE_WAIT_QUEUE_HEAD(name) | ||
89 | #endif | ||
90 | |||
82 | static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) | 91 | static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) |
83 | { | 92 | { |
84 | q->flags = 0; | 93 | q->flags = 0; |