From: Michal Ostrowski <mostrows@watson.ibm.com>
To: netdev@oss.sgi.com
Subject: Deadlock in sungem/ip_auto_config/linkwatch
Date: Mon, 05 Jan 2004 08:07:58 -0500 [thread overview]
Message-ID: <1073307882.2041.98320.camel@brick.watson.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 849 bytes --]
I believe I've found a potential deadlock condition.
It occurs when we make the following sequence of calls:
ip_auto_config
ic_open_devs
dev_change_flags
dev_open
gem_open
flush_scheduled_work
ic_open_devs grabs rtnl_sem with an rtnl_shlock() call.
The sungem driver at some point calls gem_init_one, which calls
netif_carrier_*, which in turn calls schedule_work (linkwatch_event).
linkwatch_event in turn needs rtnl_sem.
If we enter the call sequence above and linkwatch_event is still
pending, we will deadlock since flush_scheduled_work will wait for
completion of linkwatch_event, which is blocked since it cannot get
rtnl_sem.
In general when can one call flush_scheduled_work? It seems that one
can't unless you know your callers aren't holding any locks.
--
Michal Ostrowski <mostrows@watson.ibm.com>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next reply other threads:[~2004-01-05 13:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-05 13:07 Michal Ostrowski [this message]
2004-01-05 14:50 ` Deadlock in sungem/ip_auto_config/linkwatch Stefan Rompf
2004-01-05 16:19 ` Michal Ostrowski
2004-01-05 16:50 ` Stefan Rompf
2004-01-05 19:02 ` David S. Miller
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=1073307882.2041.98320.camel@brick.watson.ibm.com \
--to=mostrows@watson.ibm.com \
--cc=netdev@oss.sgi.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).