public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: Asmaa Mnebhi <asmaa@nvidia.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: ipmi_msghandler.c question
Date: Fri, 8 Jan 2021 20:28:15 -0600	[thread overview]
Message-ID: <20210109022815.GA3324@minyard.net> (raw)
In-Reply-To: <CH2PR12MB38958D50FDBA94E2127CA993D7AE0@CH2PR12MB3895.namprd12.prod.outlook.com>

On Fri, Jan 08, 2021 at 11:37:04PM +0000, Asmaa Mnebhi wrote:
> Hi Corey,
> 
> I have a question for you related to the following function in ipmi_msghandler.c
> 
> static void __get_guid(struct ipmi_smi *intf)
> {
> 	int rv;
> 	struct bmc_device *bmc = intf->bmc;
> 
> 	bmc->dyn_guid_set = 2;
> 	intf->null_user_handler = guid_handler;
> 	rv = send_guid_cmd(intf, 0);
> 	if (rv)
> 		/* Send failed, no GUID available. */
> 		bmc->dyn_guid_set = 0;
> 	else
> 		wait_event(intf->waitq, bmc->dyn_guid_set != 2);
> 
> 	/* dyn_guid_set makes the guid data available. */
> 	smp_rmb();
> 
> 	intf->null_user_handler = NULL;
> }
> 
> Why is wait_event used as opposed to wait_event_timeout? In the context where the dyn_guid_set value doesn't change from 2, this would run forever. Wouldn't we want to timeout after a certain amount of time?
> 

The low-level IPMI driver is guarateed to return a response to a
message, though if something goes wrong with the BMC it can take a few
seconds to return the failure message.  So it shouldn't be an issue.

-corey

> Thanks.
> Asmaa

      reply	other threads:[~2021-01-09  2:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 23:37 ipmi_msghandler.c question Asmaa Mnebhi
2021-01-09  2:28 ` 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=20210109022815.GA3324@minyard.net \
    --to=minyard@acm.org \
    --cc=asmaa@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    /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