modprobe ipmi_si hangs under 2.6.30-rc5
Hi,
On a Dell PowerEdge 2650 2.6.30-rc5 can't load the ipmi_si module. 2.6.29 has no such problems:
[ 46.292160] IPMI System Interface driver. [ 46.300321] ipmi_si: Trying SMBIOS-specified smic state machine at i/o address 0xecf4, slave address 0x20, irq 0 [ 46.408212] ipmi: Found new BMC (man_id: 0x0002a2, prod_id: 0x0000, dev_id: 0x00) [ 46.423454] IPMI smic interface initialized
But under 2.6.30-rc5:
# modprobe ipmi_si bt_debug=7 smic_debug=7 kcs_debug=7
[ 867.851694] IPMI System Interface driver. [ 867.859771] ipmi_si: Trying SMBIOS-specified smic state machine at i/o address 0xecf4, slave address 0x20, irq 0 [ 867.880250] start_smic_transaction - 18 01 [ 867.880263] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.880271] smic_event - state = 1, flags = 0x4c, status = 0xc0 [ 867.880278] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.884133] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.884142] smic_event - state = 2, flags = 0x4c, status = 0xc0 [ 867.884150] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.888117] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.888125] smic_event - state = 3, flags = 0x4c, status = 0xc1 [ 867.888133] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.892229] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.892245] smic_event - state = 5, flags = 0x0c, status = 0xc3 [ 867.892256] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.892270] smic_event - state = 6, flags = 0x0c, status = 0xc3 [ 867.896996] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.897008] smic_event - state = 6, flags = 0xcc, status = 0xc3 [ 867.897020] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.904022] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.904031] smic_event - state = 7, flags = 0xcc, status = 0xc4 [ 867.904038] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.908101] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.908109] smic_event - state = 8, flags = 0xcc, status = 0xc5 [ 867.908117] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.912129] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.912137] smic_event - state = 8, flags = 0xcc, status = 0xc5 [ 867.912145] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.916104] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.916112] smic_event - state = 8, flags = 0xcc, status = 0xc5 [ 867.916120] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.920106] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.920114] smic_event - state = 8, flags = 0xcc, status = 0xc5 [ 867.920121] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.924100] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.924108] smic_event - state = 8, flags = 0xcc, status = 0xc5 [ 867.924115] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.928115] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.928123] smic_event - state = 8, flags = 0xcc, status = 0xc5 [ 867.928130] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.932102] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.932110] smic_event - state = 8, flags = 0xcc, status = 0xc5 [ 867.932118] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.936111] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.936119] smic_event - state = 8, flags = 0xcc, status = 0xc5 [ 867.936127] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.940110] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.940118] smic_event - state = 8, flags = 0xcc, status = 0xc5 [ 867.940127] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.944123] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.944131] smic_event - state = 8, flags = 0xcc, status = 0xc5 [ 867.944139] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.948194] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.948205] smic_event - state = 8, flags = 0xcc, status = 0xc5 [ 867.948215] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.952111] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.952119] smic_event - state = 8, flags = 0xcc, status = 0xc5 [ 867.952127] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.956114] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.956121] smic_event - state = 8, flags = 0xcc, status = 0xc6 [ 867.956129] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.960112] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.960120] smic_event - state = 9, flags = 0x4c, status = 0xc0 [ 867.960126] smic_get result - 1c 01 00 00 00 03 38 01 3f a2 02 00 00 00 [ 867.960155] start_smic_transaction - 18 2f [ 867.960164] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.960172] smic_event - state = 1, flags = 0x4c, status = 0xc0 [ 867.960179] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.964196] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.964204] smic_event - state = 2, flags = 0x4c, status = 0xc0 [ 867.964211] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.968106] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.968114] smic_event - state = 3, flags = 0x4c, status = 0xc1 [ 867.968122] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.972110] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.972118] smic_event - state = 5, flags = 0xcc, status = 0xc3 [ 867.972124] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.972130] smic_event - state = 6, flags = 0xcc, status = 0xc3 [ 867.972137] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.976133] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.976144] smic_event - state = 7, flags = 0xcc, status = 0xc4 [ 867.976155] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.981016] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.981024] smic_event - state = 8, flags = 0xcc, status = 0xc5 [ 867.981032] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.985138] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.985145] smic_event - state = 8, flags = 0xcc, status = 0xc5 [ 867.985153] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.989106] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.989114] smic_event - state = 8, flags = 0xcc, status = 0xc6 [ 867.989121] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.993115] smic_event - smic->smic_timeout = 2000000, time = 100 [ 867.993123] smic_event - state = 9, flags = 0x4c, status = 0xc0 [ 867.993129] smic_get result - 1c 2f 00 2c [ 867.993141] start_smic_transaction - 18 30 08 [ 867.993351] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.993360] smic_event - state = 1, flags = 0x4c, status = 0xc0 [ 867.993367] smic_event - smic->smic_timeout = 2000000, time = 0 [...] [ 867.996183] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.996190] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.996197] smic_event - state = 9, flags = 0x4c, status = 0xc0 [ 867.996203] smic_get result - 1c 30 00 [ 867.996215] smic_event - state = 0, flags = 0x4c, status = 0xc0 [ 867.996220] start_smic_transaction - 18 31 [ 867.996229] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.996236] smic_event - state = 1, flags = 0x4c, status = 0xc0 [ 867.996243] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.996250] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.996256] smic_event - smic->smic_timeout = 2000000, time = 0
[...]
This goes on through megabytes. The modprobe process didn't terminate for 10 minutes, and there was some output like this (cleaned from smic_events all around the place by hand):
INFO: task modprobe:6414 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
modprobe D f6805780 0 6414 4077
f48dfe68 00000082 00000000 f6805780
f48dfe48 f90271cf c046acc0 f64f6a0c
2002132c f6da1300 f6da14b4 c182acc0
00000002 f64f6a0c 186f5ef2 000000ca
f48dfe30 c0123c40 00000000 f64f69e0
f48dfe30 00000282 00000001 c032456c
Call Trace: [<f90271cf>] ? i_ipmi_request+0x8f5/0x916 [ipmi_msghandler] [<c0123c40>] ? check_preempt_wakeup+0x146/0x180 [<c01292c3>] ? try_to_wake_up+0x1f3/0x1fd [<c011c70a>] ? default_spin_lock_flags+0x8/0xe [<c031b81a>] schedule+0x8/0x17 [<f9028745>] ipmi_register_smi+0x3ca/0xba1 [ipmi_msghandler] [<c028681c>] ? put_device+0xf/0x11 [<c028782a>] ? device_add+0x497/0x516 [<c013f2e7>] ? autoremove_wake_function+0x0/0x33 [<fc2d939c>] try_smi_init+0x58f/0x726 [ipmi_si] [<fc2dc3e5>] init_ipmi_si+0x3e2/0x748 [ipmi_si] [<c010304f>] do_one_initcall+0x4a/0x115 [<fc2dc003>] ? init_ipmi_si+0x0/0x748 [ipmi_si] [<c0142c0b>] ? __blocking_notifier_call_chain+0x40/0x4c [<c014ff97>] sys_init_module+0x87/0x18b [<c0107c94>] sysenter_do_call+0x12/0x28
lspci -x of Class ff00:
00:04.0 Class ff00: Dell Embedded Remote Access or ERA/O 00: 28 10 0c 00 17 01 90 02 00 00 00 ff 10 20 80 00 10: 08 00 b8 fe f9 ec 00 00 e9 ec 00 00 00 00 00 00 20: 00 00 00 00 00 00 00 00 00 00 00 00 28 10 0c 00 30: 00 00 00 fe 48 00 00 00 00 00 00 00 0b 01 00 00
00:04.1 Class ff00: Dell Remote Access Card III 00: 28 10 08 00 03 01 90 02 00 00 00 ff 10 20 80 00 10: 00 20 10 fe 81 ec 00 00 08 00 b0 fe 00 00 00 00 20: 00 00 00 00 00 00 00 00 00 00 00 00 28 10 08 00 30: 00 00 00 00 48 00 00 00 00 00 00 00 0a 02 00 00
00:04.2 Class ff00: Dell Embedded Remote Access: BMC/SMIC device 00: 28 10 0d 00 03 01 90 02 00 00 00 ff 10 20 80 00 10: f5 ec 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20: 00 00 00 00 00 00 00 00 00 00 00 00 28 10 0d 00 30: 00 00 00 00 48 00 00 00 00 00 00 00 07 03 00 00
lspci -nv of the same:
00:04.0 ff00: 1028:000c
Subsystem: 1028:000c
Flags: bus master, medium devsel, latency 32, IRQ 11 Memory at feb80000 (32-bit, prefetchable) [size=4K] I/O ports at ecf8 [size=8]
I/O ports at ece8 [size=8]
Expansion ROM at fe000000 [disabled] [size=64K]
Capabilities: [48] Power Management version 2
00:04.1 ff00: 1028:0008
Subsystem: 1028:0008 Flags: medium devsel, IRQ 23 Memory at fe102000 (32-bit, non-prefetchable) [size=4K] I/O ports at ec80 [size=64] Memory at feb00000 (32-bit, prefetchable) [size=512K] Capabilities: [48] Power Management version 2 Kernel driver in use: serial
00:04.2 ff00: 1028:000d
Subsystem: 1028:000d
Flags: medium devsel, IRQ 7
I/O ports at ecf4 [size=4]
Capabilities: [48] Power Management version 2
Signature · 2 lines
Regards, Feri.
Quoted 48 lines · On Tue, 12 May 2009 23:28:59 +0200 Ferenc Wagner <[email protected]> wrote:
Hi,
On a Dell PowerEdge 2650 2.6.30-rc5 can't load the
ipmi_simodule. 2.6.29 has no such problems:[ 46.292160] IPMI System Interface driver. [ 46.300321] ipmi_si: Trying SMBIOS-specified smic state machine at i/o address 0xecf4, slave address 0x20, irq 0 [ 46.408212] ipmi: Found new BMC (man_id: 0x0002a2, prod_id: 0x0000, dev_id: 0x00) [ 46.423454] IPMI smic interface initializedBut under 2.6.30-rc5:
# modprobe ipmi_si bt_debug=7 smic_debug=7 kcs_debug=7[ 867.851694] IPMI System Interface driver. [ 867.859771] ipmi_si: Trying SMBIOS-specified smic state machine at i/o address 0xecf4, slave address 0x20, irq 0 [ 867.880250] start_smic_transaction - 18 01 [ 867.880263] smic_event - smic->smic_timeout = 2000000, time = 0...
[ 867.996243] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.996250] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.996256] smic_event - smic->smic_timeout = 2000000, time = 0[...]
This goes on through megabytes. The modprobe process didn't terminate for 10 minutes, and there was some output like this (cleaned from
smic_eventsall around the place by hand):INFO: task modprobe:6414 blocked for more than 120 seconds."echo 0 >
/proc/sys/kernel/hung_task_timeout_secs" disables this message.
modprobe Df68057800 6414 4077
f48dfe6800000082 00000000f6805780
f48dfe48f90271cfc046acc0f64f6a0c
2002132cf6da1300f6da14b4c182acc0
00000002f64f6a0c186f5ef2000000ca
f48dfe30c0123c4000000000f64f69e0
f48dfe3000000282 00000001c032456cCall Trace: [<f90271cf>] ? i_ipmi_request+0x8f5/0x916 [ipmi_msghandler] [<c0123c40>] ? check_preempt_wakeup+0x146/0x180 [<c01292c3>] ? try_to_wake_up+0x1f3/0x1fd [<c011c70a>] ? default_spin_lock_flags+0x8/0xe [<c031b81a>] schedule+0x8/0x17 [<f9028745>] ipmi_register_smi+0x3ca/0xba1 [ipmi_msghandler] [<c028681c>] ? put_device+0xf/0x11 [<c028782a>] ? device_add+0x497/0x516
Quoted 9 lines
[<c013f2e7>] ? autoremove_wake_function+0x0/0x33 [<fc2d939c>] try_smi_init+0x58f/0x726 [ipmi_si] [<fc2dc3e5>] init_ipmi_si+0x3e2/0x748 [ipmi_si] [<c010304f>] do_one_initcall+0x4a/0x115 [<fc2dc003>] ? init_ipmi_si+0x0/0x748 [ipmi_si] [<c0142c0b>] ? __blocking_notifier_call_chain+0x40/0x4c [<c014ff97>] sys_init_module+0x87/0x18b [<c0107c94>] sysenter_do_call+0x12/0x28
Well there have only been a handful of changes to ipmi since 2.6.29. Could you try a mini-bisection?
Apply revert-1.patch, test
Apply revert-2.patch, test
Apply revert-3.patch, test
Apply revert-4.patch, test
Attached.
Thanks.
From: Andrew Morton <[email protected]>
commit 4dec302ff71ebf48f5784a2d2fc5e3745e6d4d52
Author: dann frazier <[email protected]> Date: Tue Apr 21 12:24:05 2009 -0700
ipmi: add oem message handling
Enable userspace to receive messages that a BMC transmits using an OEM medium. This is used by the HP iLO2.
Based on code originally written by Patrick Schoeller.
---
drivers/char/ipmi/ipmi_msghandler.c | 138 -------------------------- include/linux/ipmi.h | 2 include/linux/ipmi_msgdefs.h | 2 3 files changed, 5 insertions(+), 137 deletions(-)
drivers/char/ipmi/ipmi_msghandler.c renamed from drivers/char/ipmi/ipmi_msghandler.c~revert-1 +5 -133
@@ -3284,114 +3284,6 @@ static int handle_lan_get_msg_cmd(ipmi_sreturn rv; } -/* -* This routine will handle "Get Message" command responses with -* channels that use an OEM Medium. The message format belongs to -* the OEM. See IPMI 2.0 specification, Chapter 6 and -* Chapter 22, sections 22.6 and 22.24 for more details. -*/ -static int handle_oem_get_msg_cmd (ipmi_smi_t intf, -struct ipmi_smi_msg *msg) -{ -struct cmd_rcvr *rcvr; -int rv =0 ; -unsigned char netfn; -unsigned char cmd; -unsigned char chan; -ipmi_user_t user =NULL ; -struct ipmi_system_interface_addr *smi_addr; -struct ipmi_recv_msg *recv_msg; - -/* -* We expect the OEM SW to perform error checking -* so we just do some basic sanity checks -*/ -if (msg->rsp_size <4 ) { -/* Message not big enough, just ignore it. */ -ipmi_inc_stat (intf, invalid_commands); -return 0 ; - } - -if (msg->rsp[2 ] !=0 ) { -/* An error getting the response, just ignore it. */ -return 0 ; - } - -/* -* This is an OEM Message so the OEM needs to know how -* handle the message. We do no interpretation. -*/ - netfn = msg->rsp[0 ] >>2 ; - cmd = msg->rsp[1 ]; - chan = msg->rsp[3 ] &0xf ; - -rcu_read_lock (); - rcvr =find_cmd_rcvr (intf, netfn, cmd, chan); -if (rcvr) { - user = rcvr->user; -kref_get (&user->refcount); - }else - user =NULL ; -rcu_read_unlock (); - -if (user ==NULL ) { -/* We didn't find a user, just give up. */ -ipmi_inc_stat (intf, unhandled_commands); - -/* -* Don't do anything with these messages, just allow -* them to be freed. -*/ - - rv =0 ; - }else { -/* Deliver the message to the user. */ -ipmi_inc_stat (intf, handled_commands); - - recv_msg =ipmi_alloc_recv_msg (); -if (!recv_msg) { -/* -* We couldn't allocate memory for the -* message, so requeue it for handling -* later. -*/ - rv =1 ; -kref_put (&user->refcount, free_user); - }else { -/* -* OEM Messages are expected to be delivered via -* the system interface to SMS software. We might -* need to visit this again depending on OEM -* requirements -*/ - smi_addr = ((struct ipmi_system_interface_addr *) - &(recv_msg->addr)); - smi_addr->addr_type =IPMI_SYSTEM_INTERFACE_ADDR_TYPE ; - smi_addr->channel =IPMI_BMC_CHANNEL ; - smi_addr->lun = msg->rsp[0 ] &3 ; - - recv_msg->user = user; - recv_msg->user_msg_data =NULL ; - recv_msg->recv_type =IPMI_OEM_RECV_TYPE ; - recv_msg->msg.netfn = msg->rsp[0 ] >>2 ; - recv_msg->msg.cmd = msg->rsp[1 ]; - recv_msg->msg.data = recv_msg->msg_data; - -/* -* The message starts at byte 4 which follows the -* the Channel Byte in the "GET MESSAGE" command -*/ - recv_msg->msg.data_len = msg->rsp_size -4 ; -memcpy (recv_msg->msg_data, - &(msg->rsp[4 ]), - msg->rsp_size -4 ); -deliver_response (recv_msg); - } - } - -return rv; -} -static void copy_event_into_recv_msg (struct ipmi_recv_msg *recv_msg,struct ipmi_smi_msg *msg) {
@@ -3647,17 +3539,6 @@ static int handle_new_recv_msg(ipmi_smi_ goto out; } -/* -** We need to make sure the channels have been initialized. -** The channel_handler routine will set the "curr_channel" -** equal to or greater than IPMI_MAX_CHANNELS when all the -** channels for this interface have been initialized. -*/ -if (intf->curr_channel <IPMI_MAX_CHANNELS ) { - requeue =1 ;/* Just put the message back for now */ - goto out; - } -switch (intf->channels[chan].medium) {case IPMI_CHANNEL_MEDIUM_IPMB :if (msg->rsp[4 ] &0x04 ) {
@@ -3693,20 +3574,11 @@ static int handle_new_recv_msg(ipmi_smi_break ;default : -/* Check for OEM Channels. Clients had better -register for these commands. */ -if ((intf->channels[chan].medium - >=IPMI_CHANNEL_MEDIUM_OEM_MIN ) - && (intf->channels[chan].medium - <=IPMI_CHANNEL_MEDIUM_OEM_MAX )) { - requeue =handle_oem_get_msg_cmd (intf, msg); - }else { -/* -* We don't handle the channel type, so just -* free the message. -*/ - requeue =0 ; - } +/* +* We don't handle the channel type, so just +* free the message. +*/ + requeue =0 ; } } else if ((msg->rsp[0] == ((IPMI_NETFN_APP_REQUEST|1) << 2))
include/linux/ipmi.h renamed from include/linux/ipmi.h~revert-1 +0 -2
@@ -198,8 +198,6 @@ struct kernel_ipmi_msg {response. When you send a response message, this will be returned. */ -#define IPMI_OEM_RECV_TYPE 5/* The response for OEM Channels */ -/* Note that async events and received commands do not have a completion code as the first byte of the incoming data, unlike a response. */
include/linux/ipmi_msgdefs.h renamed from include/linux/ipmi_msgdefs.h~revert-1 +0 -2
@@ -115,7 +115,5 @@#define IPMI_CHANNEL_MEDIUM_USB1 10#define IPMI_CHANNEL_MEDIUM_USB2 11#define IPMI_CHANNEL_MEDIUM_SYSINTF 12 -#define IPMI_CHANNEL_MEDIUM_OEM_MIN 0x60 -#define IPMI_CHANNEL_MEDIUM_OEM_MAX 0x7f#endif /* __LINUX_IPMI_MSGDEFS_H */
_
From: Andrew Morton <[email protected]>
commit 25176ed670121e1e0aae5c8161713c332b786538
Author: Corey Minyard <[email protected]> Date: Tue Apr 21 12:24:04 2009 -0700
ipmi: fix statistics counting issues
Bela Lubkin noticed that the statistics for send IPMB and LAN commands in the IPMI driver could be incremented even if an error occurred. Move the increments to the proper place to avoid this.
Also add some statistics for retransmissions that failed, and some little helper functions to neaten up the code a little.
---
drivers/char/ipmi/ipmi_msghandler.c | 73 +++++++------------------- 1 file changed, 22 insertions(+), 51 deletions(-)
drivers/char/ipmi/ipmi_msghandler.c renamed from drivers/char/ipmi/ipmi_msghandler.c~revert-2 +22 -51
173 lines not on this page · raw message
_
From: Andrew Morton <[email protected]>
commit 40112ae7504745799e75ef418057f0d2cb745050
Author: Corey Minyard <[email protected]> Date: Tue Apr 21 12:24:03 2009 -0700
ipmi: test for event buffer before using
The IPMI driver would attempt to use the event buffer even if that didn't exist on the BMC. This patch modified the IPMI driver to check for the event buffer's existence before trying to use it.
---
drivers/char/ipmi/ipmi_si_intf.c | 148 +++++------------------------ include/linux/ipmi_msgdefs.h | 6 - 2 files changed, 29 insertions(+), 125 deletions(-)
drivers/char/ipmi/ipmi_si_intf.c renamed from drivers/char/ipmi/ipmi_si_intf.c~revert-3 +29 -119
198 lines not on this page · raw message
include/linux/ipmi_msgdefs.h renamed from include/linux/ipmi_msgdefs.h~revert-3 +0 -6
@@ -58,12 +58,6 @@#define IPMI_READ_EVENT_MSG_BUFFER_CMD 0x35#define IPMI_GET_CHANNEL_INFO_CMD 0x42 -/* Bit for BMC global enables. */ -#define IPMI_BMC_RCV_MSG_INTR 0x01 -#define IPMI_BMC_EVT_MSG_INTR 0x02 -#define IPMI_BMC_EVT_MSG_BUFF 0x04 -#define IPMI_BMC_SYS_LOG 0x08 -#define IPMI_NETFN_STORAGE_REQUEST 0x0a#define IPMI_NETFN_STORAGE_RESPONSE 0x0b#define IPMI_ADD_SEL_ENTRY_CMD 0x44
_
From: Andrew Morton <[email protected]>
commit 8b32b5d0dca2f5ab632e8bedcd57fe4c109c13fe
Author: Corey Minyard <[email protected]> Date: Tue Apr 21 12:24:02 2009 -0700
ipmi: fix platform return check
The wrong return value is being tested when allocating a platform device in the IPMI SI code. Check the right value.
---
drivers/char/ipmi/ipmi_si_intf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/ipmi/ipmi_si_intf.c renamed from drivers/char/ipmi/ipmi_si_intf.c~revert-4 +1 -1
@@ -2863,7 +2863,7 @@ static int try_smi_init(struct smi_info*/ new_smi->pdev =platform_device_alloc ("ipmi_si" , new_smi->intf_num); -if (!new_smi->pdev) { +if (rv) {printk (KERN_ERR "ipmi_si_intf:" " Unable to allocate platform device\n" );
_
Quoted 58 lines · Andrew Morton
Quoted 46 lines · On Tue, 12 May 2009 23:28:59 +0200 Ferenc Wagner <[email protected]> wrote:
On a Dell PowerEdge 2650 2.6.30-rc5 can't load the
ipmi_simodule. 2.6.29 has no such problems:[ 46.292160] IPMI System Interface driver. [ 46.300321] ipmi_si: Trying SMBIOS-specified smic state machine at i/o address 0xecf4, slave address 0x20, irq 0 [ 46.408212] ipmi: Found new BMC (man_id: 0x0002a2, prod_id: 0x0000, dev_id: 0x00) [ 46.423454] IPMI smic interface initializedBut under 2.6.30-rc5:
# modprobe ipmi_si bt_debug=7 smic_debug=7 kcs_debug=7[ 867.851694] IPMI System Interface driver. [ 867.859771] ipmi_si: Trying SMBIOS-specified smic state machine at i/o address 0xecf4, slave address 0x20, irq 0 [ 867.880250] start_smic_transaction - 18 01 [ 867.880263] smic_event - smic->smic_timeout = 2000000, time = 0...
[ 867.996243] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.996250] smic_event - smic->smic_timeout = 2000000, time = 0 [ 867.996256] smic_event - smic->smic_timeout = 2000000, time = 0[...]
This goes on through megabytes. The modprobe process didn't terminate for 10 minutes, and there was some output like this (cleaned from
smic_eventsall around the place by hand):INFO: task modprobe:6414 blocked for more than 120 seconds."echo 0 >
/proc/sys/kernel/hung_task_timeout_secs" disables this message.
modprobe Df68057800 6414 4077
f48dfe6800000082 00000000f6805780
f48dfe48f90271cfc046acc0f64f6a0c
2002132cf6da1300f6da14b4c182acc0
00000002f64f6a0c186f5ef2000000ca
f48dfe30c0123c4000000000f64f69e0
f48dfe3000000282 00000001c032456cCall Trace: [<f90271cf>] ? i_ipmi_request+0x8f5/0x916 [ipmi_msghandler] [<c0123c40>] ? check_preempt_wakeup+0x146/0x180 [<c01292c3>] ? try_to_wake_up+0x1f3/0x1fd [<c011c70a>] ? default_spin_lock_flags+0x8/0xe [<c031b81a>] schedule+0x8/0x17 [<f9028745>] ipmi_register_smi+0x3ca/0xba1 [ipmi_msghandler] [<c028681c>] ? put_device+0xf/0x11 [<c028782a>] ? device_add+0x497/0x516Quoted 9 lines
[<c013f2e7>] ? autoremove_wake_function+0x0/0x33 [<fc2d939c>] try_smi_init+0x58f/0x726 [ipmi_si] [<fc2dc3e5>] init_ipmi_si+0x3e2/0x748 [ipmi_si] [<c010304f>] do_one_initcall+0x4a/0x115 [<fc2dc003>] ? init_ipmi_si+0x0/0x748 [ipmi_si] [<c0142c0b>] ? __blocking_notifier_call_chain+0x40/0x4c [<c014ff97>] sys_init_module+0x87/0x18b [<c0107c94>] sysenter_do_call+0x12/0x28
Quoted 7 lines
Well there have only been a handful of changes to ipmi since 2.6.29. Could you try a mini-bisection?
Apply revert-1.patch, test
Apply revert-2.patch, test
Apply revert-3.patch, test
Apply revert-4.patch, test
After applying revert-1.patch, modprobe runs OK:
[ 86.968156] IPMI System Interface driver. [ 86.976276] ipmi_si: Trying SMBIOS-specified smic state machine at i/o address 0xecf4, slave address 0x20, irq 0 [ 87.117630] ipmi: Found new BMC (man_id: 0x0002a2, prod_id: 0x0000, dev_id: 0x00) [ 87.133078] IPMI smic interface initialized
I guess there's no point in trying the rest.
When loading with debug options, it still produces insane amount of debug messages continuously (first 671 lines of it attached).
Signature · 2 lines
Regards, Feri.
Quoted 10 lines · Ferenc Wagner
Quoted 7 lines · Andrew Morton
Well there have only been a handful of changes to ipmi since 2.6.29. Could you try a mini-bisection?
Apply revert-1.patch, test
Apply revert-2.patch, test
Apply revert-3.patch, test
Apply revert-4.patch, test
Quoted 8 lines
After applying revert-1.patch, modprobe runs OK:
[ 86.968156] IPMI System Interface driver. [ 86.976276] ipmi_si: Trying SMBIOS-specified smic state machine at i/o address 0xecf4, slave address 0x20, irq 0 [ 87.117630] ipmi: Found new BMC (man_id: 0x0002a2, prod_id: 0x0000, dev_id: 0x00) [ 87.133078] IPMI smic interface initializedI guess there's no point in trying the rest.
I think I see the problem. Can you try the patch at the end of the email? I can't test it because I don't have an IPMI 1.0 sytem. Thanks for setting up the mini-bisection, Andrew.
Quoted 3 lines
When loading with debug options, it still produces insane amount of debug messages continuously (first 671 lines of it attached).
Yes, full debugging generates a ton of output, it logs everything it does in that case.
Thanks,
-corey
Set the current channel to the number of channels in an IPMI 1.0 system, as this value is used to tell if the channel information has been initialized.
drivers/char/ipmi/ipmi_msghandler.c +1 -0
@@ -2856,6 +2856,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,/* Assume a single IPMB channel at zero. */ intf->channels[0 ].medium =IPMI_CHANNEL_MEDIUM_IPMB ; intf->channels[0 ].protocol =IPMI_CHANNEL_PROTOCOL_IPMB ; + intf->curr_channel =1 ; }if (rv ==0 )
Quoted 18 lines · Corey Minyard
Quoted 17 lines · Ferenc Wagner
Quoted 7 lines · Andrew Morton
Well there have only been a handful of changes to ipmi since 2.6.29. Could you try a mini-bisection?
Apply revert-1.patch, test
Apply revert-2.patch, test
Apply revert-3.patch, test
Apply revert-4.patch, testAfter applying revert-1.patch, modprobe runs OK:
[ 86.968156] IPMI System Interface driver. [ 86.976276] ipmi_si: Trying SMBIOS-specified smic state machine at i/o address 0xecf4, slave address 0x20, irq 0 [ 87.117630] ipmi: Found new BMC (man_id: 0x0002a2, prod_id: 0x0000, dev_id: 0x00) [ 87.133078] IPMI smic interface initialized
Quoted 4 lines
Quoted 1 line
I guess there's no point in trying the rest.
I think I see the problem. Can you try the patch at the end of the email? I can't test it because I don't have an IPMI 1.0 sytem.
I tried your patch on top of 2.6.30-rc6. Unfortunately it did not help (nor made /proc/ipmi/ipmi0 appear at least).
Quoted 5 lines
Quoted 2 lines
When loading with debug options, it still produces insane amount of debug messages continuously (first 671 lines of it attached).
Yes, full debugging generates a ton of output, it logs everything it does in that case.
My concern is that it does something too often, not letting the CPU enter deep sleep states, perhaps. Or is that also an artifact of debugging?
Signature · 2 lines
Thanks, Feri.
Quoted 3 lines · Ferenc Wagner
Corey Minyard <[email protected]> writes:
Sorry, I've been slow, but I just got back from a week out of the country and I'm trying to catch up.
Quoted 5 lines
I tried your patch on top of 2.6.30-rc6. Unfortunately it did not help (nor made
/proc/ipmi/ipmi0appear at least).
I know what is happening now. Can you try the attached patch? I'm disabling the requeue and discarding the message when an IPMB message is received before everything is initialized. If you don't, the code will not deliver any messages because something is already in the queue.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
When loading with debug options, it still produces insane amount of debug messages continuously (first 671 lines of it attached).
Quoted 8 lines
Quoted 3 lines
Yes, full debugging generates a ton of output, it logs everything it does in that case.
My concern is that it does something too often, not letting the CPU enter deep sleep states, perhaps. Or is that also an artifact of debugging?
No, it's an artifact of a lousy hardware interface. Very few IPMI interfaces support interrupts, so they have to be polled :(.
-corey
Instead of queuing IPMB messages before channel initialization, just throw them away. Nobody will be listening for them at this point, anyway, and they will clog up the queue and nothing will be delivered if we queue them.
Also set the current channel to the number of channels, as this value is used to tell if the channel information has been initialized.
drivers/char/ipmi/ipmi_msghandler.c +7 -6
@@ -2856,6 +2856,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,/* Assume a single IPMB channel at zero. */ intf->channels[0 ].medium =IPMI_CHANNEL_MEDIUM_IPMB ; intf->channels[0 ].protocol =IPMI_CHANNEL_PROTOCOL_IPMB ; + intf->curr_channel =IPMI_MAX_CHANNELS ; }if (rv ==0 )
@@ -3648,13 +3649,13 @@ static int handle_new_recv_msg(ipmi_smi_t intf, }/* -** We need to make sure the channels have been initialized. -** The channel_handler routine will set the "curr_channel" -** equal to or greater than IPMI_MAX_CHANNELS when all the -** channels for this interface have been initialized. -*/ +* We need to make sure the channels have been initialized. +* The channel_handler routine will set the "curr_channel" +* equal to or greater than IPMI_MAX_CHANNELS when all the +* channels for this interface have been initialized. +*/ if (intf->curr_channel <IPMI_MAX_CHANNELS ) { - requeue =1 ;/* Just put the message back for now */ + requeue =0 ;/* Throw the message away */ goto out; }
Quoted 5 lines · Corey Minyard
I know what is happening now. Can you try the attached patch? I'm disabling the requeue and discarding the message when an IPMB message is received before everything is initialized. If you don't, the code will not deliver any messages because something is already in the queue.
Yep, that fixed it, modprobe runs through now!
Quoted 8 lines
Quoted 3 lines · Ferenc Wagner
My concern is that it does something too often, not letting the CPU enter deep sleep states, perhaps. Or is that also an artifact of debugging?
No, it's an artifact of a lousy hardware interface. Very few IPMI interfaces support interrupts, so they have to be polled :(.
I'd say this isn't an artifact but the sad truth itself. Just out of interest, how often does the driver wake up to check the inteface?
Signature · 2 lines
Thanks, Feri.
Quoted 12 lines · Ferenc Wagner
Quoted 6 lines · Corey Minyard
I know what is happening now. Can you try the attached patch? I'm disabling the requeue and discarding the message when an IPMB message is received before everything is initialized. If you don't, the code will not deliver any messages because something is already in the queue.
Yep, that fixed it, modprobe runs through now!
Thanks for testing this.
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines · Ferenc Wagner
My concern is that it does something too often, not letting the CPU enter deep sleep states, perhaps. Or is that also an artifact of debugging?
Quoted 7 lines
Quoted 3 lines
No, it's an artifact of a lousy hardware interface. Very few IPMI interfaces support interrupts, so they have to be polled :(.
I'd say this isn't an artifact but the sad truth itself. Just out of interest, how often does the driver wake up to check the inteface?
I'd have to agree.
When idle, the driver wakes up every 10ms to check for something on the driver. When a message is in transit, it's every jiffie.
-corey
Quoted 7 lines · Corey Minyard
Quoted 2 lines · Ferenc Wagner
Just out of interest, how often does the driver wake up to check the inteface?
When idle, the driver wakes up every 10ms to check for something on the driver.
Wow, 100 times per second, that sure sounds gross for piping out SEL entries! Though it certainly doesn't matter much for our servers, but hasn't it got the potential to heavily tax laptop batteries? Or is that why ipmi_si isn't loaded automatically by udev?
Signature · 2 lines
Thanks, Feri.
Quoted 9 lines · Ferenc Wagner
Quoted 6 lines · Corey Minyard
Quoted 3 lines · Ferenc Wagner
Just out of interest, how often does the driver wake up to check the inteface?
Quoted 9 lines
Quoted 3 lines
When idle, the driver wakes up every 10ms to check for something on the driver.
Wow, 100 times per second, that sure sounds gross for piping out SEL entries! Though it certainly doesn't matter much for our servers, but hasn't it got the potential to heavily tax laptop batteries? Or is that why
ipmi_siisn't loaded automatically by udev?
IPMI is used for a lot of things beyond just getting SEL entries. I some cases (probably most) it's excessive, in others it's not.
However, AFAIK IPMI hardware is only available in server systems. I don't think it's ever been used in a laptop.
-corey
The driver only behaves this way on systems where it has to. If the BMC System Interface (SI) provides an interrupt, the kernel thread doesn't run. Everything is interrupt driven.
Anyone doing system software for x86 servers should be harrassing the hardware vendors to get this right...
Interrupts can be used with any of the SIs (BT, KCS, SMIC), but BT has the dual advantages of doing its transfers all at once via DMA, and having a well defined interrupt mechanism. Hardware designers implementing an interrupt for KCS or SMIC have to guess at a few too many details.
Agitate for BT IPMI SI!
(HP's IPMI causes the least drag of any of the big vendors. Although they use the same crummy char-by-char KCS SI [SMIC on older systems], they always provide an IPMI interrupt. I've heard that some modern Sun models use BT; haven't seen it in action yet.)
Quoted 44 lines
Bela<
-----Original Message-----
From: Ferenc Wagner [mailto:[email protected]]
Sent: Thursday, May 21, 2009 2:47 AM
To: Corey Minyard
Cc: Andrew Morton; [email protected]; [email protected]
Subject: Re: [Openipmi-developer] modprobeipmi_sihangs under 2.6.30-rc5Quoted 7 lines · Corey Minyard
Quoted 2 lines · Ferenc Wagner
Just out of interest, how often does the driver wake up to check the inteface?
When idle, the driver wakes up every 10ms to check for something on the driver.
Wow, 100 times per second, that sure sounds gross for piping out SEL entries! Though it certainly doesn't matter much for our servers, but hasn't it got the potential to heavily tax laptop batteries? Or is that why
ipmi_siisn't loaded automatically by udev?Signature · 17 lines
Thanks, Feri. -------------------------------------------------------------- ---------------- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://www.creativitycat.com _______________________________________________ Openipmi-developer mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openipmi-developer