Subject: Re: [PATCH] phylib: Move workqueue initialization to a proper place

From: David Miller <[email-masked]>
Date: Tue, 19 Jan 2010 02:00:29 -0800 (PST)

From: Anton Vorontsov <[email-masked]>
Date: Mon, 18 Jan 2010 18:37:16 +0300

> commit 541cd3ee00a4fe975b22fac6a3bc846bacef37f7 ("phylib: Fix deadlock
> on resume") caused TI DaVinci EMAC ethernet driver to oops upon resume:
 ...
> The oops pops up because TI DaVinci EMAC driver detaches PHY on
> suspend and attaches it back on resume. Attaching makes phylib call
> phy_start_machine() that initializes a workqueue. On the other hand,
> PHY's resume routine will call phy_start_machine() again, and that
> will cause the oops since we just destroyed the already scheduled
> workqueue.
> 
> This patch fixes the issue by moving workqueue initialization to
> phy_device_create().
> 
> p.s. We don't see this oops with ucc_geth and gianfar drivers because
> they perform a fine-grained suspend, i.e. they just stop the PHYs
> without detaching.
> 
> Reported-by: Sekhar Nori <[email-masked]>
> Signed-off-by: Anton Vorontsov <[email-masked]>
> Tested-by: Sekhar Nori <[email-masked]>

Applied, thanks.