]>
Commit | Line | Data |
---|---|---|
3c8871f3 GKH |
1 | From 27f972d3e00b50639deb4cc1392afaeb08d3cecc Mon Sep 17 00:00:00 2001 |
2 | From: Jan Stancek <jstancek@redhat.com> | |
3 | Date: Tue, 8 Dec 2015 13:57:51 -0500 | |
4 | Subject: ipmi: move timer init to before irq is setup | |
5 | ||
6 | From: Jan Stancek <jstancek@redhat.com> | |
7 | ||
8 | commit 27f972d3e00b50639deb4cc1392afaeb08d3cecc upstream. | |
9 | ||
10 | We encountered a panic on boot in ipmi_si on a dell per320 due to an | |
11 | uninitialized timer as follows. | |
12 | ||
13 | static int smi_start_processing(void *send_info, | |
14 | ipmi_smi_t intf) | |
15 | { | |
16 | /* Try to claim any interrupts. */ | |
17 | if (new_smi->irq_setup) | |
18 | new_smi->irq_setup(new_smi); | |
19 | ||
20 | --> IRQ arrives here and irq handler tries to modify uninitialized timer | |
21 | ||
22 | which triggers BUG_ON(!timer->function) in __mod_timer(). | |
23 | ||
24 | Call Trace: | |
25 | <IRQ> | |
26 | [<ffffffffa0532617>] start_new_msg+0x47/0x80 [ipmi_si] | |
27 | [<ffffffffa053269e>] start_check_enables+0x4e/0x60 [ipmi_si] | |
28 | [<ffffffffa0532bd8>] smi_event_handler+0x1e8/0x640 [ipmi_si] | |
29 | [<ffffffff810f5584>] ? __rcu_process_callbacks+0x54/0x350 | |
30 | [<ffffffffa053327c>] si_irq_handler+0x3c/0x60 [ipmi_si] | |
31 | [<ffffffff810efaf0>] handle_IRQ_event+0x60/0x170 | |
32 | [<ffffffff810f245e>] handle_edge_irq+0xde/0x180 | |
33 | [<ffffffff8100fc59>] handle_irq+0x49/0xa0 | |
34 | [<ffffffff8154643c>] do_IRQ+0x6c/0xf0 | |
35 | [<ffffffff8100ba53>] ret_from_intr+0x0/0x11 | |
36 | ||
37 | /* Set up the timer that drives the interface. */ | |
38 | setup_timer(&new_smi->si_timer, smi_timeout, (long)new_smi); | |
39 | ||
40 | The following patch fixes the problem. | |
41 | ||
42 | To: Openipmi-developer@lists.sourceforge.net | |
43 | To: Corey Minyard <minyard@acm.org> | |
44 | CC: linux-kernel@vger.kernel.org | |
45 | ||
46 | Signed-off-by: Jan Stancek <jstancek@redhat.com> | |
47 | Signed-off-by: Tony Camuso <tcamuso@redhat.com> | |
48 | Signed-off-by: Corey Minyard <cminyard@mvista.com> | |
49 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
50 | ||
51 | --- | |
52 | drivers/char/ipmi/ipmi_si_intf.c | 8 ++++---- | |
53 | 1 file changed, 4 insertions(+), 4 deletions(-) | |
54 | ||
55 | --- a/drivers/char/ipmi/ipmi_si_intf.c | |
56 | +++ b/drivers/char/ipmi/ipmi_si_intf.c | |
57 | @@ -1144,14 +1144,14 @@ static int smi_start_processing(void | |
58 | ||
59 | new_smi->intf = intf; | |
60 | ||
61 | - /* Try to claim any interrupts. */ | |
62 | - if (new_smi->irq_setup) | |
63 | - new_smi->irq_setup(new_smi); | |
64 | - | |
65 | /* Set up the timer that drives the interface. */ | |
66 | setup_timer(&new_smi->si_timer, smi_timeout, (long)new_smi); | |
67 | smi_mod_timer(new_smi, jiffies + SI_TIMEOUT_JIFFIES); | |
68 | ||
69 | + /* Try to claim any interrupts. */ | |
70 | + if (new_smi->irq_setup) | |
71 | + new_smi->irq_setup(new_smi); | |
72 | + | |
73 | /* | |
74 | * Check if the user forcefully enabled the daemon. | |
75 | */ |