Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198794
b: refs/heads/master
c: 06ee459
h: refs/heads/master
v: v3
  • Loading branch information
Matthew Garrett authored and Linus Torvalds committed May 27, 2010
1 parent b8b6fd4 commit 6cd7af3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3326f4f2276791561af1fd5f2020be0186459813
refs/heads/master: 06ee459402434aabed0c6d03c4cc10bfe4a3a65b
28 changes: 21 additions & 7 deletions trunk/drivers/char/ipmi/ipmi_si_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3278,6 +3278,7 @@ static __devinit int init_ipmi_si(void)
char *str;
int rv;
struct smi_info *e;
enum ipmi_addr_src type = SI_INVALID;

if (initialized)
return 0;
Expand Down Expand Up @@ -3344,30 +3345,43 @@ static __devinit int init_ipmi_si(void)
of_register_platform_driver(&ipmi_of_platform_driver);
#endif

/* Try to register something with interrupts first */
/* We prefer devices with interrupts, but in the case of a machine
with multiple BMCs we assume that there will be several instances
of a given type so if we succeed in registering a type then also
try to register everything else of the same type */

mutex_lock(&smi_infos_lock);
list_for_each_entry(e, &smi_infos, link) {
if (e->irq) {
/* Try to register a device if it has an IRQ and we either
haven't successfully registered a device yet or this
device has the same type as one we successfully registered */
if (e->irq && (!type || e->addr_source == type)) {
if (!try_smi_init(e)) {
mutex_unlock(&smi_infos_lock);
return 0;
type = e->addr_source;
}
}
}

/* type will only have been set if we successfully registered an si */
if (type) {
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 (!e->irq && (!type || e->addr_source == type)) {
if (!try_smi_init(e)) {
mutex_unlock(&smi_infos_lock);
return 0;
type = e->addr_source;
}
}
}
mutex_unlock(&smi_infos_lock);

if (type)
return 0;

if (si_trydefaults) {
mutex_lock(&smi_infos_lock);
if (list_empty(&smi_infos)) {
Expand Down

0 comments on commit 6cd7af3

Please sign in to comment.