Skip to content

Commit cc80923

Browse files
Govindarajulu Varadarajandavem330
authored andcommitted
enic: handle spurious error interrupt
Some of the enic adaptors are know to generate spurious interrupts. When error interrupt is generated, driver just resets the device. This patch resets the device only when an error is occurred. Signed-off-by: Govindarajulu Varadarajan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2905f5b commit cc80923

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

drivers/net/ethernet/cisco/enic/enic_main.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,24 +178,29 @@ static int enic_wq_service(struct vnic_dev *vdev, struct cq_desc *cq_desc,
178178
return 0;
179179
}
180180

181-
static void enic_log_q_error(struct enic *enic)
181+
static bool enic_log_q_error(struct enic *enic)
182182
{
183183
unsigned int i;
184184
u32 error_status;
185+
bool err = false;
185186

186187
for (i = 0; i < enic->wq_count; i++) {
187188
error_status = vnic_wq_error_status(&enic->wq[i]);
189+
err |= error_status;
188190
if (error_status)
189191
netdev_err(enic->netdev, "WQ[%d] error_status %d\n",
190192
i, error_status);
191193
}
192194

193195
for (i = 0; i < enic->rq_count; i++) {
194196
error_status = vnic_rq_error_status(&enic->rq[i]);
197+
err |= error_status;
195198
if (error_status)
196199
netdev_err(enic->netdev, "RQ[%d] error_status %d\n",
197200
i, error_status);
198201
}
202+
203+
return err;
199204
}
200205

201206
static void enic_msglvl_check(struct enic *enic)
@@ -333,10 +338,9 @@ static irqreturn_t enic_isr_msix_err(int irq, void *data)
333338

334339
vnic_intr_return_all_credits(&enic->intr[intr]);
335340

336-
enic_log_q_error(enic);
337-
338-
/* schedule recovery from WQ/RQ error */
339-
schedule_work(&enic->reset);
341+
if (enic_log_q_error(enic))
342+
/* schedule recovery from WQ/RQ error */
343+
schedule_work(&enic->reset);
340344

341345
return IRQ_HANDLED;
342346
}

0 commit comments

Comments
 (0)