diff options
author | Carl Heymann <carl.heymann@netronome.com> | 2017-12-14 04:50:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-15 12:48:45 -0500 |
commit | 28b2d7d04b00150e2f06fa4ba9a99b9d2eb379bf (patch) | |
tree | 55e6dc7a064c9ae200f759d0a1c31fa8317ac528 | |
parent | da762863edd9e3f9b391620b845f2a6ffdc6dd7d (diff) |
nfp: fix XPB register reads in debug dump
For XPB registers reads, some island IDs require special handling (e.g.
ARM island), which is already taken care of in nfp_xpb_readl(), so use
that instead of a straight CPP read.
Without this fix all "xpbm:ArmIsldXpbmMap.*" registers are reported as
0xffffffff. It has also been observed to cause a system reboot.
With this fix correct values are reported, none of which are 0xffffffff.
The values may be read using ethtool debug level 2.
# ethtool -W <netdev> 2
# ethtool -w <netdev> data dump.dat
Fixes: 0e6c4955e149 ("nfp: dump CPP, XPB and direct ME CSRs")
Signed-off-by: Carl Heymann <carl.heymann@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c b/drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c index 315bd22819ff..173646e17e94 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "nfp_main.h" | 38 | #include "nfp_main.h" |
39 | #include "nfpcore/nfp.h" | 39 | #include "nfpcore/nfp.h" |
40 | #include "nfpcore/nfp_nffw.h" | 40 | #include "nfpcore/nfp_nffw.h" |
41 | #include "nfpcore/nfp6000/nfp6000.h" | ||
41 | 42 | ||
42 | #define NFP_DUMP_SPEC_RTSYM "_abi_dump_spec" | 43 | #define NFP_DUMP_SPEC_RTSYM "_abi_dump_spec" |
43 | 44 | ||
@@ -478,6 +479,12 @@ static int nfp_dump_hwinfo_field(struct nfp_pf *pf, struct nfp_dump_tl *spec, | |||
478 | return 0; | 479 | return 0; |
479 | } | 480 | } |
480 | 481 | ||
482 | static bool is_xpb_read(struct nfp_dumpspec_cpp_isl_id *cpp_id) | ||
483 | { | ||
484 | return cpp_id->target == NFP_CPP_TARGET_ISLAND_XPB && | ||
485 | cpp_id->action == 0 && cpp_id->token == 0; | ||
486 | } | ||
487 | |||
481 | static int | 488 | static int |
482 | nfp_dump_csr_range(struct nfp_pf *pf, struct nfp_dumpspec_csr *spec_csr, | 489 | nfp_dump_csr_range(struct nfp_pf *pf, struct nfp_dumpspec_csr *spec_csr, |
483 | struct nfp_dump_state *dump) | 490 | struct nfp_dump_state *dump) |
@@ -511,8 +518,12 @@ nfp_dump_csr_range(struct nfp_pf *pf, struct nfp_dumpspec_csr *spec_csr, | |||
511 | max_rd_addr = cpp_rd_addr + be32_to_cpu(spec_csr->cpp.dump_length); | 518 | max_rd_addr = cpp_rd_addr + be32_to_cpu(spec_csr->cpp.dump_length); |
512 | 519 | ||
513 | while (cpp_rd_addr < max_rd_addr) { | 520 | while (cpp_rd_addr < max_rd_addr) { |
514 | bytes_read = nfp_cpp_read(pf->cpp, cpp_id, cpp_rd_addr, dest, | 521 | if (is_xpb_read(&spec_csr->cpp.cpp_id)) |
515 | reg_sz); | 522 | bytes_read = nfp_xpb_readl(pf->cpp, cpp_rd_addr, |
523 | (u32 *)dest); | ||
524 | else | ||
525 | bytes_read = nfp_cpp_read(pf->cpp, cpp_id, cpp_rd_addr, | ||
526 | dest, reg_sz); | ||
516 | if (bytes_read != reg_sz) { | 527 | if (bytes_read != reg_sz) { |
517 | if (bytes_read >= 0) | 528 | if (bytes_read >= 0) |
518 | bytes_read = -EIO; | 529 | bytes_read = -EIO; |