* [PATCH net 1/2] bnx2x: Prevent UNDI FW illegal host access
2013-04-18 8:49 [PATCH net 0/2] bnx2x: Bug fixes patch series Yuval Mintz
@ 2013-04-18 8:49 ` Yuval Mintz
2013-04-18 8:49 ` [PATCH net 2/2] bnx2x: Fix status blocks configuration Yuval Mintz
2013-04-18 19:04 ` [PATCH net 0/2] bnx2x: Bug fixes patch series David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Yuval Mintz @ 2013-04-18 8:49 UTC (permalink / raw)
To: davem, netdev; +Cc: eilong, ariele, Dmitry Kravkov, Yuval Mintz
From: Dmitry Kravkov <dmitry@broadcom.com>
When loading after UNDI (e.g., Boot from SAN) the UNDI does not
gracefully yield its resources; The bnx2x driver handles that release
itself.
During the manipulation required to release those resources, it's possible
for the UNDI to try and write to memory regions which are no longer accessible,
causing the PCI bus to prevent further writes from the chip.
This would in turn cause DMAE timeouts later on in the driver, as the driver
will be unable to use the chip's DMA engines.
This patch prevents the chip from actually writing through the PCI bus
in said scenario, thus allowing the release without the unfortunate by-product.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 0c1d75a..c8ef9f5 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -9945,6 +9945,10 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp)
REG_RD(bp, NIG_REG_NIG_INT_STS_CLR_0);
}
}
+ if (!CHIP_IS_E1x(bp))
+ /* block FW from writing to host */
+ REG_WR(bp, PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER, 0);
+
/* wait until BRB is empty */
tmp_reg = REG_RD(bp, BRB1_REG_NUM_OF_FULL_BLOCKS);
while (timer_count) {
--
1.8.1.227.g44fe835
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net 2/2] bnx2x: Fix status blocks configuration
2013-04-18 8:49 [PATCH net 0/2] bnx2x: Bug fixes patch series Yuval Mintz
2013-04-18 8:49 ` [PATCH net 1/2] bnx2x: Prevent UNDI FW illegal host access Yuval Mintz
@ 2013-04-18 8:49 ` Yuval Mintz
2013-04-18 19:04 ` [PATCH net 0/2] bnx2x: Bug fixes patch series David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Yuval Mintz @ 2013-04-18 8:49 UTC (permalink / raw)
To: davem, netdev; +Cc: eilong, ariele, Yuval Mintz
From: Ariel Elior <ariele@broadcom.com>
This fixes 2 issues regarding bnx2x's status blocks:
1. ethtool -c caused corruption of status blocks in FW RAM.
2. when using multi-CoS, the configuration of the timeout values of
status blocks is incorrect, harming the coalescing of interrupts
for such CoSs.
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 9e99d38..0cd508a 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -2624,6 +2624,9 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
}
}
+ /* initialize FW coalescing state machines in RAM */
+ bnx2x_update_coalesce(bp);
+
/* setup the leading queue */
rc = bnx2x_setup_leading(bp);
if (rc) {
@@ -4746,11 +4749,11 @@ static void storm_memset_hc_disable(struct bnx2x *bp, u8 port,
u32 enable_flag = disable ? 0 : (1 << HC_INDEX_DATA_HC_ENABLED_SHIFT);
u32 addr = BAR_CSTRORM_INTMEM +
CSTORM_STATUS_BLOCK_DATA_FLAGS_OFFSET(fw_sb_id, sb_index);
- u16 flags = REG_RD16(bp, addr);
+ u8 flags = REG_RD8(bp, addr);
/* clear and set */
flags &= ~HC_INDEX_DATA_HC_ENABLED;
flags |= enable_flag;
- REG_WR16(bp, addr, flags);
+ REG_WR8(bp, addr, flags);
DP(NETIF_MSG_IFUP,
"port %x fw_sb_id %d sb_index %d disable %d\n",
port, fw_sb_id, sb_index, disable);
--
1.8.1.227.g44fe835
^ permalink raw reply related [flat|nested] 4+ messages in thread