Commit 867955f5682f7157fdafe8670804b9f8ea077bc7

Authored by Ben Hutchings
Committed by David S. Miller
1 parent 0e3d32c3a8

sfc: Fix oops in register dump after mapping change

Commit 747df2258b1b9a2e25929ef496262c339c380009 ('sfc: Always map MCDI
shared memory as uncacheable') introduced a separate mapping for the
MCDI shared memory (MC_TREG_SMEM).  This means we can no longer easily
include it in the register dump.  Since it is not particularly useful
in debugging, substitute a recognisable dummy value.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 7 additions and 0 deletions Side-by-side Diff

drivers/net/sfc/nic.c
... ... @@ -1937,6 +1937,13 @@
1937 1937  
1938 1938 size = min_t(size_t, table->step, 16);
1939 1939  
  1940 + if (table->offset >= efx->type->mem_map_size) {
  1941 + /* No longer mapped; return dummy data */
  1942 + memcpy(buf, "\xde\xc0\xad\xde", 4);
  1943 + buf += table->rows * size;
  1944 + continue;
  1945 + }
  1946 +
1940 1947 for (i = 0; i < table->rows; i++) {
1941 1948 switch (table->step) {
1942 1949 case 4: /* 32-bit register or SRAM */