mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
Add "run_scheduled_work()" workqueue function
This allows workqueue users to run just their own pending work, rather than wait for the whole workqueue to finish running. This solves the deadlock with networking libphy that was due to other workqueue entries possibly needing a lock that was held by the routine that wanted to flush its own work. It's not wonderful: if you absolutely need to synchronize with the work function having been executed, any user strictly speaking should have its own completion tracking logic, since when we run things explicitly by hand, the generic workqueue layer can no longer help us synchronize. Also, this is strictly only usable for work that has been scheduled without any delayed timers. You can not mix the new interface with schedule_delayed_work(). But it's better than what we had currently. Acked-by: Maciej W. Rozycki <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
2fd8507d14
commit
68380b5813
3 changed files with 75 additions and 2 deletions
|
|
@ -587,8 +587,7 @@ int phy_stop_interrupts(struct phy_device *phydev)
|
|||
* Finish any pending work; we might have been scheduled
|
||||
* to be called from keventd ourselves, though.
|
||||
*/
|
||||
if (!current_is_keventd())
|
||||
flush_scheduled_work();
|
||||
run_scheduled_work(&phydev->phy_queue);
|
||||
|
||||
free_irq(phydev->irq, phydev);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue