提交 52733cff 编写于 作者: S Shannon Nelson 提交者: David S. Miller

ionic: drain the work queue

Check through our work list for additional items.  This normally
will only have one item, but occasionally may have another
job waiting.  There really is no need reschedule ourself here.
Reported-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: NShannon Nelson <snelson@pensando.io>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9576a36c
......@@ -62,15 +62,18 @@ static void ionic_lif_deferred_work(struct work_struct *work)
struct ionic_deferred *def = &lif->deferred;
struct ionic_deferred_work *w = NULL;
spin_lock_bh(&def->lock);
if (!list_empty(&def->list)) {
w = list_first_entry(&def->list,
struct ionic_deferred_work, list);
list_del(&w->list);
}
spin_unlock_bh(&def->lock);
do {
spin_lock_bh(&def->lock);
if (!list_empty(&def->list)) {
w = list_first_entry(&def->list,
struct ionic_deferred_work, list);
list_del(&w->list);
}
spin_unlock_bh(&def->lock);
if (!w)
break;
if (w) {
switch (w->type) {
case IONIC_DW_TYPE_RX_MODE:
ionic_lif_rx_mode(lif, w->rx_mode);
......@@ -94,8 +97,8 @@ static void ionic_lif_deferred_work(struct work_struct *work)
break;
}
kfree(w);
schedule_work(&def->work);
}
w = NULL;
} while (true);
}
void ionic_lif_deferred_enqueue(struct ionic_deferred *def,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册