[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20091006000339.GA18376@xw6200.broadcom.net>
Date: Mon, 5 Oct 2009 17:03:39 -0700
From: "Matt Carlson" <mcarlson@...adcom.com>
To: "Michael Chan" <mchan@...adcom.com>
cc: "Matthew Carlson" <mcarlson@...adcom.com>,
"Felix Radensky" <felix@...edded-sol.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"andy@...yhouse.net" <andy@...yhouse.net>
Subject: Re: [PATCH net-2.6] tg3: Fix phylib locking strategy
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@...adcom.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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists