]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
sfc: Fix oops in register dump after mapping change
authorBen Hutchings <bhutchings@solarflare.com>
Mon, 16 May 2011 06:13:49 +0000 (06:13 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 May 2011 19:05:23 +0000 (15:05 -0400)
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>
drivers/net/sfc/nic.c

index 10f1cb79c1472cfb91f9a50f16f827248bd00c96..9b29a8d7c449d56d7fd838dd1204435165d2fbda 100644 (file)
@@ -1937,6 +1937,13 @@ void efx_nic_get_regs(struct efx_nic *efx, void *buf)
 
                size = min_t(size_t, table->step, 16);
 
+               if (table->offset >= efx->type->mem_map_size) {
+                       /* No longer mapped; return dummy data */
+                       memcpy(buf, "\xde\xc0\xad\xde", 4);
+                       buf += table->rows * size;
+                       continue;
+               }
+
                for (i = 0; i < table->rows; i++) {
                        switch (table->step) {
                        case 4: /* 32-bit register or SRAM */