All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipmi:si: Add async init to ipmi_si
@ 2026-06-25 15:59 Michal Clapinski
  2026-06-26  4:35 ` Corey Minyard
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Clapinski @ 2026-06-25 15:59 UTC (permalink / raw)
  To: Corey Minyard, openipmi-developer; +Cc: linux-kernel, Michal Clapinski

Added a new config option to allow offloading slow part of
init_ipmi_si. Saves 100ms on my system.

Signed-off-by: Michal Clapinski <mclapinski@google.com>
---
 drivers/char/ipmi/Kconfig        |  8 ++++++
 drivers/char/ipmi/ipmi_si_intf.c | 48 +++++++++++++++++++++-----------
 2 files changed, 40 insertions(+), 16 deletions(-)

diff --git a/drivers/char/ipmi/Kconfig b/drivers/char/ipmi/Kconfig
index 669f76000197..8419409dc3b9 100644
--- a/drivers/char/ipmi/Kconfig
+++ b/drivers/char/ipmi/Kconfig
@@ -67,6 +67,14 @@ config IPMI_SI
 	  Currently, only KCS and SMIC are supported.  If
 	  you are using IPMI, you should probably say "y" here.
 
+config IPMI_SI_ASYNC_INIT
+	bool 'Asynchronous initialization of IPMI System Interface'
+	depends on IPMI_SI
+	default n
+	help
+	  Enables asynchronous init of the IPMI System Interface.
+	  It speeds up the boot time.
+
 config IPMI_SSIF
 	tristate 'IPMI SMBus handler (SSIF)'
 	depends on I2C
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 9a9d12be9bf7..3e422c7df60a 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -39,6 +39,7 @@
 #include <linux/rcupdate.h>
 #include <linux/ipmi.h>
 #include <linux/ipmi_smi.h>
+#include <linux/async.h>
 #include "ipmi_si.h"
 #include "ipmi_si_sm.h"
 #include <linux/string.h>
@@ -2174,25 +2175,10 @@ static bool __init ipmi_smi_info_same(struct smi_info *e1, struct smi_info *e2)
 		e1->io.addr_data == e2->io.addr_data);
 }
 
-static int __init init_ipmi_si(void)
+static int __init smi_init_scan(void)
 {
 	struct smi_info *e, *e2;
 
-	if (initialized)
-		return 0;
-
-	ipmi_hardcode_init();
-
-	pr_info("IPMI System Interface driver\n");
-
-	ipmi_si_platform_init();
-
-	ipmi_si_pci_init();
-
-	ipmi_si_ls2k_init();
-
-	ipmi_si_parisc_init();
-
 	mutex_lock(&smi_infos_lock);
 
 	/*
@@ -2271,6 +2257,36 @@ static int __init init_ipmi_si(void)
 		return 0;
 	}
 }
+
+static void __init async_smi_init(void *data, async_cookie_t cookie)
+{
+	smi_init_scan();
+}
+
+static int __init init_ipmi_si(void)
+{
+	if (initialized)
+		return 0;
+
+	ipmi_hardcode_init();
+
+	pr_info("IPMI System Interface driver\n");
+
+	ipmi_si_platform_init();
+
+	ipmi_si_pci_init();
+
+	ipmi_si_ls2k_init();
+
+	ipmi_si_parisc_init();
+
+	if (IS_ENABLED(CONFIG_IPMI_SI_ASYNC_INIT)) {
+		async_schedule(async_smi_init, NULL);
+		return 0;
+	}
+
+	return smi_init_scan();
+}
 module_init(init_ipmi_si);
 
 static void wait_msg_processed(struct smi_info *smi_info)
-- 
2.55.0.rc0.799.gd6f94ed593-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-26 22:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-25 15:59 [PATCH] ipmi:si: Add async init to ipmi_si Michal Clapinski
2026-06-26  4:35 ` Corey Minyard
2026-06-26 22:38   ` Michał Cłapiński

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.