aboutsummaryrefslogtreecommitdiff
path: root/drivers/char/ipmi
diff options
context:
space:
mode:
authorCorey Minyard <minyard@acm.org>2006-10-03 01:13:59 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 08:03:42 -0700
commita51f4a81e737735668206ad1618ce4a84cf362e7 (patch)
tree950fa344fb7c309d63fa2d1e92c024cbea46d603 /drivers/char/ipmi
parent2537d36cf568291baacff91fe5ead6ad3949304e (diff)
[PATCH] IPMI: allow user to override the kernel IPMI daemon enable
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>
Diffstat (limited to 'drivers/char/ipmi')
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index ad9ea06caee..b106c45abfc 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -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);
@@ -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;
@@ -917,10 +923,18 @@ static int smi_start_processing(void *send_info,
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)) {
@@ -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 */
@@ -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