Commit 7dd90cf1 authored by Sucheta Chakraborty's avatar Sucheta Chakraborty Committed by David S. Miller

qlcnic: fix mailbox interrupt.

o Config interrupt is not needed for mailbox interrupts.
Signed-off-by: default avatarSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: default avatarJitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 114ef38a
...@@ -497,8 +497,6 @@ int qlcnic_83xx_setup_mbx_intr(struct qlcnic_adapter *adapter) ...@@ -497,8 +497,6 @@ int qlcnic_83xx_setup_mbx_intr(struct qlcnic_adapter *adapter)
/* Enable mailbox interrupt */ /* Enable mailbox interrupt */
qlcnic_83xx_enable_mbx_intrpt(adapter); qlcnic_83xx_enable_mbx_intrpt(adapter);
if (adapter->flags & QLCNIC_MSIX_ENABLED)
err = qlcnic_83xx_config_intrpt(adapter, 1);
return err; return err;
} }
...@@ -1915,7 +1913,7 @@ int qlcnic_83xx_config_intrpt(struct qlcnic_adapter *adapter, bool op_type) ...@@ -1915,7 +1913,7 @@ int qlcnic_83xx_config_intrpt(struct qlcnic_adapter *adapter, bool op_type)
u32 val, temp; u32 val, temp;
struct qlcnic_cmd_args cmd; struct qlcnic_cmd_args cmd;
max_ints = adapter->ahw->num_msix; max_ints = adapter->ahw->num_msix - 1;
qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_CONFIG_INTRPT); qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_CONFIG_INTRPT);
cmd.req.arg[1] = max_ints; cmd.req.arg[1] = max_ints;
for (i = 0, index = 2; i < max_ints; i++) { for (i = 0, index = 2; i < max_ints; i++) {
......
...@@ -599,9 +599,17 @@ int qlcnic_fw_create_ctx(struct qlcnic_adapter *dev) ...@@ -599,9 +599,17 @@ int qlcnic_fw_create_ctx(struct qlcnic_adapter *dev)
dev->flags &= ~QLCNIC_NEED_FLR; dev->flags &= ~QLCNIC_NEED_FLR;
} }
err = qlcnic_fw_cmd_create_rx_ctx(dev); if (qlcnic_83xx_check(dev) && (dev->flags & QLCNIC_MSIX_ENABLED)) {
if (dev->ahw->diag_test != QLCNIC_LOOPBACK_TEST) {
err = qlcnic_83xx_config_intrpt(dev, 1);
if (err) if (err)
return err; return err;
}
}
err = qlcnic_fw_cmd_create_rx_ctx(dev);
if (err)
goto err_out;
for (ring = 0; ring < dev->max_drv_tx_rings; ring++) { for (ring = 0; ring < dev->max_drv_tx_rings; ring++) {
err = qlcnic_fw_cmd_create_tx_ctx(dev, err = qlcnic_fw_cmd_create_tx_ctx(dev,
...@@ -610,18 +618,25 @@ int qlcnic_fw_create_ctx(struct qlcnic_adapter *dev) ...@@ -610,18 +618,25 @@ int qlcnic_fw_create_ctx(struct qlcnic_adapter *dev)
if (err) { if (err) {
qlcnic_fw_cmd_destroy_rx_ctx(dev); qlcnic_fw_cmd_destroy_rx_ctx(dev);
if (ring == 0) if (ring == 0)
return err; goto err_out;
for (i = 0; i < ring; i++) for (i = 0; i < ring; i++)
qlcnic_fw_cmd_destroy_tx_ctx(dev, qlcnic_fw_cmd_destroy_tx_ctx(dev,
&dev->tx_ring[i]); &dev->tx_ring[i]);
return err; goto err_out;
} }
} }
set_bit(__QLCNIC_FW_ATTACHED, &dev->state); set_bit(__QLCNIC_FW_ATTACHED, &dev->state);
return 0; return 0;
err_out:
if (qlcnic_83xx_check(dev) && (dev->flags & QLCNIC_MSIX_ENABLED)) {
if (dev->ahw->diag_test != QLCNIC_LOOPBACK_TEST)
qlcnic_83xx_config_intrpt(dev, 0);
}
return err;
} }
void qlcnic_fw_destroy_ctx(struct qlcnic_adapter *adapter) void qlcnic_fw_destroy_ctx(struct qlcnic_adapter *adapter)
...@@ -633,6 +648,12 @@ void qlcnic_fw_destroy_ctx(struct qlcnic_adapter *adapter) ...@@ -633,6 +648,12 @@ void qlcnic_fw_destroy_ctx(struct qlcnic_adapter *adapter)
for (ring = 0; ring < adapter->max_drv_tx_rings; ring++) for (ring = 0; ring < adapter->max_drv_tx_rings; ring++)
qlcnic_fw_cmd_destroy_tx_ctx(adapter, qlcnic_fw_cmd_destroy_tx_ctx(adapter,
&adapter->tx_ring[ring]); &adapter->tx_ring[ring]);
if (qlcnic_83xx_check(adapter) &&
(adapter->flags & QLCNIC_MSIX_ENABLED)) {
if (adapter->ahw->diag_test != QLCNIC_LOOPBACK_TEST)
qlcnic_83xx_config_intrpt(adapter, 0);
}
/* Allow dma queues to drain after context reset */ /* Allow dma queues to drain after context reset */
mdelay(20); mdelay(20);
} }
......
...@@ -1965,11 +1965,8 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1965,11 +1965,8 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
return 0; return 0;
err_out_disable_mbx_intr: err_out_disable_mbx_intr:
if (qlcnic_83xx_check(adapter)) { if (qlcnic_83xx_check(adapter))
if (adapter->flags & QLCNIC_MSIX_ENABLED)
qlcnic_83xx_config_intrpt(adapter, 0);
qlcnic_83xx_free_mbx_intr(adapter); qlcnic_83xx_free_mbx_intr(adapter);
}
err_out_disable_msi: err_out_disable_msi:
qlcnic_teardown_intr(adapter); qlcnic_teardown_intr(adapter);
...@@ -2015,8 +2012,6 @@ static void qlcnic_remove(struct pci_dev *pdev) ...@@ -2015,8 +2012,6 @@ static void qlcnic_remove(struct pci_dev *pdev)
unregister_netdev(netdev); unregister_netdev(netdev);
if (qlcnic_83xx_check(adapter)) { if (qlcnic_83xx_check(adapter)) {
if (adapter->flags & QLCNIC_MSIX_ENABLED)
qlcnic_83xx_config_intrpt(adapter, 0);
qlcnic_83xx_free_mbx_intr(adapter); qlcnic_83xx_free_mbx_intr(adapter);
qlcnic_83xx_register_nic_idc_func(adapter, 0); qlcnic_83xx_register_nic_idc_func(adapter, 0);
cancel_delayed_work_sync(&adapter->idc_aen_work); cancel_delayed_work_sync(&adapter->idc_aen_work);
...@@ -3107,8 +3102,6 @@ static pci_ers_result_t qlcnic_io_error_detected(struct pci_dev *pdev, ...@@ -3107,8 +3102,6 @@ static pci_ers_result_t qlcnic_io_error_detected(struct pci_dev *pdev,
qlcnic_down(adapter, netdev); qlcnic_down(adapter, netdev);
if (qlcnic_83xx_check(adapter)) { if (qlcnic_83xx_check(adapter)) {
if (adapter->flags & QLCNIC_MSIX_ENABLED)
qlcnic_83xx_config_intrpt(adapter, 0);
qlcnic_83xx_free_mbx_intr(adapter); qlcnic_83xx_free_mbx_intr(adapter);
qlcnic_83xx_register_nic_idc_func(adapter, 0); qlcnic_83xx_register_nic_idc_func(adapter, 0);
cancel_delayed_work_sync(&adapter->idc_aen_work); cancel_delayed_work_sync(&adapter->idc_aen_work);
...@@ -3203,13 +3196,11 @@ int qlcnic_set_max_rss(struct qlcnic_adapter *adapter, u8 data, size_t len) ...@@ -3203,13 +3196,11 @@ int qlcnic_set_max_rss(struct qlcnic_adapter *adapter, u8 data, size_t len)
if (netif_running(netdev)) if (netif_running(netdev))
__qlcnic_down(adapter, netdev); __qlcnic_down(adapter, netdev);
if (qlcnic_83xx_check(adapter)) { qlcnic_detach(adapter);
if (adapter->flags & QLCNIC_MSIX_ENABLED)
qlcnic_83xx_config_intrpt(adapter, 0); if (qlcnic_83xx_check(adapter))
qlcnic_83xx_free_mbx_intr(adapter); qlcnic_83xx_free_mbx_intr(adapter);
}
qlcnic_detach(adapter);
qlcnic_teardown_intr(adapter); qlcnic_teardown_intr(adapter);
err = qlcnic_setup_intr(adapter, data); err = qlcnic_setup_intr(adapter, data);
if (err) { if (err) {
......
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