diff mbox

[2/3] bnx2x: assure we release PHY lock only when is taken

Message ID 20090506112207.4d3ae9c4@dhcp-lab-109.englab.brq.redhat.com
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

Stanislaw Gruszka May 6, 2009, 9:22 a.m. UTC
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/bnx2x_main.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

Comments

Eilon Greenstein May 6, 2009, 12:04 p.m. UTC | #1
On Wed, 2009-05-06 at 02:22 -0700, Stanislaw Gruszka wrote:
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
>  drivers/net/bnx2x_main.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
> index ff2d9f6..5bd42db 100644
> --- a/drivers/net/bnx2x_main.c
> +++ b/drivers/net/bnx2x_main.c
> @@ -2585,10 +2585,11 @@ static void bnx2x_attn_int_asserted(struct bnx2x *bp, u32 asserted)
>  	REG_WR(bp, hc_addr, asserted);
>  
>  	/* now set back the mask */
> -	if (asserted & ATTN_NIG_FOR_FUNC) {
> -		REG_WR(bp, nig_int_mask_addr, nig_mask);
> -		bnx2x_release_phy_lock(bp);
> -	}
> +	if (asserted & ATTN_HARD_WIRED_MASK)
> +		if (asserted & ATTN_NIG_FOR_FUNC) {
Here are the constants values:
#define ATTN_HARD_WIRED_MASK		0xff00
#define ATTN_NIG_FOR_FUNC		(1L << 8)
So as you can see, there is no need for the extra "if".

Thanks for the patch - but we should not apply it.

> +			REG_WR(bp, nig_int_mask_addr, nig_mask);
> +			bnx2x_release_phy_lock(bp);
> +		}
>  }
>  
>  static inline void bnx2x_attn_int_deasserted0(struct bnx2x *bp, u32 attn)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index ff2d9f6..5bd42db 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -2585,10 +2585,11 @@  static void bnx2x_attn_int_asserted(struct bnx2x *bp, u32 asserted)
 	REG_WR(bp, hc_addr, asserted);
 
 	/* now set back the mask */
-	if (asserted & ATTN_NIG_FOR_FUNC) {
-		REG_WR(bp, nig_int_mask_addr, nig_mask);
-		bnx2x_release_phy_lock(bp);
-	}
+	if (asserted & ATTN_HARD_WIRED_MASK)
+		if (asserted & ATTN_NIG_FOR_FUNC) {
+			REG_WR(bp, nig_int_mask_addr, nig_mask);
+			bnx2x_release_phy_lock(bp);
+		}
 }
 
 static inline void bnx2x_attn_int_deasserted0(struct bnx2x *bp, u32 attn)