From: Corey Minyard <minyard@acm.org>
To: Linux Kernel <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>
Cc: OpenIPMI Developers <openipmi-developer@lists.sourceforge.net>,
Matthew Garrett <mjg@redhat.com>
Subject: [PATCH 3/8] ipmi: Only register one si per bmc
Date: Mon, 03 May 2010 08:34:50 -0500 [thread overview]
Message-ID: <20100503133450.GC8130@minyard.local> (raw)
From: Matthew Garrett <mjg@redhat.com>
Only register one si per bmc. Use any user-provided devices first, followed
by the first device with an irq, followed by the first device discovered.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
Index: linux-2.6/drivers/char/ipmi/ipmi_si_intf.c
===================================================================
--- linux-2.6.orig/drivers/char/ipmi/ipmi_si_intf.c
+++ linux-2.6/drivers/char/ipmi/ipmi_si_intf.c
@@ -3300,6 +3300,14 @@ static __devinit int init_ipmi_si(void)
hardcode_find_bmc();
+ /* If the user gave us a device, they presumably want us to use it */
+ mutex_lock(&smi_infos_lock);
+ if (!list_empty(&smi_infos)) {
+ mutex_unlock(&smi_infos_lock);
+ return 0;
+ }
+ mutex_unlock(&smi_infos_lock);
+
#ifdef CONFIG_DMI
dmi_find_bmc();
#endif
@@ -3323,10 +3331,27 @@ static __devinit int init_ipmi_si(void)
of_register_platform_driver(&ipmi_of_platform_driver);
#endif
+ /* Try to register something with interrupts first */
+
mutex_lock(&smi_infos_lock);
list_for_each_entry(e, &smi_infos, link) {
- if (!e->si_sm)
- try_smi_init(e);
+ if (e->irq) {
+ if (!try_smi_init(e)) {
+ mutex_unlock(&smi_infos_lock);
+ return 0;
+ }
+ }
+ }
+
+ /* Fall back to the preferred device */
+
+ list_for_each_entry(e, &smi_infos, link) {
+ if (!e->irq) {
+ if (!try_smi_init(e)) {
+ mutex_unlock(&smi_infos_lock);
+ return 0;
+ }
+ }
}
mutex_unlock(&smi_infos_lock);
reply other threads:[~2010-05-03 13:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20100503133450.GC8130@minyard.local \
--to=minyard@acm.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox