Skip to content

Commit

Permalink
[PATCH] IPMI: allow user to override the kernel IPMI daemon enable
Browse files Browse the repository at this point in the history
After the previous patch to disable the kernel IPMI daemon if interrupts
were available, the issue of broken hardware was raised, and a reasonable
request to add an override was mode.  So here it is.

Allow the user to force the kernel ipmi daemon on or off.  This way,
hardware with broken interrupts or users that are not concerned with
performance can turn it on or off to their liking.

[akpm@osdl.org: save 4 bytes in vmlinux]
Signed-off-by: Corey Minyard <minyard@acm.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
cminyard authored and Linus Torvalds committed Oct 3, 2006
1 parent 2537d36 commit a51f4a8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
10 changes: 9 additions & 1 deletion Documentation/IPMI.txt
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ You can change this at module load time (for a module) with:
regspacings=<sp1>,<sp2>,... regsizes=<size1>,<size2>,...
regshifts=<shift1>,<shift2>,...
slave_addrs=<addr1>,<addr2>,...
force_kipmid=<enable1>,<enable2>,...

Each of these except si_trydefaults is a list, the first item for the
first interface, second item for the second interface, etc.
Expand Down Expand Up @@ -409,7 +410,13 @@ The slave_addrs specifies the IPMI address of the local BMC. This is
usually 0x20 and the driver defaults to that, but in case it's not, it
can be specified when the driver starts up.

When compiled into the kernel, the addresses can be specified on the
The force_ipmid parameter forcefully enables (if set to 1) or disables
(if set to 0) the kernel IPMI daemon. Normally this is auto-detected
by the driver, but systems with broken interrupts might need an enable,
or users that don't want the daemon (don't need the performance, don't
want the CPU hit) can disable it.

When compiled into the kernel, the parameters can be specified on the
kernel command line as:

ipmi_si.type=<type1>,<type2>...
Expand All @@ -419,6 +426,7 @@ kernel command line as:
ipmi_si.regsizes=<size1>,<size2>,...
ipmi_si.regshifts=<shift1>,<shift2>,...
ipmi_si.slave_addrs=<addr1>,<addr2>,...
ipmi_si.force_kipmid=<enable1>,<enable2>,...

It works the same as the module parameters of the same names.

Expand Down
21 changes: 19 additions & 2 deletions drivers/char/ipmi/ipmi_si_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ struct smi_info
struct list_head link;
};

#define SI_MAX_PARMS 4

static int force_kipmid[SI_MAX_PARMS];
static int num_force_kipmid;

static int try_smi_init(struct smi_info *smi);

static ATOMIC_NOTIFIER_HEAD(xaction_notifier_list);
Expand Down Expand Up @@ -908,6 +913,7 @@ static int smi_start_processing(void *send_info,
ipmi_smi_t intf)
{
struct smi_info *new_smi = send_info;
int enable = 0;

new_smi->intf = intf;

Expand All @@ -916,11 +922,19 @@ static int smi_start_processing(void *send_info,
new_smi->last_timeout_jiffies = jiffies;
mod_timer(&new_smi->si_timer, jiffies + SI_TIMEOUT_JIFFIES);

/*
* Check if the user forcefully enabled the daemon.
*/
if (new_smi->intf_num < num_force_kipmid)
enable = force_kipmid[new_smi->intf_num];
/*
* The BT interface is efficient enough to not need a thread,
* and there is no need for a thread if we have interrupts.
*/
if ((new_smi->si_type != SI_BT) && (!new_smi->irq)) {
else if ((new_smi->si_type != SI_BT) && (!new_smi->irq))
enable = 1;

if (enable) {
new_smi->thread = kthread_run(ipmi_thread, new_smi,
"kipmi%d", new_smi->intf_num);
if (IS_ERR(new_smi->thread)) {
Expand Down Expand Up @@ -948,7 +962,6 @@ static struct ipmi_smi_handlers handlers =
/* There can be 4 IO ports passed in (with or without IRQs), 4 addresses,
a default IO port, and 1 ACPI/SPMI address. That sets SI_MAX_DRIVERS */

#define SI_MAX_PARMS 4
static LIST_HEAD(smi_infos);
static DEFINE_MUTEX(smi_infos_lock);
static int smi_num; /* Used to sequence the SMIs */
Expand Down Expand Up @@ -1021,6 +1034,10 @@ MODULE_PARM_DESC(slave_addrs, "Set the default IPMB slave address for"
" the controller. Normally this is 0x20, but can be"
" overridden by this parm. This is an array indexed"
" by interface number.");
module_param_array(force_kipmid, int, &num_force_kipmid, 0);
MODULE_PARM_DESC(force_kipmid, "Force the kipmi daemon to be enabled (1) or"
" disabled(0). Normally the IPMI driver auto-detects"
" this, but the value may be overridden by this parm.");


#define IPMI_IO_ADDR_SPACE 0
Expand Down

0 comments on commit a51f4a8

Please sign in to comment.