Commit e49df794 authored by Manish chopra's avatar Manish chopra Committed by David S. Miller

qlcnic: Fix mailbox processing during diagnostic test

o Do not enable mailbox polling in case of legacy interrupt.
  Process mailbox AEN/response from the interrupt.
Signed-off-by: default avatarManish Chopra <manish.chopra@qlogic.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 30fa15f6
...@@ -447,7 +447,8 @@ irqreturn_t qlcnic_83xx_intr(int irq, void *data) ...@@ -447,7 +447,8 @@ irqreturn_t qlcnic_83xx_intr(int irq, void *data)
qlcnic_83xx_poll_process_aen(adapter); qlcnic_83xx_poll_process_aen(adapter);
if (ahw->diag_test == QLCNIC_INTERRUPT_TEST) { if (ahw->diag_test) {
if (ahw->diag_test == QLCNIC_INTERRUPT_TEST)
ahw->diag_cnt++; ahw->diag_cnt++;
qlcnic_83xx_enable_legacy_msix_mbx_intr(adapter); qlcnic_83xx_enable_legacy_msix_mbx_intr(adapter);
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -1345,11 +1346,6 @@ static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test, ...@@ -1345,11 +1346,6 @@ static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test,
} }
if (adapter->ahw->diag_test == QLCNIC_LOOPBACK_TEST) { if (adapter->ahw->diag_test == QLCNIC_LOOPBACK_TEST) {
/* disable and free mailbox interrupt */
if (!(adapter->flags & QLCNIC_MSIX_ENABLED)) {
qlcnic_83xx_enable_mbx_poll(adapter);
qlcnic_83xx_free_mbx_intr(adapter);
}
adapter->ahw->loopback_state = 0; adapter->ahw->loopback_state = 0;
adapter->ahw->hw_ops->setup_link_event(adapter, 1); adapter->ahw->hw_ops->setup_link_event(adapter, 1);
} }
...@@ -1363,33 +1359,20 @@ static void qlcnic_83xx_diag_free_res(struct net_device *netdev, ...@@ -1363,33 +1359,20 @@ static void qlcnic_83xx_diag_free_res(struct net_device *netdev,
{ {
struct qlcnic_adapter *adapter = netdev_priv(netdev); struct qlcnic_adapter *adapter = netdev_priv(netdev);
struct qlcnic_host_sds_ring *sds_ring; struct qlcnic_host_sds_ring *sds_ring;
int ring, err; int ring;
clear_bit(__QLCNIC_DEV_UP, &adapter->state); clear_bit(__QLCNIC_DEV_UP, &adapter->state);
if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) {
for (ring = 0; ring < adapter->drv_sds_rings; ring++) { for (ring = 0; ring < adapter->drv_sds_rings; ring++) {
sds_ring = &adapter->recv_ctx->sds_rings[ring]; sds_ring = &adapter->recv_ctx->sds_rings[ring];
if (adapter->flags & QLCNIC_MSIX_ENABLED)
qlcnic_83xx_disable_intr(adapter, sds_ring); qlcnic_83xx_disable_intr(adapter, sds_ring);
if (!(adapter->flags & QLCNIC_MSIX_ENABLED))
qlcnic_83xx_enable_mbx_poll(adapter);
} }
} }
qlcnic_fw_destroy_ctx(adapter); qlcnic_fw_destroy_ctx(adapter);
qlcnic_detach(adapter); qlcnic_detach(adapter);
if (adapter->ahw->diag_test == QLCNIC_LOOPBACK_TEST) {
if (!(adapter->flags & QLCNIC_MSIX_ENABLED)) {
err = qlcnic_83xx_setup_mbx_intr(adapter);
qlcnic_83xx_disable_mbx_poll(adapter);
if (err) {
dev_err(&adapter->pdev->dev,
"%s: failed to setup mbx interrupt\n",
__func__);
goto out;
}
}
}
adapter->ahw->diag_test = 0; adapter->ahw->diag_test = 0;
adapter->drv_sds_rings = drv_sds_rings; adapter->drv_sds_rings = drv_sds_rings;
...@@ -1399,9 +1382,6 @@ static void qlcnic_83xx_diag_free_res(struct net_device *netdev, ...@@ -1399,9 +1382,6 @@ static void qlcnic_83xx_diag_free_res(struct net_device *netdev,
if (netif_running(netdev)) if (netif_running(netdev))
__qlcnic_up(adapter, netdev); __qlcnic_up(adapter, netdev);
if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST &&
!(adapter->flags & QLCNIC_MSIX_ENABLED))
qlcnic_83xx_disable_mbx_poll(adapter);
out: out:
netif_device_attach(netdev); netif_device_attach(netdev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment