Commit 070eca95 authored by Thomas Falcon's avatar Thomas Falcon Committed by David S. Miller

ibmvnic: Fix completion structure initialization

Fix multiple calls to init_completion for device completion
structures. Instead, initialize them during device probe and
reinitialize them later as needed.
Signed-off-by: default avatarThomas Falcon <tlfalcon@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fb822388
...@@ -176,7 +176,7 @@ static int alloc_long_term_buff(struct ibmvnic_adapter *adapter, ...@@ -176,7 +176,7 @@ static int alloc_long_term_buff(struct ibmvnic_adapter *adapter,
ltb->map_id = adapter->map_id; ltb->map_id = adapter->map_id;
adapter->map_id++; adapter->map_id++;
init_completion(&adapter->fw_done); reinit_completion(&adapter->fw_done);
rc = send_request_map(adapter, ltb->addr, rc = send_request_map(adapter, ltb->addr,
ltb->size, ltb->map_id); ltb->size, ltb->map_id);
if (rc) { if (rc) {
...@@ -215,7 +215,7 @@ static int reset_long_term_buff(struct ibmvnic_adapter *adapter, ...@@ -215,7 +215,7 @@ static int reset_long_term_buff(struct ibmvnic_adapter *adapter,
memset(ltb->buff, 0, ltb->size); memset(ltb->buff, 0, ltb->size);
init_completion(&adapter->fw_done); reinit_completion(&adapter->fw_done);
rc = send_request_map(adapter, ltb->addr, ltb->size, ltb->map_id); rc = send_request_map(adapter, ltb->addr, ltb->size, ltb->map_id);
if (rc) if (rc)
return rc; return rc;
...@@ -943,7 +943,7 @@ static int ibmvnic_get_vpd(struct ibmvnic_adapter *adapter) ...@@ -943,7 +943,7 @@ static int ibmvnic_get_vpd(struct ibmvnic_adapter *adapter)
if (adapter->vpd->buff) if (adapter->vpd->buff)
len = adapter->vpd->len; len = adapter->vpd->len;
init_completion(&adapter->fw_done); reinit_completion(&adapter->fw_done);
crq.get_vpd_size.first = IBMVNIC_CRQ_CMD; crq.get_vpd_size.first = IBMVNIC_CRQ_CMD;
crq.get_vpd_size.cmd = GET_VPD_SIZE; crq.get_vpd_size.cmd = GET_VPD_SIZE;
rc = ibmvnic_send_crq(adapter, &crq); rc = ibmvnic_send_crq(adapter, &crq);
...@@ -1689,7 +1689,7 @@ static int __ibmvnic_set_mac(struct net_device *netdev, u8 *dev_addr) ...@@ -1689,7 +1689,7 @@ static int __ibmvnic_set_mac(struct net_device *netdev, u8 *dev_addr)
crq.change_mac_addr.cmd = CHANGE_MAC_ADDR; crq.change_mac_addr.cmd = CHANGE_MAC_ADDR;
ether_addr_copy(&crq.change_mac_addr.mac_addr[0], dev_addr); ether_addr_copy(&crq.change_mac_addr.mac_addr[0], dev_addr);
init_completion(&adapter->fw_done); reinit_completion(&adapter->fw_done);
rc = ibmvnic_send_crq(adapter, &crq); rc = ibmvnic_send_crq(adapter, &crq);
if (rc) { if (rc) {
rc = -EIO; rc = -EIO;
...@@ -2316,7 +2316,7 @@ static int wait_for_reset(struct ibmvnic_adapter *adapter) ...@@ -2316,7 +2316,7 @@ static int wait_for_reset(struct ibmvnic_adapter *adapter)
adapter->fallback.rx_entries = adapter->req_rx_add_entries_per_subcrq; adapter->fallback.rx_entries = adapter->req_rx_add_entries_per_subcrq;
adapter->fallback.tx_entries = adapter->req_tx_entries_per_subcrq; adapter->fallback.tx_entries = adapter->req_tx_entries_per_subcrq;
init_completion(&adapter->reset_done); reinit_completion(&adapter->reset_done);
adapter->wait_for_reset = true; adapter->wait_for_reset = true;
rc = ibmvnic_reset(adapter, VNIC_RESET_CHANGE_PARAM); rc = ibmvnic_reset(adapter, VNIC_RESET_CHANGE_PARAM);
if (rc) if (rc)
...@@ -2332,7 +2332,7 @@ static int wait_for_reset(struct ibmvnic_adapter *adapter) ...@@ -2332,7 +2332,7 @@ static int wait_for_reset(struct ibmvnic_adapter *adapter)
adapter->desired.rx_entries = adapter->fallback.rx_entries; adapter->desired.rx_entries = adapter->fallback.rx_entries;
adapter->desired.tx_entries = adapter->fallback.tx_entries; adapter->desired.tx_entries = adapter->fallback.tx_entries;
init_completion(&adapter->reset_done); reinit_completion(&adapter->reset_done);
adapter->wait_for_reset = true; adapter->wait_for_reset = true;
rc = ibmvnic_reset(adapter, VNIC_RESET_CHANGE_PARAM); rc = ibmvnic_reset(adapter, VNIC_RESET_CHANGE_PARAM);
if (rc) if (rc)
...@@ -2603,7 +2603,7 @@ static void ibmvnic_get_ethtool_stats(struct net_device *dev, ...@@ -2603,7 +2603,7 @@ static void ibmvnic_get_ethtool_stats(struct net_device *dev,
cpu_to_be32(sizeof(struct ibmvnic_statistics)); cpu_to_be32(sizeof(struct ibmvnic_statistics));
/* Wait for data to be written */ /* Wait for data to be written */
init_completion(&adapter->stats_done); reinit_completion(&adapter->stats_done);
rc = ibmvnic_send_crq(adapter, &crq); rc = ibmvnic_send_crq(adapter, &crq);
if (rc) if (rc)
return; return;
...@@ -4408,7 +4408,7 @@ static int send_query_phys_parms(struct ibmvnic_adapter *adapter) ...@@ -4408,7 +4408,7 @@ static int send_query_phys_parms(struct ibmvnic_adapter *adapter)
memset(&crq, 0, sizeof(crq)); memset(&crq, 0, sizeof(crq));
crq.query_phys_parms.first = IBMVNIC_CRQ_CMD; crq.query_phys_parms.first = IBMVNIC_CRQ_CMD;
crq.query_phys_parms.cmd = QUERY_PHYS_PARMS; crq.query_phys_parms.cmd = QUERY_PHYS_PARMS;
init_completion(&adapter->fw_done); reinit_completion(&adapter->fw_done);
rc = ibmvnic_send_crq(adapter, &crq); rc = ibmvnic_send_crq(adapter, &crq);
if (rc) if (rc)
return rc; return rc;
...@@ -4960,6 +4960,9 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id) ...@@ -4960,6 +4960,9 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id)
INIT_LIST_HEAD(&adapter->rwi_list); INIT_LIST_HEAD(&adapter->rwi_list);
spin_lock_init(&adapter->rwi_lock); spin_lock_init(&adapter->rwi_lock);
init_completion(&adapter->init_done); init_completion(&adapter->init_done);
init_completion(&adapter->fw_done);
init_completion(&adapter->reset_done);
init_completion(&adapter->stats_done);
clear_bit(0, &adapter->resetting); clear_bit(0, &adapter->resetting);
do { do {
......
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