]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.10.87/ipmi-fix-timeout-calculation-when-bmc-is-disconnected.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.10.87 / ipmi-fix-timeout-calculation-when-bmc-is-disconnected.patch
1 From e21404dc0ac7ac971c1e36274b48bb460463f4e5 Mon Sep 17 00:00:00 2001
2 From: Xie XiuQi <xiexiuqi@huawei.com>
3 Date: Fri, 24 Jan 2014 14:00:52 -0600
4 Subject: ipmi: fix timeout calculation when bmc is disconnected
5
6 From: Xie XiuQi <xiexiuqi@huawei.com>
7
8 commit e21404dc0ac7ac971c1e36274b48bb460463f4e5 upstream.
9
10 Loading ipmi_si module while bmc is disconnected, we found the timeout
11 is longer than 5 secs. Actually it takes about 3 mins and 20
12 secs.(HZ=250)
13
14 error message as below:
15 Dec 12 19:08:59 linux kernel: IPMI BT: timeout in RD_WAIT [ ] 1 retries left
16 Dec 12 19:08:59 linux kernel: BT: write 4 bytes seq=0x01 03 18 00 01
17 [...]
18 Dec 12 19:12:19 linux kernel: IPMI BT: timeout in RD_WAIT [ ]
19 Dec 12 19:12:19 linux kernel: failed 2 retries, sending error response
20 Dec 12 19:12:19 linux kernel: IPMI: BT reset (takes 5 secs)
21 Dec 12 19:12:19 linux kernel: IPMI BT: flag reset [ ]
22
23 Function wait_for_msg_done() use schedule_timeout_uninterruptible(1) to
24 sleep 1 tick, so we should subtract jiffies_to_usecs(1) instead of 100
25 usecs from timeout.
26
27 Reported-by: Hu Shiyuan <hushiyuan@huawei.com>
28 Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
29 Signed-off-by: Corey Minyard <cminyard@mvista.com>
30 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
31 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
32
33 ---
34 drivers/char/ipmi/ipmi_si_intf.c | 2 +-
35 1 file changed, 1 insertion(+), 1 deletion(-)
36
37 --- a/drivers/char/ipmi/ipmi_si_intf.c
38 +++ b/drivers/char/ipmi/ipmi_si_intf.c
39 @@ -2717,7 +2717,7 @@ static int wait_for_msg_done(struct smi_
40 smi_result == SI_SM_CALL_WITH_TICK_DELAY) {
41 schedule_timeout_uninterruptible(1);
42 smi_result = smi_info->handlers->event(
43 - smi_info->si_sm, 100);
44 + smi_info->si_sm, jiffies_to_usecs(1));
45 } else if (smi_result == SI_SM_CALL_WITHOUT_DELAY) {
46 smi_result = smi_info->handlers->event(
47 smi_info->si_sm, 0);