From: Michal Clapinski <mclapinski@google.com>
To: Corey Minyard <corey@minyard.net>,
openipmi-developer@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, Michal Clapinski <mclapinski@google.com>
Subject: [PATCH] ipmi:si: Add async init to ipmi_si
Date: Thu, 25 Jun 2026 17:59:54 +0200 [thread overview]
Message-ID: <20260625155954.1948908-1-mclapinski@google.com> (raw)
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
next reply other threads:[~2026-06-25 16:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 15:59 Michal Clapinski [this message]
2026-06-26 4:35 ` [PATCH] ipmi:si: Add async init to ipmi_si Corey Minyard
2026-06-26 22:38 ` Michał Cłapiński
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260625155954.1948908-1-mclapinski@google.com \
--to=mclapinski@google.com \
--cc=corey@minyard.net \
--cc=linux-kernel@vger.kernel.org \
--cc=openipmi-developer@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox