[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20071214002209.ac748206.akpm@linux-foundation.org>
Date: Fri, 14 Dec 2007 00:22:09 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [patch 2/4] net: use mutex_is_locked() for ASSERT_RTNL()
On Fri, 14 Dec 2007 16:10:44 +0800 Herbert Xu <herbert@...dor.apana.org.au> wrote:
> akpm@...ux-foundation.org wrote:
> >
> > diff -puN drivers/net/cxgb3/cxgb3_main.c~net-use-mutex_is_locked-for-assert_rtnl drivers/net/cxgb3/cxgb3_main.c
> > --- a/drivers/net/cxgb3/cxgb3_main.c~net-use-mutex_is_locked-for-assert_rtnl
> > +++ a/drivers/net/cxgb3/cxgb3_main.c
> > @@ -2191,7 +2191,7 @@ static void check_t3b2_mac(struct adapte
> > {
> > int i;
> >
> > - if (!rtnl_trylock()) /* synchronize with ifdown */
> > + if (rtnl_is_locked()) /* synchronize with ifdown */
> > return;
> >
> > for_each_port(adapter, i) {
> > @@ -2219,7 +2219,6 @@ static void check_t3b2_mac(struct adapte
> > p->mac.stats.num_resets++;
> > }
> > }
> > - rtnl_unlock();
>
> This doesn't look right. It seems that they really want trylock
> here so we should just fix it by removing the bang.
doh.
> Also, does ASSERT_RTNL still warn when someone calls it from an
> atomic context? We definitely don't want to lose that check.
I don't see how it could warn about that. Nor should it - one might want
to check that rtnl_lock is held inside preempt_disable() or spin_lock or
whatever.
It might make sense to warn if ASSERT_RTNL is called in in_interrupt()
contexts though.
--
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