Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* nes: bug in phy_lock usage?
@ 2010-05-25  4:32 Roland Dreier
  0 siblings, 0 replies; only message in thread
From: Roland Dreier @ 2010-05-25  4:32 UTC (permalink / raw)
  To: Chien Tung; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

It seems that ce6e74f2 ("RDMA/nes: Make nesadapter->phy_lock usage
consistent") maybe introduced a locking bug.  sparse warns:

drivers/infiniband/hw/nes/nes_hw.c:2642:9: warning: context imbalance in 'nes_process_mac_intr' - different lock contexts for basic block

And indeed in nes_process_mac_intr(), you do

	spin_lock_irqsave(&nesadapter->phy_lock, flags);

at the very beginning, but then the unlock only happens inside

	if (nesadapter->mac_sw_state[mac_number] != NES_MAC_SW_IDLE) {

or inside

	if (mac_status & (NES_MAC_INT_LINK_STAT_CHG | NES_MAC_INT_XGMII_EXT)) {

so it seems it is possible to return from this function with the lock
held.

 - R.
-- 
Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-25  4:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-25  4:32 nes: bug in phy_lock usage? Roland Dreier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox