mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-10 18:04:04 -05:00
ipmi:msghandler: Move timer handling into a work queue
Get all operations that manipulate the interface list into thread context. Signed-off-by: Corey Minyard <cminyard@mvista.com>
This commit is contained in:
@@ -5083,8 +5083,11 @@ static struct timer_list ipmi_timer;
|
||||
|
||||
static atomic_t stop_operation;
|
||||
|
||||
static void ipmi_timeout(struct timer_list *unused)
|
||||
static void ipmi_timeout_work(struct work_struct *work)
|
||||
{
|
||||
if (atomic_read(&stop_operation))
|
||||
return;
|
||||
|
||||
struct ipmi_smi *intf;
|
||||
bool need_timer = false;
|
||||
int index;
|
||||
@@ -5111,6 +5114,16 @@ static void ipmi_timeout(struct timer_list *unused)
|
||||
mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES);
|
||||
}
|
||||
|
||||
static DECLARE_WORK(ipmi_timer_work, ipmi_timeout_work);
|
||||
|
||||
static void ipmi_timeout(struct timer_list *unused)
|
||||
{
|
||||
if (atomic_read(&stop_operation))
|
||||
return;
|
||||
|
||||
queue_work(system_bh_wq, &ipmi_timer_work);
|
||||
}
|
||||
|
||||
static void need_waiter(struct ipmi_smi *intf)
|
||||
{
|
||||
/* Racy, but worst case we start the timer twice. */
|
||||
@@ -5538,6 +5551,7 @@ static void __exit cleanup_ipmi(void)
|
||||
*/
|
||||
atomic_set(&stop_operation, 1);
|
||||
timer_delete_sync(&ipmi_timer);
|
||||
cancel_work_sync(&ipmi_timer_work);
|
||||
|
||||
initialized = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user