Skip to content

Commit

Permalink
bna: Semaphore Lock Fix
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rasesh Mody authored and David S. Miller committed Sep 17, 2011
1 parent ae0e148 commit 1d51a13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/brocade/bna/bfa_ioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 1d51a13

Please sign in to comment.