netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next 1/3] bna: Semaphore Lock Fix
@ 2011-09-17  1:06 Rasesh Mody
  2011-09-17  1:06 ` [net-next 2/3] bna: Set Ring Param Fix Rasesh Mody
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Rasesh Mody @ 2011-09-17  1:06 UTC (permalink / raw)
  To: davem, netdev; +Cc: adapter_linux_open_src_team, Rasesh Mody, Gurunatha Karaje

Remove a BUG_ON() as it is not required.

Change the unconditional write to release a semaphore to read sem first
and then write. This will eliminate the possibility of sem getting locked
while trying to release it in case if previous sem_get operation failed.

Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
---
 drivers/net/ethernet/brocade/bna/bfa_ioc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.c b/drivers/net/ethernet/brocade/bna/bfa_ioc.c
index 029fb52..4282fef 100644
--- a/drivers/net/ethernet/brocade/bna/bfa_ioc.c
+++ b/drivers/net/ethernet/brocade/bna/bfa_ioc.c
@@ -1201,13 +1201,13 @@ bfa_nw_ioc_sem_get(void __iomem *sem_reg)
 	if (!(r32 & 1))
 		return true;
 
-	BUG_ON(!(cnt < BFA_SEM_SPINCNT));
 	return false;
 }
 
 void
 bfa_nw_ioc_sem_release(void __iomem *sem_reg)
 {
+	readl(sem_reg);
 	writel(1, sem_reg);
 }
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-09-17  4:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-17  1:06 [net-next 1/3] bna: Semaphore Lock Fix Rasesh Mody
2011-09-17  1:06 ` [net-next 2/3] bna: Set Ring Param Fix Rasesh Mody
2011-09-17  4:48   ` David Miller
2011-09-17  1:06 ` [net-next 3/3] bna: Eliminate Small Race Condition Window in RX Path Rasesh Mody
2011-09-17  4:48   ` David Miller
2011-09-17  4:48 ` [net-next 1/3] bna: Semaphore Lock Fix David Miller

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).