Commit fe8998c5 authored by Tejun Heo's avatar Tejun Heo

sungem: update gp->reset_task flushing

gp->reset_task_pending is always set right before reset_task is
scheduled and as there is no synchronization between the setting and
scheduling, busy looping on reset_task_pending before flushing
reset_task doesn't really buy anything.

Directly flush gp->reset_task on suspend and cancel on detach.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
parent 760141a5
...@@ -2380,10 +2380,8 @@ static int gem_suspend(struct pci_dev *pdev, pm_message_t state) ...@@ -2380,10 +2380,8 @@ static int gem_suspend(struct pci_dev *pdev, pm_message_t state)
*/ */
mutex_unlock(&gp->pm_mutex); mutex_unlock(&gp->pm_mutex);
/* Wait for a pending reset task to complete */ /* Wait for the pending reset task to complete */
while (gp->reset_task_pending) flush_work_sync(&gp->reset_task);
yield();
flush_scheduled_work();
/* Shut the PHY down eventually and setup WOL */ /* Shut the PHY down eventually and setup WOL */
gem_stop_phy(gp, gp->asleep_wol); gem_stop_phy(gp, gp->asleep_wol);
...@@ -2928,10 +2926,8 @@ static void gem_remove_one(struct pci_dev *pdev) ...@@ -2928,10 +2926,8 @@ static void gem_remove_one(struct pci_dev *pdev)
/* We shouldn't need any locking here */ /* We shouldn't need any locking here */
gem_get_cell(gp); gem_get_cell(gp);
/* Wait for a pending reset task to complete */ /* Cancel reset task */
while (gp->reset_task_pending) cancel_work_sync(&gp->reset_task);
yield();
flush_scheduled_work();
/* Shut the PHY down */ /* Shut the PHY down */
gem_stop_phy(gp, 0); gem_stop_phy(gp, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment