]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
qtnfmac: wait for FW load work to finish at PCIe remove
authorIgor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Mon, 24 Sep 2018 22:15:13 +0000 (15:15 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 1 Oct 2018 15:40:30 +0000 (18:40 +0300)
Waiting for "completion" to be set in FW load thread can not be used
in case PCIe remove is called before FW load work was scheduled.
Just wait for work completion instead to avoid problems.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/quantenna/qtnfmac/bus.h
drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c

index 7c4f8568d940b4609e81601b38f7d53dd3acf381..528ca7f5e07074c8a09c14279435aa3431bdc203 100644 (file)
@@ -62,7 +62,6 @@ struct qtnf_bus {
        struct qtnf_hw_info hw_info;
        struct napi_struct mux_napi;
        struct net_device mux_dev;
-       struct completion firmware_init_complete;
        struct workqueue_struct *workqueue;
        struct work_struct fw_work;
        struct work_struct event_work;
index f83951cd0636e78430897a9e84b3fd9d1624b4b7..d1637f2354a649205246fd9eb00b4c0358251cef 100644 (file)
@@ -130,7 +130,6 @@ void qtnf_pcie_fw_boot_done(struct qtnf_bus *bus, bool boot_success,
                bus->fw_state = QTNF_FW_STATE_DETACHED;
        }
 
-       complete(&bus->firmware_init_complete);
        put_device(&pdev->dev);
 }
 
@@ -304,7 +303,6 @@ int qtnf_pcie_probe(struct pci_dev *pdev, size_t priv_size,
        pcie_priv->pdev = pdev;
        pcie_priv->tx_stopped = 0;
 
-       init_completion(&bus->firmware_init_complete);
        mutex_init(&bus->bus_lock);
        spin_lock_init(&pcie_priv->tx_lock);
        spin_lock_init(&pcie_priv->tx_reclaim_lock);
@@ -376,7 +374,7 @@ static void qtnf_pcie_free_shm_ipc(struct qtnf_pcie_bus_priv *priv)
 
 void qtnf_pcie_remove(struct qtnf_bus *bus, struct qtnf_pcie_bus_priv *priv)
 {
-       wait_for_completion(&bus->firmware_init_complete);
+       cancel_work_sync(&bus->fw_work);
 
        if (bus->fw_state == QTNF_FW_STATE_ACTIVE ||
            bus->fw_state == QTNF_FW_STATE_EP_DEAD)