* [PATCH net-2.6] sfc: Fix oops in register dump after mapping change
@ 2011-05-16 16:13 Ben Hutchings
2011-05-16 19:05 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Ben Hutchings @ 2011-05-16 16:13 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-net-drivers
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>
---
'ethtool -d' on a Siena controller will now result in an 'oops'. This
is not a huge problem because I suspect I'm the only one actually
actually using this feature. The patch is against net-2.6 because the
above commit has not yet been merged into net-next-2.6, but I don't
particularly mind if this misses 2.6.39.
Ben.
drivers/net/sfc/nic.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/net/sfc/nic.c b/drivers/net/sfc/nic.c
index 10f1cb7..9b29a8d 100644
--- a/drivers/net/sfc/nic.c
+++ b/drivers/net/sfc/nic.c
@@ -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 */
--
1.7.4
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-2.6] sfc: Fix oops in register dump after mapping change
2011-05-16 16:13 [PATCH net-2.6] sfc: Fix oops in register dump after mapping change Ben Hutchings
@ 2011-05-16 19:05 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-05-16 19:05 UTC (permalink / raw)
To: bhutchings; +Cc: netdev, linux-net-drivers
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Mon, 16 May 2011 17:13:49 +0100
> 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>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-16 19:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-16 16:13 [PATCH net-2.6] sfc: Fix oops in register dump after mapping change Ben Hutchings
2011-05-16 19:05 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.