]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnx2x: Broken self-test in SF mode on 578xx
authorVladislav Zolotarov <vladz@broadcom.com>
Thu, 21 Jul 2011 07:58:54 +0000 (07:58 +0000)
committerJoe Jin <joe.jin@oracle.com>
Wed, 16 May 2012 08:31:34 +0000 (16:31 +0800)
This patch fixes both the failure in the self-test on 578xx
and a hole in a parity recovery flow that this failure
has discovered:
 - internal 'pending' state in a VLAN_MAC object wasn't been cleared
when the object state change was called with DRV_ONLY flag, which in
particular happens when a parity error happens during the self-test.
 - bp->sp_state wasn't cleared in the similar circumstances as described
above.

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 7961689586d30a34c10b18ac95ba1cd72cefe725)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/bnx2x/bnx2x_cmn.c
drivers/net/bnx2x/bnx2x_reg.h
drivers/net/bnx2x/bnx2x_sp.c

index deb17a4fc29faff4cd9a0c865ccdcd3d12dc11f7..ab8287f9ebcc96a04a9aa537eae2dff7f7650f5e 100644 (file)
@@ -2040,6 +2040,9 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode)
         */
        bnx2x_squeeze_objects(bp);
 
+       /* There should be no more pending SP commands at this stage */
+       bp->sp_state = 0;
+
        bp->port.pmf = 0;
 
        /* Free SKBs, SGEs, TPA pool and driver internals */
index 6b1dfdc953dc98ba816740e2d3486b702b235f79..1d877c62f712d19897b9db8e911f2701a00cf82f 100644 (file)
    mechanism. The fields are: [5:0] - message length; [12:6] - message
    pointer; 18:13] - next pointer. */
 #define CCM_REG_XX_DESCR_TABLE                                  0xd0300
-#define CCM_REG_XX_DESCR_TABLE_SIZE                             36
+#define CCM_REG_XX_DESCR_TABLE_SIZE                             24
 /* [R 7] Used to read the value of XX protection Free counter. */
 #define CCM_REG_XX_FREE                                         0xd0184
 /* [RW 6] Initial value for the credit counter; responsible for fulfilling
    mechanism. The fields are: [5:0] - length of the message; 15:6] - message
    pointer; 20:16] - next pointer. */
 #define TCM_REG_XX_DESCR_TABLE                                  0x50280
-#define TCM_REG_XX_DESCR_TABLE_SIZE                             32
+#define TCM_REG_XX_DESCR_TABLE_SIZE                             29
 /* [R 6] Use to read the value of XX protection Free counter. */
 #define TCM_REG_XX_FREE                                         0x50178
 /* [RW 6] Initial value for the credit counter; responsible for fulfilling
    mechanism. The fields are:[5:0] - message length; 14:6] - message
    pointer; 19:15] - next pointer. */
 #define UCM_REG_XX_DESCR_TABLE                                  0xe0280
-#define UCM_REG_XX_DESCR_TABLE_SIZE                             32
+#define UCM_REG_XX_DESCR_TABLE_SIZE                             27
 /* [R 6] Use to read the XX protection Free counter. */
 #define UCM_REG_XX_FREE                                         0xe016c
 /* [RW 6] Initial value for the credit counter; responsible for fulfilling
index 2f0d5f2970ee58d0a16315cc5753c2ff6389d324..8d0cdf12b99e30bc4e12814113a1920be4d98a36 100644 (file)
@@ -1690,6 +1690,12 @@ int bnx2x_config_vlan_mac(
        if (!bnx2x_exe_queue_empty(&o->exe_queue))
                rc = 1;
 
+       if (test_bit(RAMROD_DRV_CLR_ONLY, ramrod_flags))  {
+               DP(BNX2X_MSG_SP, "RAMROD_DRV_CLR_ONLY requested: "
+                                "clearing a pending bit.\n");
+               raw->clear_pending(raw);
+       }
+
        /* Execute commands if required */
        if (cont || test_bit(RAMROD_EXEC, ramrod_flags) ||
            test_bit(RAMROD_COMP_WAIT, ramrod_flags)) {