Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78d51aee authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'for-linus-4.8' of git://git.code.sf.net/p/openipmi/linux-ipmi

Pull IPMI updates from Corey Minyard:
 "Remove some old cruft that was disabled by default a long time ago.

  No modern hardware should need this, and anybody who really doesn't
  have something to automatically detect IPMI can add the device by hand
  on the module commandline or hot add it"

* tag 'for-linus-4.8' of git://git.code.sf.net/p/openipmi/linux-ipmi:
  ipmi: remove trydefaults parameter and default init
parents c79a14de b07b58a3
Loading
Loading
Loading
Loading
+0 −12
Original line number Original line Diff line number Diff line
@@ -50,18 +50,6 @@ config IPMI_SI
	 Currently, only KCS and SMIC are supported.  If
	 Currently, only KCS and SMIC are supported.  If
	 you are using IPMI, you should probably say "y" here.
	 you are using IPMI, you should probably say "y" here.


config IPMI_SI_PROBE_DEFAULTS
       bool 'Probe for all possible IPMI system interfaces by default'
       default n
       depends on IPMI_SI
       help
	 Modern systems will usually expose IPMI interfaces via a discoverable
	 firmware mechanism such as ACPI or DMI. Older systems do not, and so
	 the driver is forced to probe hardware manually. This may cause boot
	 delays. Say "n" here to disable this manual probing. IPMI will then
	 only be available on older systems if the "ipmi_si_intf.trydefaults=1"
	 boot argument is passed.

config IPMI_SSIF
config IPMI_SSIF
       tristate 'IPMI SMBus handler (SSIF)'
       tristate 'IPMI SMBus handler (SSIF)'
       select I2C
       select I2C
+2 −2
Original line number Original line Diff line number Diff line
@@ -474,12 +474,12 @@ static DEFINE_MUTEX(smi_watchers_mutex);


static const char * const addr_src_to_str[] = {
static const char * const addr_src_to_str[] = {
	"invalid", "hotmod", "hardcoded", "SPMI", "ACPI", "SMBIOS", "PCI",
	"invalid", "hotmod", "hardcoded", "SPMI", "ACPI", "SMBIOS", "PCI",
	"device-tree", "default"
	"device-tree"
};
};


const char *ipmi_addr_src_to_str(enum ipmi_addr_src src)
const char *ipmi_addr_src_to_str(enum ipmi_addr_src src)
{
{
	if (src > SI_DEFAULT)
	if (src >= SI_LAST)
		src = 0; /* Invalid */
		src = 0; /* Invalid */
	return addr_src_to_str[src];
	return addr_src_to_str[src];
}
}
+0 −73
Original line number Original line Diff line number Diff line
@@ -1322,7 +1322,6 @@ static bool si_tryplatform = true;
#ifdef CONFIG_PCI
#ifdef CONFIG_PCI
static bool          si_trypci = true;
static bool          si_trypci = true;
#endif
#endif
static bool          si_trydefaults = IS_ENABLED(CONFIG_IPMI_SI_PROBE_DEFAULTS);
static char          *si_type[SI_MAX_PARMS];
static char          *si_type[SI_MAX_PARMS];
#define MAX_SI_TYPE_STR 30
#define MAX_SI_TYPE_STR 30
static char          si_type_str[MAX_SI_TYPE_STR];
static char          si_type_str[MAX_SI_TYPE_STR];
@@ -1371,10 +1370,6 @@ module_param_named(trypci, si_trypci, bool, 0);
MODULE_PARM_DESC(trypci, "Setting this to zero will disable the"
MODULE_PARM_DESC(trypci, "Setting this to zero will disable the"
		 " default scan of the interfaces identified via pci");
		 " default scan of the interfaces identified via pci");
#endif
#endif
module_param_named(trydefaults, si_trydefaults, bool, 0);
MODULE_PARM_DESC(trydefaults, "Setting this to 'false' will disable the"
		 " default scan of the KCS and SMIC interface at the standard"
		 " address");
