mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: Tomas Henzl <thenzl@redhat.com>, "'akpm@osdl.org'" <akpm@osdl.org>
Cc: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
	mjg@redhat.com, openipmi-developer@lists.sourceforge.net
Subject: Re: [PATCH] ipm: fix mutex use
Date: Fri, 14 May 2010 12:25:35 -0500	[thread overview]
Message-ID: <4BED878F.9010905@acm.org> (raw)
In-Reply-To: <4BED80C5.7030503@redhat.com>

Yes, you are correct, we need this patch.

Acked-by: Corey Minyard <cminyard@mvista.com>

Thanks.

Tomas Henzl wrote:
> It looks like there is an unbalance with the mutexes after the latest 
> IPMI patchset applied. For example in 
> "static __devinit int init_ipmi_si(void)"
> ....
> 	list_for_each_entry(e, &smi_infos, link) {
> 		if (!e->irq && (!type || e->addr_source == type)) {
> 			if (!try_smi_init(e)) {
> 				type = e->addr_source;
> 			}
> 		}
> 	}
> 	mutex_unlock(&smi_infos_lock);
>
> we are calling mutex_unlock twice, because the mutex_unlock(&smi_infos_lock)
> is also called from try_smi_init.
>
> If the lock in try_smi_init is not needed this can be then solved
> by removing the mutex_unlock(&smi_infos_lock) from try_smi_init.
>
> Signed-off-by: Tomas Henzl <thenzl@redhat.com>
>
> ---
> diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> index 8d7b879..c6af8e0 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -3060,8 +3060,6 @@ static int try_smi_init(struct smi_info *new_smi)
>  		goto out_err_stop_timer;
>  	}
>  
> -	mutex_unlock(&smi_infos_lock);
> -
>  	printk(KERN_INFO "IPMI %s interface initialized\n",
>  	       si_to_str[new_smi->si_type]);
>  
> @@ -3111,8 +3109,6 @@ static int try_smi_init(struct smi_info *new_smi)
>  		new_smi->dev_registered = 0;
>  	}
>  
> -	mutex_unlock(&smi_infos_lock);
> -
>  	return rv;
>  }
>  
>
>
>   


      reply	other threads:[~2010-05-14 17:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-14 16:56 Tomas Henzl
2010-05-14 17:25 ` 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=4BED878F.9010905@acm.org \
    --to=minyard@acm.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=openipmi-developer@lists.sourceforge.net \
    --cc=thenzl@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

Powered by JetHome