lkml.org 
[lkml]   [2004]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: "deadlock" between smc91x driver and link_watch
Ian Campbell <icampbell@arcom.com> 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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.040 / U:1.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site