Skip to content

Commit 7422198

Browse files
committed
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>
1 parent 305923b commit 7422198

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

drivers/char/ipmi/ipmi_msghandler.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5083,8 +5083,11 @@ static struct timer_list ipmi_timer;
50835083

50845084
static atomic_t stop_operation;
50855085

5086-
static void ipmi_timeout(struct timer_list *unused)
5086+
static void ipmi_timeout_work(struct work_struct *work)
50875087
{
5088+
if (atomic_read(&stop_operation))
5089+
return;
5090+
50885091
struct ipmi_smi *intf;
50895092
bool need_timer = false;
50905093
int index;
@@ -5111,6 +5114,16 @@ static void ipmi_timeout(struct timer_list *unused)
51115114
mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES);
51125115
}
51135116

5117+
static DECLARE_WORK(ipmi_timer_work, ipmi_timeout_work);
5118+
5119+
static void ipmi_timeout(struct timer_list *unused)
5120+
{
5121+
if (atomic_read(&stop_operation))
5122+
return;
5123+
5124+
queue_work(system_bh_wq, &ipmi_timer_work);
5125+
}
5126+
51145127
static void need_waiter(struct ipmi_smi *intf)
51155128
{
51165129
/* Racy, but worst case we start the timer twice. */
@@ -5538,6 +5551,7 @@ static void __exit cleanup_ipmi(void)
55385551
*/
55395552
atomic_set(&stop_operation, 1);
55405553
timer_delete_sync(&ipmi_timer);
5554+
cancel_work_sync(&ipmi_timer_work);
55415555

55425556
initialized = false;
55435557

0 commit comments

Comments
 (0)