]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ath11k: implement ath11k_core_pre_init()
authorKalle Valo <kvalo@codeaurora.org>
Thu, 13 Aug 2020 09:04:23 +0000 (12:04 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 17 Aug 2020 10:07:09 +0000 (13:07 +0300)
This is needed to initialise hw_params before MHI registration starts. MHI
needs location of firmware directory and that's delivered via hw_params.

Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2

Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1597309466-19688-8-git-send-email-kvalo@codeaurora.org
drivers/net/wireless/ath/ath11k/ahb.c
drivers/net/wireless/ath/ath11k/core.c
drivers/net/wireless/ath/ath11k/core.h
drivers/net/wireless/ath/ath11k/pci.c

index 042019de0a8133c1fa4493dd09df1eb8c5ae7d07..f4c346bcc67640e82895a2f9cfcd56c883c56991 100644 (file)
@@ -868,6 +868,10 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
        ab->mem_len = resource_size(mem_res);
        platform_set_drvdata(pdev, ab);
 
+       ret = ath11k_core_pre_init(ab);
+       if (ret)
+               goto err_core_free;
+
        ret = ath11k_hal_srng_init(ab);
        if (ret)
                goto err_core_free;
index 2dfbe4276514e38da08bb87ec43ce8724777097e..5c84995baaf9182d9a431252f98a42a46dfb3fff 100644 (file)
@@ -742,6 +742,20 @@ static int ath11k_init_hw_params(struct ath11k_base *ab)
        return 0;
 }
 
+int ath11k_core_pre_init(struct ath11k_base *ab)
+{
+       int ret;
+
+       ret = ath11k_init_hw_params(ab);
+       if (ret) {
+               ath11k_err(ab, "failed to get hw params: %d\n", ret);
+               return ret;
+       }
+
+       return 0;
+}
+EXPORT_SYMBOL(ath11k_core_pre_init);
+
 int ath11k_core_init(struct ath11k_base *ab)
 {
        struct device *dev = ab->dev;
@@ -761,12 +775,6 @@ int ath11k_core_init(struct ath11k_base *ab)
        }
        ab->tgt_rproc = prproc;
 
-       ret = ath11k_init_hw_params(ab);
-       if (ret) {
-               ath11k_err(ab, "failed to get hw params %d\n", ret);
-               return ret;
-       }
-
        ret = ath11k_core_soc_create(ab);
        if (ret) {
                ath11k_err(ab, "failed to create soc core: %d\n", ret);
index ca97ccf250a40e264f4713f5df2cd90725bb85d8..a0a7c7b003c194912b3bdd246977c8b4e9a931b6 100644 (file)
@@ -841,6 +841,7 @@ struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab,
                                             const u8 *addr);
 struct ath11k_peer *ath11k_peer_find_by_id(struct ath11k_base *ab, int peer_id);
 int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab);
+int ath11k_core_pre_init(struct ath11k_base *ab);
 int ath11k_core_init(struct ath11k_base *ath11k);
 void ath11k_core_deinit(struct ath11k_base *ath11k);
 struct ath11k_base *ath11k_core_alloc(struct device *dev, size_t priv_size,
index 5ebbdbde81ef4a22ba9a645aadf0951deef67055..ff401d2871f3ee1dcf5ec36570b2aae543edaf36 100644 (file)
@@ -208,8 +208,15 @@ static int ath11k_pci_probe(struct pci_dev *pdev,
                goto err_pci_free_region;
        }
 
+       ret = ath11k_core_pre_init(ab);
+       if (ret)
+               goto err_pci_disable_msi;
+
        return 0;
 
+err_pci_disable_msi:
+       ath11k_pci_disable_msi(ab_pci);
+
 err_pci_free_region:
        ath11k_pci_free_region(ab_pci);