diff options
Diffstat (limited to 'drivers/char/ipmi/ipmi_msghandler.c')
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 8435fba73da..5dc1265ce1d 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -221,10 +221,8 @@ struct ipmi_smi | |||
221 | void *send_info; | 221 | void *send_info; |
222 | 222 | ||
223 | #ifdef CONFIG_PROC_FS | 223 | #ifdef CONFIG_PROC_FS |
224 | /* A list of proc entries for this interface. This does not | 224 | /* A list of proc entries for this interface. */ |
225 | need a lock, only one thread creates it and only one thread | 225 | struct mutex proc_entry_lock; |
226 | destroys it. */ | ||
227 | spinlock_t proc_entry_lock; | ||
228 | struct ipmi_proc_entry *proc_entries; | 226 | struct ipmi_proc_entry *proc_entries; |
229 | #endif | 227 | #endif |
230 | 228 | ||
@@ -1891,11 +1889,11 @@ int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name, | |||
1891 | file->write_proc = write_proc; | 1889 | file->write_proc = write_proc; |
1892 | file->owner = owner; | 1890 | file->owner = owner; |
1893 | 1891 | ||
1894 | spin_lock(&smi->proc_entry_lock); | 1892 | mutex_lock(&smi->proc_entry_lock); |
1895 | /* Stick it on the list. */ | 1893 | /* Stick it on the list. */ |
1896 | entry->next = smi->proc_entries; | 1894 | entry->next = smi->proc_entries; |
1897 | smi->proc_entries = entry; | 1895 | smi->proc_entries = entry; |
1898 | spin_unlock(&smi->proc_entry_lock); | 1896 | mutex_unlock(&smi->proc_entry_lock); |
1899 | } | 1897 | } |
1900 | #endif /* CONFIG_PROC_FS */ | 1898 | #endif /* CONFIG_PROC_FS */ |
1901 | 1899 | ||
@@ -1939,7 +1937,7 @@ static void remove_proc_entries(ipmi_smi_t smi) | |||
1939 | #ifdef CONFIG_PROC_FS | 1937 | #ifdef CONFIG_PROC_FS |
1940 | struct ipmi_proc_entry *entry; | 1938 | struct ipmi_proc_entry *entry; |
1941 | 1939 | ||
1942 | spin_lock(&smi->proc_entry_lock); | 1940 | mutex_lock(&smi->proc_entry_lock); |
1943 | while (smi->proc_entries) { | 1941 | while (smi->proc_entries) { |
1944 | entry = smi->proc_entries; | 1942 | entry = smi->proc_entries; |
1945 | smi->proc_entries = entry->next; | 1943 | smi->proc_entries = entry->next; |
@@ -1948,7 +1946,7 @@ static void remove_proc_entries(ipmi_smi_t smi) | |||
1948 | kfree(entry->name); | 1946 | kfree(entry->name); |
1949 | kfree(entry); | 1947 | kfree(entry); |
1950 | } | 1948 | } |
1951 | spin_unlock(&smi->proc_entry_lock); | 1949 | mutex_unlock(&smi->proc_entry_lock); |
1952 | remove_proc_entry(smi->proc_dir_name, proc_ipmi_root); | 1950 | remove_proc_entry(smi->proc_dir_name, proc_ipmi_root); |
1953 | #endif /* CONFIG_PROC_FS */ | 1951 | #endif /* CONFIG_PROC_FS */ |
1954 | } | 1952 | } |
@@ -2614,6 +2612,14 @@ channel_handler(ipmi_smi_t intf, struct ipmi_recv_msg *msg) | |||
2614 | return; | 2612 | return; |
2615 | } | 2613 | } |
2616 | 2614 | ||
2615 | void ipmi_poll_interface(ipmi_user_t user) | ||
2616 | { | ||
2617 | ipmi_smi_t intf = user->intf; | ||
2618 | |||
2619 | if (intf->handlers->poll) | ||
2620 | intf->handlers->poll(intf->send_info); | ||
2621 | } | ||
2622 | |||
2617 | int ipmi_register_smi(struct ipmi_smi_handlers *handlers, | 2623 | int ipmi_register_smi(struct ipmi_smi_handlers *handlers, |
2618 | void *send_info, | 2624 | void *send_info, |
2619 | struct ipmi_device_id *device_id, | 2625 | struct ipmi_device_id *device_id, |
@@ -2671,7 +2677,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers, | |||
2671 | } | 2677 | } |
2672 | intf->curr_seq = 0; | 2678 | intf->curr_seq = 0; |
2673 | #ifdef CONFIG_PROC_FS | 2679 | #ifdef CONFIG_PROC_FS |
2674 | spin_lock_init(&intf->proc_entry_lock); | 2680 | mutex_init(&intf->proc_entry_lock); |
2675 | #endif | 2681 | #endif |
2676 | spin_lock_init(&intf->waiting_msgs_lock); | 2682 | spin_lock_init(&intf->waiting_msgs_lock); |
2677 | INIT_LIST_HEAD(&intf->waiting_msgs); | 2683 | INIT_LIST_HEAD(&intf->waiting_msgs); |
@@ -4166,6 +4172,7 @@ EXPORT_SYMBOL(ipmi_destroy_user); | |||
4166 | EXPORT_SYMBOL(ipmi_get_version); | 4172 | EXPORT_SYMBOL(ipmi_get_version); |
4167 | EXPORT_SYMBOL(ipmi_request_settime); | 4173 | EXPORT_SYMBOL(ipmi_request_settime); |
4168 | EXPORT_SYMBOL(ipmi_request_supply_msgs); | 4174 | EXPORT_SYMBOL(ipmi_request_supply_msgs); |
4175 | EXPORT_SYMBOL(ipmi_poll_interface); | ||
4169 | EXPORT_SYMBOL(ipmi_register_smi); | 4176 | EXPORT_SYMBOL(ipmi_register_smi); |
4170 | EXPORT_SYMBOL(ipmi_unregister_smi); | 4177 | EXPORT_SYMBOL(ipmi_unregister_smi); |
4171 | EXPORT_SYMBOL(ipmi_register_for_cmd); | 4178 | EXPORT_SYMBOL(ipmi_register_for_cmd); |