From: Corey Minyard <corey@minyard.net>
To: Matt Fleming <matt@readmodwrite.com>
Cc: Matt Fleming <mfleming@cloudflare.com>,
openipmi-developer@lists.sourceforge.net,
Tony Camuso <tcamuso@redhat.com>,
linux-kernel@vger.kernel.org, kernel-team@cloudflare.com,
stable@vger.kernel.org
Subject: Re: [PATCH 2/2] ipmi: Add limits to event and receive message requests
Date: Sat, 25 Apr 2026 18:58:48 -0500 [thread overview]
Message-ID: <ae1VOEhdR0H0rf0a@mail.minyard.net> (raw)
In-Reply-To: <aeyJ0fClAWI2lBwL@matt-Precision-5490>
On Sat, Apr 25, 2026 at 10:36:05AM +0100, Matt Fleming wrote:
> On Tue, Apr 21, 2026 at 07:42:44AM -0500, Corey Minyard wrote:
> > The driver would just fetch events and receive messages until the
> > BMC said it was done. To avoid issues with BMCs that never say they are
> > done, add a limit of 10 fetches at a time.
> >
> > This is a more general fix than the previous fix for the specific bad
> > BMC, but should fix the more general issue of a BMC that won't stop
> > saying it has data.
> >
> > This has been there from the beginning of the driver.
> >
> > Reported-by: Matt Fleming <mfleming@cloudflare.com>
> > Closes: https://lore.kernel.org/lkml/20260415115930.3428942-1-matt@readmodwrite.com/
> > Fixes: <1da177e4c3f4> ("Linux-2.6.12-rc2")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Corey Minyard <corey@minyard.net>
> > ---
> > drivers/char/ipmi/ipmi_si_intf.c | 15 +++++++++++++++
> > drivers/char/ipmi/ipmi_ssif.c | 15 +++++++++++++++
> > 2 files changed, 30 insertions(+)
>
> [...]
>
> > @@ -410,6 +413,7 @@ static void start_getting_msg_queue(struct smi_info *smi_info)
> >
> > start_new_msg(smi_info, smi_info->curr_msg->data,
> > smi_info->curr_msg->data_size);
> > + smi_info->num_requests_in_a_row = 0;
> > smi_info->si_state = SI_GETTING_MESSAGES;
> > }
> >
> > @@ -421,6 +425,7 @@ static void start_getting_events(struct smi_info *smi_info)
> >
> > start_new_msg(smi_info, smi_info->curr_msg->data,
> > smi_info->curr_msg->data_size);
> > + smi_info->num_requests_in_a_row = 0;
> > smi_info->si_state = SI_GETTING_EVENTS;
> > }
> >
>
> Would it be better to move this zeroing to handle_transaction_done()?
> Otherwise we reset the counter in handle_flags() ->
> start_getting_events() and the threshold is never reached.
Oh, yeah.
Moving it to handle_transaction_done() is not ideal, though. If
something was spewing receive messages, it would never get to events,
which is why I did it like I did.
The following should fix this. You could also have different limits for
receive messages and events, but I think the following is more clear.
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 2a739123270c..e46f4150ceb5 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -413,8 +413,10 @@ static void start_getting_msg_queue(struct smi_info *smi_info)
start_new_msg(smi_info, smi_info->curr_msg->data,
smi_info->curr_msg->data_size);
- smi_info->num_requests_in_a_row = 0;
- smi_info->si_state = SI_GETTING_MESSAGES;
+ if (smi_info->si_state != SI_GETTING_MESSAGES) {
+ smi_info->num_requests_in_a_row = 0;
+ smi_info->si_state = SI_GETTING_MESSAGES;
+ }
}
static void start_getting_events(struct smi_info *smi_info)
@@ -425,8 +427,10 @@ static void start_getting_events(struct smi_info *smi_info)
start_new_msg(smi_info, smi_info->curr_msg->data,
smi_info->curr_msg->data_size);
- smi_info->num_requests_in_a_row = 0;
- smi_info->si_state = SI_GETTING_EVENTS;
+ if (smi_info->si_state != SI_GETTING_EVENTS) {
+ smi_info->num_requests_in_a_row = 0;
+ smi_info->si_state = SI_GETTING_EVENTS;
+ }
}
/*
>
> Thanks,
> Matt
prev parent reply other threads:[~2026-04-25 23:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260421132544.2666174-1-corey@minyard.net>
2026-04-21 12:42 ` [PATCH 1/2] ipmi: Check event message buffer response for bad data Corey Minyard
2026-04-21 12:42 ` [PATCH 2/2] ipmi: Add limits to event and receive message requests Corey Minyard
2026-04-25 9:36 ` Matt Fleming
2026-04-25 23:58 ` Corey Minyard [this message]
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=ae1VOEhdR0H0rf0a@mail.minyard.net \
--to=corey@minyard.net \
--cc=kernel-team@cloudflare.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@readmodwrite.com \
--cc=mfleming@cloudflare.com \
--cc=openipmi-developer@lists.sourceforge.net \
--cc=stable@vger.kernel.org \
--cc=tcamuso@redhat.com \
/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