From: Michal Schmidt <mschmidt@redhat.com> Date: Fri, 3 Sep 2010 16:42:42 -0400 Subject: [net] bnx2x: use register mask to avoid parity error Message-id: <20100903164242.25415.63038.stgit@brian.englab.brq.redhat.com> Patchwork-id: 28094 O-Subject: [RHEL5.6 BZ572012 PATCH 19/46] bnx2x: use mask in test_registers() to avoid parity error Bugzilla: 572012 RH-Acked-by: David S. Miller <davem@redhat.com> RH-Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> From: Vladislav Zolotarov <vladz@broadcom.com> Properly mask the value to be written to the register (according to the register size) during the self-test. Otherwise immediate parity error would be generated. Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 8eb5a20ccc67d85d52ead88fb263eb28814ca2b4) diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 1a7334c..73bf216 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c @@ -11168,7 +11168,7 @@ static int bnx2x_test_registers(struct bnx2x *bp) save_val = REG_RD(bp, offset); - REG_WR(bp, offset, wr_val); + REG_WR(bp, offset, (wr_val & mask)); val = REG_RD(bp, offset); /* Restore the original register's value */