]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.10.96/ipmi-move-timer-init-to-before-irq-is-setup.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.10.96 / ipmi-move-timer-init-to-before-irq-is-setup.patch
CommitLineData
3c8871f3
GKH
1From 27f972d3e00b50639deb4cc1392afaeb08d3cecc Mon Sep 17 00:00:00 2001
2From: Jan Stancek <jstancek@redhat.com>
3Date: Tue, 8 Dec 2015 13:57:51 -0500
4Subject: ipmi: move timer init to before irq is setup
5
6From: Jan Stancek <jstancek@redhat.com>
7
8commit 27f972d3e00b50639deb4cc1392afaeb08d3cecc upstream.
9
10We encountered a panic on boot in ipmi_si on a dell per320 due to an
11uninitialized timer as follows.
12
13static 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
40The following patch fixes the problem.
41
42To: Openipmi-developer@lists.sourceforge.net
43To: Corey Minyard <minyard@acm.org>
44CC: linux-kernel@vger.kernel.org
45
46Signed-off-by: Jan Stancek <jstancek@redhat.com>
47Signed-off-by: Tony Camuso <tcamuso@redhat.com>
48Signed-off-by: Corey Minyard <cminyard@mvista.com>
49Signed-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 */