bnx2x: Bug fixes patch series
cover bnx2x: Bug fixes patch series
Hi Dave,
This patch contain fixes in two areas -
1. Preventing UNDI FW from illegally accessing memory when it shouldn't.
2. Fix interrupt coalescing initialization and configuration when working with multiple CoS.
Please consider applying these patches to `net'.
Thanks,
Yuval Mintz
PATCH 1/2 bnx2x: Prevent UNDI FW illegal host access
From: Dmitry Kravkov <[email protected]>
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.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +4 -0
@@ -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) {
Signature · 1 line
1.8.1.227.g44fe835
PATCH 2/2 bnx2x: Fix status blocks configuration
In reply to Yuval MintzFrom: Ariel Elior <[email protected]>
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.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +5 -2
@@ -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);
Signature · 1 line
1.8.1.227.g44fe835
David Miller
maintainerFrom: "Yuval Mintz" <[email protected]>
Date: Thu, 18 Apr 2013 11:49:04 +0300
Quoted 10 lines
Hi Dave,
This patch contain fixes in two areas -
1. Preventing UNDI FW from illegally accessing memory when it shouldn't.
2. Fix interrupt coalescing initialization and configuration when working with multiple CoS.
Please consider applying these patches to `net'.
Both applied, thanks.