module_param_string(type, si_type_str, MAX_SI_TYPE_STR, 0);
module_param_string(type, si_type_str, MAX_SI_TYPE_STR, 0);
MODULE_PARM_DESC(type, "Defines the type of each interface, each"
MODULE_PARM_DESC(type, "Defines the type of each interface, each"
		 " interface separated by commas.  The types are 'kcs',"
		 " 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)
		del_timer_sync(&smi_info->si_timer);
		del_timer_sync(&smi_info->si_timer);
}
}


static const struct ipmi_default_vals
{
	const int type;
	const int port;
} ipmi_defaults[] =
{
	{ .type = SI_KCS, .port = 0xca2 },
	{ .type = SI_SMIC, .port = 0xca9 },
	{ .type = SI_BT, .port = 0xe4 },
	{ .port = 0 }
};

static void default_find_bmc(void)
{
	struct smi_info *info;
	int             i;

	for (i = 0; ; i++) {
		if (!ipmi_defaults[i].port)
			break;
#ifdef CONFIG_PPC
		if (check_legacy_ioport(ipmi_defaults[i].port))
			continue;
#endif
		info = smi_info_alloc();
		if (!info)
			return;

		info->addr_source = SI_DEFAULT;

		info->si_type = ipmi_defaults[i].type;
		info->io_setup = port_setup;
		info->io.addr_data = ipmi_defaults[i].port;
		info->io.addr_type = IPMI_IO_ADDR_SPACE;

		info->io.addr = NULL;
		info->io.regspacing = DEFAULT_REGSPACING;
		info->io.regsize = DEFAULT_REGSPACING;
		info->io.regshift = 0;

		if (add_smi(info) == 0) {
			if ((try_smi_init(info)) == 0) {
				/* Found one... */
				printk(KERN_INFO PFX "Found default %s"
				" state machine at %s address 0x%lx\n",
				si_to_str[info->si_type],
				addr_space_to_str[info->io.addr_type],
				info->io.addr_data);
			} else
				cleanup_one_si(info);
		} else {
			kfree(info);
		}
	}
}

static int is_new_interface(struct smi_info *info)
static int is_new_interface(struct smi_info *info)
{
{
	struct smi_info *e;
	struct smi_info *e;
@@ -3844,8 +3783,6 @@ static int init_ipmi_si(void)
#ifdef CONFIG_PARISC
#ifdef CONFIG_PARISC
	register_parisc_driver(&ipmi_parisc_driver);
	register_parisc_driver(&ipmi_parisc_driver);
	parisc_registered = true;
	parisc_registered = true;
	/* poking PC IO addresses will crash machine, don't do it */
	si_trydefaults = 0;
#endif
#endif


	/* We prefer devices with interrupts, but in the case of a machine
	/* We prefer devices with interrupts, but in the case of a machine
@@ -3885,16 +3822,6 @@ static int init_ipmi_si(void)
	if (type)
	if (type)
		return 0;
		return 0;


	if (si_trydefaults) {
		mutex_lock(&smi_infos_lock);
		if (list_empty(&smi_infos)) {
			/* No BMC was found, try defaults. */
			mutex_unlock(&smi_infos_lock);
			default_find_bmc();
		} else
			mutex_unlock(&smi_infos_lock);
	}

	mutex_lock(&smi_infos_lock);
	mutex_lock(&smi_infos_lock);
	if (unload_when_empty && list_empty(&smi_infos)) {
	if (unload_when_empty && list_empty(&smi_infos)) {
		mutex_unlock(&smi_infos_lock);
		mutex_unlock(&smi_infos_lock);
+1 −1
Original line number Original line Diff line number Diff line
@@ -277,7 +277,7 @@ int ipmi_validate_addr(struct ipmi_addr *addr, int len);
 */
 */
enum ipmi_addr_src {
enum ipmi_addr_src {
	SI_INVALID = 0, SI_HOTMOD, SI_HARDCODED, SI_SPMI, SI_ACPI, SI_SMBIOS,
	SI_INVALID = 0, SI_HOTMOD, SI_HARDCODED, SI_SPMI, SI_ACPI, SI_SMBIOS,
	SI_PCI,	SI_DEVICETREE, SI_DEFAULT
	SI_PCI,	SI_DEVICETREE, SI_LAST
};
};
const char *ipmi_addr_src_to_str(enum ipmi_addr_src src);
const char *ipmi_addr_src_to_str(enum ipmi_addr_src src);