aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c51
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4_hw.c6
2 files changed, 42 insertions, 15 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
index 8b95117c2923..557fd8bfd54e 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
@@ -1567,6 +1567,12 @@ int cudbg_collect_tid(struct cudbg_init *pdbg_init,
1567 tid1->ver_hdr.size = sizeof(struct cudbg_tid_info_region_rev1) - 1567 tid1->ver_hdr.size = sizeof(struct cudbg_tid_info_region_rev1) -
1568 sizeof(struct cudbg_ver_hdr); 1568 sizeof(struct cudbg_ver_hdr);
1569 1569
1570 /* If firmware is not attached/alive, use backdoor register
1571 * access to collect dump.
1572 */
1573 if (!is_fw_attached(pdbg_init))
1574 goto fill_tid;
1575
1570#define FW_PARAM_PFVF_A(param) \ 1576#define FW_PARAM_PFVF_A(param) \
1571 (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_PFVF) | \ 1577 (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_PFVF) | \
1572 FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_PFVF_##param) | \ 1578 FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_PFVF_##param) | \
@@ -1604,6 +1610,9 @@ int cudbg_collect_tid(struct cudbg_init *pdbg_init,
1604 tid->nhpftids = val[1] - val[0] + 1; 1610 tid->nhpftids = val[1] - val[0] + 1;
1605 } 1611 }
1606 1612
1613#undef FW_PARAM_PFVF_A
1614
1615fill_tid:
1607 tid->ntids = padap->tids.ntids; 1616 tid->ntids = padap->tids.ntids;
1608 tid->nstids = padap->tids.nstids; 1617 tid->nstids = padap->tids.nstids;
1609 tid->stid_base = padap->tids.stid_base; 1618 tid->stid_base = padap->tids.stid_base;
@@ -1623,8 +1632,6 @@ int cudbg_collect_tid(struct cudbg_init *pdbg_init,
1623 tid->ip_users = t4_read_reg(padap, LE_DB_ACT_CNT_IPV4_A); 1632 tid->ip_users = t4_read_reg(padap, LE_DB_ACT_CNT_IPV4_A);
1624 tid->ipv6_users = t4_read_reg(padap, LE_DB_ACT_CNT_IPV6_A); 1633 tid->ipv6_users = t4_read_reg(padap, LE_DB_ACT_CNT_IPV6_A);
1625 1634
1626#undef FW_PARAM_PFVF_A
1627
1628 return cudbg_write_and_release_buff(pdbg_init, &temp_buff, dbg_buff); 1635 return cudbg_write_and_release_buff(pdbg_init, &temp_buff, dbg_buff);
1629} 1636}
1630 1637
@@ -1866,11 +1873,18 @@ int cudbg_collect_dump_context(struct cudbg_init *pdbg_init,
1866 max_ctx_size = region_info[i].end - region_info[i].start + 1; 1873 max_ctx_size = region_info[i].end - region_info[i].start + 1;
1867 max_ctx_qid = max_ctx_size / SGE_CTXT_SIZE; 1874 max_ctx_qid = max_ctx_size / SGE_CTXT_SIZE;
1868 1875
1869 t4_sge_ctxt_flush(padap, padap->mbox, i); 1876 /* If firmware is not attached/alive, use backdoor register
1870 rc = t4_memory_rw(padap, MEMWIN_NIC, mem_type[i], 1877 * access to collect dump.
1871 region_info[i].start, max_ctx_size, 1878 */
1872 (__be32 *)ctx_buf, 1); 1879 if (is_fw_attached(pdbg_init)) {
1873 if (rc) { 1880 t4_sge_ctxt_flush(padap, padap->mbox, i);
1881
1882 rc = t4_memory_rw(padap, MEMWIN_NIC, mem_type[i],
1883 region_info[i].start, max_ctx_size,
1884 (__be32 *)ctx_buf, 1);
1885 }
1886
1887 if (rc || !is_fw_attached(pdbg_init)) {
1874 max_ctx_qid = CUDBG_LOWMEM_MAX_CTXT_QIDS; 1888 max_ctx_qid = CUDBG_LOWMEM_MAX_CTXT_QIDS;
1875 cudbg_get_sge_ctxt_fw(pdbg_init, max_ctx_qid, i, 1889 cudbg_get_sge_ctxt_fw(pdbg_init, max_ctx_qid, i,
1876 &buff); 1890 &buff);
@@ -1946,9 +1960,10 @@ static void cudbg_mps_rpl_backdoor(struct adapter *padap,
1946 mps_rplc->rplc31_0 = htonl(t4_read_reg(padap, MPS_VF_RPLCT_MAP0_A)); 1960 mps_rplc->rplc31_0 = htonl(t4_read_reg(padap, MPS_VF_RPLCT_MAP0_A));
1947} 1961}
1948 1962
1949static int cudbg_collect_tcam_index(struct adapter *padap, 1963static int cudbg_collect_tcam_index(struct cudbg_init *pdbg_init,
1950 struct cudbg_mps_tcam *tcam, u32 idx) 1964 struct cudbg_mps_tcam *tcam, u32 idx)
1951{ 1965{
1966 struct adapter *padap = pdbg_init->adap;
1952 u64 tcamy, tcamx, val; 1967 u64 tcamy, tcamx, val;
1953 u32 ctl, data2; 1968 u32 ctl, data2;
1954 int rc = 0; 1969 int rc = 0;
@@ -2033,12 +2048,22 @@ static int cudbg_collect_tcam_index(struct adapter *padap,
2033 htons(FW_LDST_CMD_FID_V(FW_LDST_MPS_RPLC) | 2048 htons(FW_LDST_CMD_FID_V(FW_LDST_MPS_RPLC) |
2034 FW_LDST_CMD_IDX_V(idx)); 2049 FW_LDST_CMD_IDX_V(idx));
2035 2050
2036 rc = t4_wr_mbox(padap, padap->mbox, &ldst_cmd, sizeof(ldst_cmd), 2051 /* If firmware is not attached/alive, use backdoor register
2037 &ldst_cmd); 2052 * access to collect dump.
2038 if (rc) 2053 */
2054 if (is_fw_attached(pdbg_init))
2055 rc = t4_wr_mbox(padap, padap->mbox, &ldst_cmd,
2056 sizeof(ldst_cmd), &ldst_cmd);
2057
2058 if (rc || !is_fw_attached(pdbg_init)) {
2039 cudbg_mps_rpl_backdoor(padap, &mps_rplc); 2059 cudbg_mps_rpl_backdoor(padap, &mps_rplc);
2040 else 2060 /* Ignore error since we collected directly from
2061 * reading registers.
2062 */
2063 rc = 0;
2064 } else {
2041 mps_rplc = ldst_cmd.u.mps.rplc; 2065 mps_rplc = ldst_cmd.u.mps.rplc;
2066 }
2042 2067
2043 tcam->rplc[0] = ntohl(mps_rplc.rplc31_0); 2068 tcam->rplc[0] = ntohl(mps_rplc.rplc31_0);
2044 tcam->rplc[1] = ntohl(mps_rplc.rplc63_32); 2069 tcam->rplc[1] = ntohl(mps_rplc.rplc63_32);
@@ -2075,7 +2100,7 @@ int cudbg_collect_mps_tcam(struct cudbg_init *pdbg_init,
2075 2100
2076 tcam = (struct cudbg_mps_tcam *)temp_buff.data; 2101 tcam = (struct cudbg_mps_tcam *)temp_buff.data;
2077 for (i = 0; i < n; i++) { 2102 for (i = 0; i < n; i++) {
2078 rc = cudbg_collect_tcam_index(padap, tcam, i); 2103 rc = cudbg_collect_tcam_index(pdbg_init, tcam, i);
2079 if (rc) { 2104 if (rc) {
2080 cudbg_err->sys_err = rc; 2105 cudbg_err->sys_err = rc;
2081 cudbg_put_buff(pdbg_init, &temp_buff); 2106 cudbg_put_buff(pdbg_init, &temp_buff);
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index af27d2b0f79f..047609ef0515 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -195,9 +195,11 @@ static void t4_report_fw_error(struct adapter *adap)
195 u32 pcie_fw; 195 u32 pcie_fw;
196 196
197 pcie_fw = t4_read_reg(adap, PCIE_FW_A); 197 pcie_fw = t4_read_reg(adap, PCIE_FW_A);
198 if (pcie_fw & PCIE_FW_ERR_F) 198 if (pcie_fw & PCIE_FW_ERR_F) {
199 dev_err(adap->pdev_dev, "Firmware reports adapter error: %s\n", 199 dev_err(adap->pdev_dev, "Firmware reports adapter error: %s\n",
200 reason[PCIE_FW_EVAL_G(pcie_fw)]); 200 reason[PCIE_FW_EVAL_G(pcie_fw)]);
201 adap->flags &= ~FW_OK;
202 }
201} 203}
202 204
203/* 205/*
@@ -5088,7 +5090,7 @@ int t4_read_rss(struct adapter *adapter, u16 *map)
5088 5090
5089static unsigned int t4_use_ldst(struct adapter *adap) 5091static unsigned int t4_use_ldst(struct adapter *adap)
5090{ 5092{
5091 return (adap->flags & FW_OK) || !adap->use_bd; 5093 return (adap->flags & FW_OK) && !adap->use_bd;
5092} 5094}
5093 5095
5094/** 5096/**