From: Andrew Morton <akpm@osdl.org>
To: Ian Campbell <icampbell@arcom.com>
Cc: nico@cam.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com
Subject: Re: "deadlock" between smc91x driver and link_watch
Date: Wed, 24 Nov 2004 01:46:50 -0800 [thread overview]
Message-ID: <20041124014650.47af8ae4.akpm@osdl.org> (raw)
In-Reply-To: <1101289309.10841.9.camel@icampbell-debian>
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.
next prev parent reply other threads:[~2004-11-24 9:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-23 17:16 "deadlock" between smc91x driver and link_watch Ian Campbell
2004-11-23 23:31 ` Andrew Morton
2004-11-24 9:41 ` Ian Campbell
2004-11-24 9:46 ` Andrew Morton [this message]
2004-11-24 9:58 ` Ian Campbell
2004-11-24 15:21 ` Nicolas Pitre
2004-11-24 15:52 ` Ian Campbell
2004-11-24 16:57 ` Nicolas Pitre
2004-11-24 17:13 ` Ian Campbell
2004-11-25 9:59 ` Ian Campbell
2004-11-25 16:31 ` Nicolas Pitre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041124014650.47af8ae4.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=icampbell@arcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.com \
--cc=nico@cam.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.