aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/selftest.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2008-09-01 07:47:38 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-09-03 09:53:46 -0400
commit64ee3120f73b9e904d97ba66386b1e8e93b81385 (patch)
treed529e4e4597b654922a74130330c0c9e197037da /drivers/net/sfc/selftest.c
parent46123d043d4bab23aa0d22f33972ee52cfac7f68 (diff)
sfc: Remove efx_channel::has_interrupt
efx_channel::has_interrupt is redundant with efx_channel::used_flags. Remove efx_test_eventq() because it is now obviously unreachable. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/sfc/selftest.c')
-rw-r--r--drivers/net/sfc/selftest.c44
1 files changed, 3 insertions, 41 deletions
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c
index ff7b84c3fcfb..2f7def657679 100644
--- a/drivers/net/sfc/selftest.c
+++ b/drivers/net/sfc/selftest.c
@@ -111,7 +111,7 @@ static int efx_test_interrupts(struct efx_nic *efx,
111 111
112 /* ACK each interrupting event queue. Receiving an interrupt due to 112 /* ACK each interrupting event queue. Receiving an interrupt due to
113 * traffic before a test event is raised is considered a pass */ 113 * traffic before a test event is raised is considered a pass */
114 efx_for_each_channel_with_interrupt(channel, efx) { 114 efx_for_each_channel(channel, efx) {
115 if (channel->work_pending) 115 if (channel->work_pending)
116 efx_process_channel_now(channel); 116 efx_process_channel_now(channel);
117 if (efx->last_irq_cpu >= 0) 117 if (efx->last_irq_cpu >= 0)
@@ -136,41 +136,6 @@ static int efx_test_interrupts(struct efx_nic *efx,
136 return 0; 136 return 0;
137} 137}
138 138
139/* Test generation and receipt of non-interrupting events */
140static int efx_test_eventq(struct efx_channel *channel,
141 struct efx_self_tests *tests)
142{
143 unsigned int magic;
144
145 /* Channel specific code, limited to 20 bits */
146 magic = (0x00010150 + channel->channel);
147 EFX_LOG(channel->efx, "channel %d testing event queue with code %x\n",
148 channel->channel, magic);
149
150 tests->eventq_dma[channel->channel] = -1;
151 tests->eventq_int[channel->channel] = 1; /* fake pass */
152 tests->eventq_poll[channel->channel] = 1; /* fake pass */
153
154 /* Reset flag and zero magic word */
155 channel->efx->last_irq_cpu = -1;
156 channel->eventq_magic = 0;
157 smp_wmb();
158
159 falcon_generate_test_event(channel, magic);
160 udelay(1);
161
162 efx_process_channel_now(channel);
163 if (channel->eventq_magic != magic) {
164 EFX_ERR(channel->efx, "channel %d failed to see test event\n",
165 channel->channel);
166 return -ETIMEDOUT;
167 } else {
168 tests->eventq_dma[channel->channel] = 1;
169 }
170
171 return 0;
172}
173
174/* Test generation and receipt of interrupting events */ 139/* Test generation and receipt of interrupting events */
175static int efx_test_eventq_irq(struct efx_channel *channel, 140static int efx_test_eventq_irq(struct efx_channel *channel,
176 struct efx_self_tests *tests) 141 struct efx_self_tests *tests)
@@ -456,7 +421,7 @@ static int efx_poll_loopback(struct efx_nic *efx)
456 421
457 /* NAPI polling is not enabled, so process channels 422 /* NAPI polling is not enabled, so process channels
458 * synchronously */ 423 * synchronously */
459 efx_for_each_channel_with_interrupt(channel, efx) { 424 efx_for_each_channel(channel, efx) {
460 if (channel->work_pending) 425 if (channel->work_pending)
461 efx_process_channel_now(channel); 426 efx_process_channel_now(channel);
462 } 427 }
@@ -689,10 +654,7 @@ int efx_online_test(struct efx_nic *efx, struct efx_self_tests *tests)
689 if (rc) 654 if (rc)
690 return rc; 655 return rc;
691 efx_for_each_channel(channel, efx) { 656 efx_for_each_channel(channel, efx) {
692 if (channel->has_interrupt) 657 rc = efx_test_eventq_irq(channel, tests);
693 rc = efx_test_eventq_irq(channel, tests);
694 else
695 rc = efx_test_eventq(channel, tests);
696 if (rc) 658 if (rc)
697 return rc; 659 return rc;
698 } 660 }