linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Siewior <netdev@ml.breakpoint.cc>
To: Nate Case <ncase@xes-inc.com>
Cc: netdev@vger.kernel.org,
	Sebastian Siewior <netdev@ml.breakpoint.cc>,
	linuxppc-dev@ozlabs.org, Vitaly Bordug <vbordug@ru.mvista.com>,
	Li Yang <leoli@freescale.com>
Subject: Re: bug: mutex_lock() in interrupt conntext via phy_stop() in gianfar
Date: Tue, 22 Jul 2008 22:59:11 +0200	[thread overview]
Message-ID: <20080722205911.GA29840@Chamillionaire.breakpoint.cc> (raw)
In-Reply-To: <1216681028.7559.993.camel@localhost.localdomain>

* Nate Case | 2008-07-21 17:57:08 [-0500]:

>On Fri, 2008-07-18 at 14:10 +0200, Sebastian Siewior wrote:
>> Commit 35b5f6b1a aka [PHYLIB: Locking fixes for PHY I/O potentially sleeping]
>> changed the phydev->lock from spinlock into a mutex. Now, the following
>> code path got triggered while NFS was unavailable:
>> 
>[snip]
>> |[  194.864733] BUG: sleeping function called from invalid context at /home/bigeasy/git/linux-2.6-powerpc/kernel/mutex.c:87
>> |[  194.875529] in_atomic():1, irqs_disabled():0
>> |[  194.879805] Call Trace:
>> |[  194.882250] [c0383d90] [c0006dd8] show_stack+0x48/0x184 (unreliable)
>> |[  194.888649] [c0383db0] [c001e938] __might_sleep+0xe0/0xf4
>> |[  194.894069] [c0383dc0] [c025a43c] mutex_lock+0x24/0x3c
>> |[  194.899234] [c0383de0] [c019005c] phy_stop+0x20/0x70
>> |[  194.904234] [c0383df0] [c018d4ec] stop_gfar+0x28/0xf4
>> |[  194.909305] [c0383e10] [c018e8c4] gfar_timeout+0x30/0x60
>> |[  194.914638] [c0383e20] [c01fe7c0] dev_watchdog+0xa8/0x144
>
>Hmm..  I'm not sure what the best solution is to this.  Make the
>stop_gfar() call happen in a workqueue, and make a similar change to
>ucc_geth, fec_mpc52xx, and fs_enet? Modify phy_stop() to do the work in
>a workqueue conditionally if in interrupt context?  Between these two
>I'd lean toward the latter.
>
>Does anyone have any better ideas?
If I look at tg3.c than exactly this is done. Others call it only on
close(). I guess this depends very much on driver's logic :)
If nobody minds, than I would assume that tg3.c is a good example and I
would move the timout path into a workqueu.

Sebastian

  reply	other threads:[~2008-07-22 20:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-18 12:10 bug: mutex_lock() in interrupt conntext via phy_stop() in gianfar Sebastian Siewior
2008-07-21 22:57 ` Nate Case
2008-07-22 20:59   ` Sebastian Siewior [this message]
2008-07-23 20:03     ` [PATCH / RFC] net: don't grab a mutex within a timer context " Sebastian Siewior
2008-07-25 14:16       ` Nate Case
2008-07-25 19:02       ` Andy Fleming
2008-07-23 22:12   ` bug: mutex_lock() in interrupt conntext via phy_stop() " Benjamin Herrenschmidt
2008-07-24  7:27     ` Sebastian Siewior
2008-07-22  7:54 ` Wolfram Sang

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=20080722205911.GA29840@Chamillionaire.breakpoint.cc \
    --to=netdev@ml.breakpoint.cc \
    --cc=leoli@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=ncase@xes-inc.com \
    --cc=netdev@vger.kernel.org \
    --cc=vbordug@ru.mvista.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).