From: Corey Minyard <corey@minyard.net>
To: Michal Clapinski <mclapinski@google.com>
Cc: openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ipmi:si: Add async init to ipmi_si
Date: Thu, 25 Jun 2026 23:35:14 -0500 [thread overview]
Message-ID: <aj4BguM85rpvcTM6@mail.minyard.net> (raw)
In-Reply-To: <20260625155954.1948908-1-mclapinski@google.com>
On Thu, Jun 25, 2026 at 05:59:54PM +0200, Michal Clapinski wrote:
> Added a new config option to allow offloading slow part of
> init_ipmi_si. Saves 100ms on my system.
Are you loading as a module or building IPMI into the kernel?
I'm thinking this is a good idea, but not quite done this way.
I have another long-standing issue that if a BMC is not operational when
the system comes up, it will not continue to try to bring it up, so
you have to reboot or hotmod the device in when it becomes available.
I'm thinking that instead of pushing off the whole process, push off
just the individual calls to try_smi_init(). I'm assuming that's where
all the time is spent at init.
So with that it would be possible to periodically retry a BMC until
it eventually comes up.
Plus, that way the "unload_when_empty" function won't be broken with
this feature.
I am also not quite sure what will happen if you try to unload the
module if things are pushed off in a startup state like this.
I'm also not quite sure how this will affect the ACPI IPMI functions in
the kernel. I would guess it's ok, since it registers to know when the
interface becomes available, but it might be delayed a bit which might
confuse things. Also, it might delay the driver being available til
later at startup, which may confuse userland users.
I'm also wondering if making this an option makes sense, or if this
should be the way it always works. An option might be nice if it broke
things, I guess. But almost everyone uses modules, and that will be
delayed from boot, anyway. I guess that means ACPI is not an issue,
either.
Just kind of pondering this right now.
-corey
>
> 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 prev parent reply other threads:[~2026-06-26 4:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 15:59 [PATCH] ipmi:si: Add async init to ipmi_si Michal Clapinski
2026-06-26 4:35 ` Corey Minyard [this message]
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=aj4BguM85rpvcTM6@mail.minyard.net \
--to=corey@minyard.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mclapinski@google.com \
--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 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.