netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Matt Carlson" <mcarlson@broadcom.com>
To: "Michael Chan" <mchan@broadcom.com>
Cc: "Matthew Carlson" <mcarlson@broadcom.com>,
	"Felix Radensky" <felix@embedded-sol.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"andy@greyhouse.net" <andy@greyhouse.net>
Subject: Re: [PATCH net-2.6] tg3: Fix phylib locking strategy
Date: Mon, 5 Oct 2009 17:03:39 -0700	[thread overview]
Message-ID: <20091006000339.GA18376@xw6200.broadcom.net> (raw)
In-Reply-To: <1254778197.8559.2.camel@HP1>

On Mon, Oct 05, 2009 at 02:29:57PM -0700, Michael Chan wrote:
> 
> On Mon, 2009-10-05 at 14:09 -0700, Matt Carlson wrote:
> > Felix, can you verify this solves your problem?
> > 
> > ---
> > 
> > Felix Radensky noted that chip resets were generating stack trace dumps.
> > This is because the driver is attempting to acquire the mdio bus mutex
> > while holding the tp->lock spinlock.  The fix is to change the code such
> > that every phy access takes the tp->lock spinlock instead.
> > 
> > Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
> > ---
> >  drivers/net/tg3.c |   37 ++++++++++++-------------------------
> >  drivers/net/tg3.h |    1 -
> >  2 files changed, 12 insertions(+), 26 deletions(-)
> > 
> > diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
> > index f09bc5d..8afc60e 100644
> > --- a/drivers/net/tg3.c
> > +++ b/drivers/net/tg3.c
> > @@ -902,11 +902,12 @@ static int tg3_mdio_read(struct mii_bus *bp, int mii_id, int reg)
> >  	struct tg3 *tp = bp->priv;
> >  	u32 val;
> >  
> > -	if (tp->tg3_flags3 & TG3_FLG3_MDIOBUS_PAUSED)
> > -		return -EAGAIN;
> > +	spin_lock(&tp->lock);
> >  
> 
> Matt, do we need spin_lock_bh() here?  The tp->lock can be taken in NAPI
> poll BH context.

Yes.  You are right.  And the same change needs to be made in
tg3_adjust_link().  V2 of the patch, coming up.


      reply	other threads:[~2009-10-06  0:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-05 21:09 [PATCH net-2.6] tg3: Fix phylib locking strategy Matt Carlson
2009-10-05 21:29 ` Michael Chan
2009-10-06  0:03   ` Matt Carlson [this message]

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=20091006000339.GA18376@xw6200.broadcom.net \
    --to=mcarlson@broadcom.com \
    --cc=andy@greyhouse.net \
    --cc=felix@embedded-sol.com \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.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 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).