aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Camuso <tcamuso@redhat.com>2016-06-22 14:22:28 -0400
committerCorey Minyard <cminyard@mvista.com>2016-07-27 11:24:38 -0400
commitb07b58a3e435a3d18004815e8364ec26c4236721 (patch)
treee81e7cc7d7470882da5a220bc86b53ad4e32f94d
parent0e06f5c0deeef0332a5da2ecb8f1fcf3e024d958 (diff)
ipmi: remove trydefaults parameter and default init
Parameter trydefaults=1 causes the ipmi_init to initialize ipmi through the legacy port io space that was designated for ipmi. Architectures that do not map legacy port io can panic when trydefaults=1. Rather than implement build-time conditional exceptions for each architecture that does not map legacy port io, we have removed legacy port io from the driver. Parameter 'trydefaults' has been removed. Attempts to use it hereafter will evoke the "Unknown symbol in module, or unknown parameter" message. The patch was built against a number of architectures and tested for regressions and functionality on x86_64 and ARM64. Signed-off-by: Tony Camuso <tcamuso@redhat.com> Removed the config entry and the address source entry for default, since neither were used any more. Signed-off-by: Corey Minyard <cminyard@mvista.com>
-rw-r--r--drivers/char/ipmi/Kconfig12
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c4
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c73
-rw-r--r--include/linux/ipmi.h2
4 files changed, 3 insertions, 88 deletions
diff --git a/drivers/char/ipmi/Kconfig b/drivers/char/ipmi/Kconfig
index 6ed9e9fe5233..5a9350b1069a 100644
--- a/drivers/char/ipmi/Kconfig
+++ b/drivers/char/ipmi/Kconfig
@@ -50,18 +50,6 @@ config IPMI_SI
50 Currently, only KCS and SMIC are supported. If 50 Currently, only KCS and SMIC are supported. If
51 you are using IPMI, you should probably say "y" here. 51 you are using IPMI, you should probably say "y" here.
52 52
53config IPMI_SI_PROBE_DEFAULTS
54 bool 'Probe for all possible IPMI system interfaces by default'
55 default n
56 depends on IPMI_SI
57 help
58 Modern systems will usually expose IPMI interfaces via a discoverable
59 firmware mechanism such as ACPI or DMI. Older systems do not, and so
60 the driver is forced to probe hardware manually. This may cause boot
61 delays. Say "n" here to disable this manual probing. IPMI will then
62 only be available on older systems if the "ipmi_si_intf.trydefaults=1"
63 boot argument is passed.
64
65config IPMI_SSIF 53config IPMI_SSIF
66 tristate 'IPMI SMBus handler (SSIF)' 54 tristate 'IPMI SMBus handler (SSIF)'
67 select I2C 55 select I2C
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index 44b1bd6baa38..d8619998cfb5 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -474,12 +474,12 @@ static DEFINE_MUTEX(smi_watchers_mutex);
474 474
475static const char * const addr_src_to_str[] = { 475static const char * const addr_src_to_str[] = {
476 "invalid", "hotmod", "hardcoded", "SPMI", "ACPI", "SMBIOS", "PCI", 476 "invalid", "hotmod", "hardcoded", "SPMI", "ACPI", "SMBIOS", "PCI",
477 "device-tree", "default" 477 "device-tree"
478}; 478};
479 479
480const char *ipmi_addr_src_to_str(enum ipmi_addr_src src) 480const char *ipmi_addr_src_to_str(enum ipmi_addr_src src)
481{ 481{
482 if (src > SI_DEFAULT) 482 if (src >= SI_LAST)
483 src = 0; /* Invalid */ 483 src = 0; /* Invalid */
484 return addr_src_to_str[src]; 484 return addr_src_to_str[src];
485} 485}
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 7b1c412b40a2..a112c0146012 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -1322,7 +1322,6 @@ static bool si_tryplatform = true;
1322#ifdef CONFIG_PCI 1322#ifdef CONFIG_PCI
1323static bool si_trypci = true; 1323static bool si_trypci = true;
1324#endif 1324#endif
1325static bool si_trydefaults = IS_ENABLED(CONFIG_IPMI_SI_PROBE_DEFAULTS);
1326static char *si_type[SI_MAX_PARMS]; 1325static char *si_type[SI_MAX_PARMS];
1327#define MAX_SI_TYPE_STR 30 1326#define MAX_SI_TYPE_STR 30
1328static char si_type_str[MAX_SI_TYPE_STR]; 1327static char si_type_str[MAX_SI_TYPE_STR];
@@ -1371,10 +1370,6 @@ module_param_named(trypci, si_trypci, bool, 0);
1371MODULE_PARM_DESC(trypci, "Setting this to zero will disable the" 1370MODULE_PARM_DESC(trypci, "Setting this to zero will disable the"
1372 " default scan of the interfaces identified via pci"); 1371 " default scan of the interfaces identified via pci");
1373#endif 1372#endif
1374module_param_named(trydefaults, si_trydefaults, bool, 0);
1375MODULE_PARM_DESC(trydefaults, "Setting this to 'false' will disable the"
1376 " default scan of the KCS and SMIC interface at the standard"
1377 " address");
1378module_param_string(type, si_type_str, MAX_SI_TYPE_STR, 0); 1373module_param_string(type, si_type_str, MAX_SI_TYPE_STR, 0);
1379MODULE_PARM_DESC(type, "Defines the type of each interface, each" 1374MODULE_PARM_DESC(type, "Defines the type of each interface, each"
1380 " interface separated by commas. The types are 'kcs'," 1375 " interface separated by commas. The types are 'kcs',"
@@ -3461,62 +3456,6 @@ static inline void wait_for_timer_and_thread(struct smi_info *smi_info)
3461 del_timer_sync(&smi_info->si_timer); 3456 del_timer_sync(&smi_info->si_timer);
3462} 3457}
3463 3458
3464static const struct ipmi_default_vals
3465{
3466 const int type;
3467 const int port;
3468} ipmi_defaults[] =
3469{
3470 { .type = SI_KCS, .port = 0xca2 },
3471 { .type = SI_SMIC, .port = 0xca9 },
3472 { .type = SI_BT, .port = 0xe4 },
3473 { .port = 0 }
3474};
3475
3476static void default_find_bmc(void)
3477{
3478 struct smi_info *info;
3479 int i;
3480
3481 for (i = 0; ; i++) {
3482 if (!ipmi_defaults[i].port)
3483 break;
3484#ifdef CONFIG_PPC
3485 if (check_legacy_ioport(ipmi_defaults[i].port))
3486 continue;
3487#endif
3488 info = smi_info_alloc();
3489 if (!info)
3490 return;
3491
3492 info->addr_source = SI_DEFAULT;
3493
3494 info->si_type = ipmi_defaults[i].type;
3495 info->io_setup = port_setup;
3496 info->io.addr_data = ipmi_defaults[i].port;
3497 info->io.addr_type = IPMI_IO_ADDR_SPACE;
3498
3499 info->io.addr = NULL;
3500 info->io.regspacing = DEFAULT_REGSPACING;
3501 info->io.regsize = DEFAULT_REGSPACING;
3502 info->io.regshift = 0;
3503
3504 if (add_smi(info) == 0) {
3505 if ((try_smi_init(info)) == 0) {
3506 /* Found one... */
3507 printk(KERN_INFO PFX "Found default %s"
3508 " state machine at %s address 0x%lx\n",
3509 si_to_str[info->si_type],
3510 addr_space_to_str[info->io.addr_type],
3511 info->io.addr_data);
3512 } else
3513 cleanup_one_si(info);
3514 } else {
3515 kfree(info);
3516 }
3517 }
3518}
3519
3520static int is_new_interface(struct smi_info *info) 3459static int is_new_interface(struct smi_info *info)
3521{ 3460{
3522 struct smi_info *e; 3461 struct smi_info *e;
@@ -3844,8 +3783,6 @@ static int init_ipmi_si(void)
3844#ifdef CONFIG_PARISC 3783#ifdef CONFIG_PARISC
3845 register_parisc_driver(&ipmi_parisc_driver); 3784 register_parisc_driver(&ipmi_parisc_driver);
3846 parisc_registered = true; 3785 parisc_registered = true;
3847 /* poking PC IO addresses will crash machine, don't do it */
3848 si_trydefaults = 0;
3849#endif 3786#endif
3850 3787
3851 /* We prefer devices with interrupts, but in the case of a machine 3788 /* We prefer devices with interrupts, but in the case of a machine
@@ -3885,16 +3822,6 @@ static int init_ipmi_si(void)
3885 if (type) 3822 if (type)
3886 return 0; 3823 return 0;
3887 3824
3888 if (si_trydefaults) {
3889 mutex_lock(&smi_infos_lock);
3890 if (list_empty(&smi_infos)) {
3891 /* No BMC was found, try defaults. */
3892 mutex_unlock(&smi_infos_lock);
3893 default_find_bmc();
3894 } else
3895 mutex_unlock(&smi_infos_lock);
3896 }
3897
3898 mutex_lock(&smi_infos_lock); 3825 mutex_lock(&smi_infos_lock);
3899 if (unload_when_empty && list_empty(&smi_infos)) { 3826 if (unload_when_empty && list_empty(&smi_infos)) {
3900 mutex_unlock(&smi_infos_lock); 3827 mutex_unlock(&smi_infos_lock);
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index 838dbfa3c331..78c5d5ae3857 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -277,7 +277,7 @@ int ipmi_validate_addr(struct ipmi_addr *addr, int len);
277 */ 277 */
278enum ipmi_addr_src { 278enum ipmi_addr_src {
279 SI_INVALID = 0, SI_HOTMOD, SI_HARDCODED, SI_SPMI, SI_ACPI, SI_SMBIOS, 279 SI_INVALID = 0, SI_HOTMOD, SI_HARDCODED, SI_SPMI, SI_ACPI, SI_SMBIOS,
280 SI_PCI, SI_DEVICETREE, SI_DEFAULT 280 SI_PCI, SI_DEVICETREE, SI_LAST
281}; 281};
282const char *ipmi_addr_src_to_str(enum ipmi_addr_src src); 282const char *ipmi_addr_src_to_str(enum ipmi_addr_src src);
283 283