Re: "deadlock" between smc91x driver and link_watch

From
Andrew Morton <hidden>
Date
2004-11-24 09:47:12
Also in
lkml
Reply to
Ian Campbell, 2004-11-24
Ian Campbell [off-list ref] wrote:
 On Tue, 2004-11-23 at 15:31 -0800, Andrew Morton wrote:
 > One possible fix would be to remove that flush_scheduled_work() and to do
 > refcounting around smc_phy_configure(): dev_hold() when scheduling the work
 > (if schedule_work() returned true), dev_put() in the handler.

 Something like the following?
I think so.
 +static void smc_phy_configure_wq(void *data)
 +{
 +	struct net_device *dev = data;
 +	dev_put(dev);
 +	smc_phy_configure(data);
 +}
You'd want to do the dev_put() after the smc_phy_configure() though.  It
may still be a tiny bit racy against module unload.
Thread (10 messages) 10 messages, 3 authors, last reply 2004-11-27
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help