Commit 9254b751 authored by Sritej Velaga's avatar Sritej Velaga Committed by David S. Miller

qlcnic: fix cdrp race condition

Reading CRB registers(if reqd) before releasing the api lock.
Signed-off-by: default avatarSritej Velaga <sritej.velaga@qlogic.com>
Signed-off-by: default avatarSony Chacko <sony.chacko@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a2050c7e
...@@ -1465,7 +1465,8 @@ int qlcnic_check_loopback_buff(unsigned char *data, u8 mac[]); ...@@ -1465,7 +1465,8 @@ int qlcnic_check_loopback_buff(unsigned char *data, u8 mac[]);
/* Functions from qlcnic_main.c */ /* Functions from qlcnic_main.c */
int qlcnic_reset_context(struct qlcnic_adapter *); int qlcnic_reset_context(struct qlcnic_adapter *);
u32 qlcnic_issue_cmd(struct qlcnic_adapter *adapter, u32 qlcnic_issue_cmd(struct qlcnic_adapter *adapter,
u32 pci_fn, u32 version, u32 arg1, u32 arg2, u32 arg3, u32 cmd); u32 pci_fn, u32 version, u32 arg1, u32 arg2, u32 arg3, u32 cmd,
u32 *rd_args[3]);
void qlcnic_diag_free_res(struct net_device *netdev, int max_sds_rings); void qlcnic_diag_free_res(struct net_device *netdev, int max_sds_rings);
int qlcnic_diag_alloc_res(struct net_device *netdev, int test); int qlcnic_diag_alloc_res(struct net_device *netdev, int test);
netdev_tx_t qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev); netdev_tx_t qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev);
......
...@@ -659,6 +659,7 @@ static int qlcnic_irq_test(struct net_device *netdev) ...@@ -659,6 +659,7 @@ static int qlcnic_irq_test(struct net_device *netdev)
struct qlcnic_adapter *adapter = netdev_priv(netdev); struct qlcnic_adapter *adapter = netdev_priv(netdev);
int max_sds_rings = adapter->max_sds_rings; int max_sds_rings = adapter->max_sds_rings;
int ret; int ret;
u32 *rd_args[3];
if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state))
return -EIO; return -EIO;
...@@ -668,9 +669,10 @@ static int qlcnic_irq_test(struct net_device *netdev) ...@@ -668,9 +669,10 @@ static int qlcnic_irq_test(struct net_device *netdev)
goto clear_it; goto clear_it;
adapter->diag_cnt = 0; adapter->diag_cnt = 0;
memset(rd_args, 0, sizeof(rd_args));
ret = qlcnic_issue_cmd(adapter, adapter->ahw->pci_func, ret = qlcnic_issue_cmd(adapter, adapter->ahw->pci_func,
adapter->fw_hal_version, adapter->ahw->pci_func, adapter->fw_hal_version, adapter->ahw->pci_func,
0, 0, 0x00000011); 0, 0, 0x00000011, rd_args);
if (ret) if (ret)
goto done; goto done;
......
...@@ -1889,8 +1889,8 @@ qlcnic_fetch_mac(struct qlcnic_adapter *adapter, u32 off1, u32 off2, ...@@ -1889,8 +1889,8 @@ qlcnic_fetch_mac(struct qlcnic_adapter *adapter, u32 off1, u32 off2,
u32 mac_low, mac_high; u32 mac_low, mac_high;
int i; int i;
mac_low = QLCRD32(adapter, off1); mac_low = off1;
mac_high = QLCRD32(adapter, off2); mac_high = off2;
if (alt_mac) { if (alt_mac) {
mac_low |= (mac_low >> 16) | (mac_high << 16); mac_low |= (mac_low >> 16) | (mac_high << 16);
......
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