diff options
author | Corey Minyard <minyard@acm.org> | 2006-10-03 04:13:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-03 11:03:42 -0400 |
commit | a51f4a81e737735668206ad1618ce4a84cf362e7 (patch) | |
tree | 950fa344fb7c309d63fa2d1e92c024cbea46d603 | |
parent | 2537d36cf568291baacff91fe5ead6ad3949304e (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>
-rw-r--r-- | Documentation/IPMI.txt | 10 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 21 |
2 files changed, 28 insertions, 3 deletions
diff --git a/Documentation/IPMI.txt b/Documentation/IPMI.txt index 7756e09ea759..9f08d73d90bf 100644 --- a/Documentation/IPMI.txt +++ b/Documentation/IPMI.txt | |||
@@ -364,6 +364,7 @@ You can change this at module load time (for a module) with: | |||
364 | regspacings=<sp1>,<sp2>,... regsizes=<size1>,<size2>,... | 364 | regspacings=<sp1>,<sp2>,... regsizes=<size1>,<size2>,... |
365 | regshifts=<shift1>,<shift2>,... | 365 | regshifts=<shift1>,<shift2>,... |
366 | slave_addrs=<addr1>,<addr2>,... | 366 | slave_addrs=<addr1>,<addr2>,... |
367 | force_kipmid=<enable1>,<enable2>,... | ||
367 | 368 | ||
368 | Each of these except si_trydefaults is a list, the first item for the | 369 | Each of these except si_trydefaults is a list, the first item for the |
369 | first interface, second item for the second interface, etc. | 370 | first interface, second item for the second interface, etc. |
@@ -409,7 +410,13 @@ The slave_addrs specifies the IPMI address of the local BMC. This is | |||
409 | usually 0x20 and the driver defaults to that, but in case it's not, it | 410 | usually 0x20 and the driver defaults to that, but in case it's not, it |
410 | can be specified when the driver starts up. | 411 | can be specified when the driver starts up. |
411 | 412 | ||
412 | When compiled into the kernel, the addresses can be specified on the | 413 | The force_ipmid parameter forcefully enables (if set to 1) or disables |
414 | (if set to 0) the kernel IPMI daemon. Normally this is auto-detected | ||
415 | by the driver, but systems with broken interrupts might need an enable, | ||
416 | or users that don't want the daemon (don't need the performance, don't | ||
417 | want the CPU hit) can disable it. | ||
418 | |||
419 | When compiled into the kernel, the parameters can be specified on the | ||
413 | kernel command line as: | 420 | kernel command line as: |
414 | 421 | ||
415 | ipmi_si.type=<type1>,<type2>... | 422 | ipmi_si.type=<type1>,<type2>... |
@@ -419,6 +426,7 @@ kernel command line as: | |||
419 | ipmi_si.regsizes=<size1>,<size2>,... | 426 | ipmi_si.regsizes=<size1>,<size2>,... |
420 | ipmi_si.regshifts=<shift1>,<shift2>,... | 427 | ipmi_si.regshifts=<shift1>,<shift2>,... |
421 | ipmi_si.slave_addrs=<addr1>,<addr2>,... | 428 | ipmi_si.slave_addrs=<addr1>,<addr2>,... |
429 | ipmi_si.force_kipmid=<enable1>,<enable2>,... | ||
422 | 430 | ||
423 | It works the same as the module parameters of the same names. | 431 | It works the same as the module parameters of the same names. |
424 | 432 | ||
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index ad9ea06caee0..b106c45abfc9 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -217,6 +217,11 @@ struct smi_info | |||
217 | struct list_head link; | 217 | struct list_head link; |
218 | }; | 218 | }; |
219 | 219 | ||
220 | #define SI_MAX_PARMS 4 | ||
221 | |||
222 | static int force_kipmid[SI_MAX_PARMS]; | ||
223 | static int num_force_kipmid; | ||
224 | |||
220 | static int try_smi_init(struct smi_info *smi); | 225 | static int try_smi_init(struct smi_info *smi); |
221 | 226 | ||
222 | static ATOMIC_NOTIFIER_HEAD(xaction_notifier_list); | 227 | static ATOMIC_NOTIFIER_HEAD(xaction_notifier_list); |
@@ -908,6 +913,7 @@ static int smi_start_processing(void *send_info, | |||
908 | ipmi_smi_t intf) | 913 | ipmi_smi_t intf) |
909 | { | 914 | { |
910 | struct smi_info *new_smi = send_info; | 915 | struct smi_info *new_smi = send_info; |
916 | int enable = 0; | ||
911 | 917 | ||
912 | new_smi->intf = intf; | 918 | new_smi->intf = intf; |
913 | 919 | ||
@@ -917,10 +923,18 @@ static int smi_start_processing(void *send_info, | |||
917 | mod_timer(&new_smi->si_timer, jiffies + SI_TIMEOUT_JIFFIES); | 923 | mod_timer(&new_smi->si_timer, jiffies + SI_TIMEOUT_JIFFIES); |
918 | 924 | ||
919 | /* | 925 | /* |
926 | * Check if the user forcefully enabled the daemon. | ||
927 | */ | ||
928 | if (new_smi->intf_num < num_force_kipmid) | ||
929 | enable = force_kipmid[new_smi->intf_num]; | ||
930 | /* | ||
920 | * The BT interface is efficient enough to not need a thread, | 931 | * The BT interface is efficient enough to not need a thread, |
921 | * and there is no need for a thread if we have interrupts. | 932 | * and there is no need for a thread if we have interrupts. |
922 | */ | 933 | */ |
923 | if ((new_smi->si_type != SI_BT) && (!new_smi->irq)) { | 934 | else if ((new_smi->si_type != SI_BT) && (!new_smi->irq)) |
935 | enable = 1; | ||
936 | |||
937 | if (enable) { | ||
924 | new_smi->thread = kthread_run(ipmi_thread, new_smi, | 938 | new_smi->thread = kthread_run(ipmi_thread, new_smi, |
925 | "kipmi%d", new_smi->intf_num); | 939 | "kipmi%d", new_smi->intf_num); |
926 | if (IS_ERR(new_smi->thread)) { | 940 | if (IS_ERR(new_smi->thread)) { |
@@ -948,7 +962,6 @@ static struct ipmi_smi_handlers handlers = | |||
948 | /* There can be 4 IO ports passed in (with or without IRQs), 4 addresses, | 962 | /* There can be 4 IO ports passed in (with or without IRQs), 4 addresses, |
949 | a default IO port, and 1 ACPI/SPMI address. That sets SI_MAX_DRIVERS */ | 963 | a default IO port, and 1 ACPI/SPMI address. That sets SI_MAX_DRIVERS */ |
950 | 964 | ||
951 | #define SI_MAX_PARMS 4 | ||
952 | static LIST_HEAD(smi_infos); | 965 | static LIST_HEAD(smi_infos); |
953 | static DEFINE_MUTEX(smi_infos_lock); | 966 | static DEFINE_MUTEX(smi_infos_lock); |
954 | static int smi_num; /* Used to sequence the SMIs */ | 967 | 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" | |||
1021 | " the controller. Normally this is 0x20, but can be" | 1034 | " the controller. Normally this is 0x20, but can be" |
1022 | " overridden by this parm. This is an array indexed" | 1035 | " overridden by this parm. This is an array indexed" |
1023 | " by interface number."); | 1036 | " by interface number."); |
1037 | module_param_array(force_kipmid, int, &num_force_kipmid, 0); | ||
1038 | MODULE_PARM_DESC(force_kipmid, "Force the kipmi daemon to be enabled (1) or" | ||
1039 | " disabled(0). Normally the IPMI driver auto-detects" | ||
1040 | " this, but the value may be overridden by this parm."); | ||
1024 | 1041 | ||
1025 | 1042 | ||
1026 | #define IPMI_IO_ADDR_SPACE 0 | 1043 | #define IPMI_IO_ADDR_SPACE 0 |