public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Corey Minyard <cminyard@mvista.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	OpenIPMI Developers <openipmi-developer@lists.sourceforge.net>
Subject: Re: [PATCH 3/6] ipmi: use a tasklet for handling received messages
Date: Fri, 3 Feb 2012 11:44:14 -0800	[thread overview]
Message-ID: <20120203114414.0f9ae99a.akpm@linux-foundation.org> (raw)
In-Reply-To: <1328284079-5489-3-git-send-email-cminyard@mvista.com>

On Fri, 03 Feb 2012 09:47:56 -0600
Corey Minyard <cminyard@mvista.com> wrote:

> The IPMI driver would release a lock, deliver a message, then relock.
> This is obviously ugly, and this patch converts the message handler
> interface to use a tasklet to schedule work.  This lets the receive
> handler be called from an interrupt handler with interrupts enabled.
> 
> ...
>
> +/*
> + * If there are messages in the queue or pretimeouts, handle them.
> + */
> +static void handle_new_recv_msgs(ipmi_smi_t intf)
> +{
> +	struct ipmi_smi_msg  *smi_msg;
> +	unsigned long        flags = 0;
> +	int                  rv;
> +	int                  run_to_completion = intf->run_to_completion;
> +
> +	/* See if any waiting messages need to be processed. */
> +	if (!run_to_completion)
> +		spin_lock_irqsave(&intf->waiting_msgs_lock, flags);
> +	while (!list_empty(&intf->waiting_msgs)) {
> +		smi_msg = list_entry(intf->waiting_msgs.next,
> +				     struct ipmi_smi_msg, link);
> +		list_del(&smi_msg->link);
> +		if (!run_to_completion)
> +			spin_unlock_irqrestore(&intf->waiting_msgs_lock, flags);

Yikes, what's going on here?  How is the list protected if the spinlock
isn't taken?

I went to the comment over ipmi_smi.run_to_completion but it doesn't
explain how it governs the locking strategy at all.  If there's some
other way in which the reader is supposed to grok IPMI locking, please
clue me in ;)

>
> ...
>

  reply	other threads:[~2012-02-03 19:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03 15:47 [PATCH 1/6] ipmi: decreases the IPMI message transaction time in interrupt mode Corey Minyard
2012-02-03 15:47 ` [PATCH 2/6] ipmi: Increase KCS timeouts Corey Minyard
2012-02-03 19:50   ` Andrew Morton
2012-02-03 15:47 ` [PATCH 3/6] ipmi: use a tasklet for handling received messages Corey Minyard
2012-02-03 19:44   ` Andrew Morton [this message]
2012-02-03 20:01     ` Corey Minyard
2012-02-03 15:47 ` [PATCH 4/6] ipmi: Fix message handling during panics Corey Minyard
2012-02-03 15:47 ` [PATCH 5/6] ipmi: Simplify locking Corey Minyard
2012-02-03 15:47 ` [PATCH 6/6] ipmi: Use locks on watchdog timeout set on reboot Corey Minyard

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=20120203114414.0f9ae99a.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cminyard@mvista.com \
    --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