pci.c (728e26c3ac89427de181c1e8400d27d7b6c3a8a5) | pci.c (87b4072d7ef818e368b0f4162a1af2fb4727f51c) |
---|---|
1// SPDX-License-Identifier: BSD-3-Clause-Clear 2/* 3 * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. 4 */ 5 6#include <linux/module.h> 7#include <linux/msi.h> 8#include <linux/pci.h> --- 919 unchanged lines hidden (view full) --- 928 return ret; 929} 930 931static void ath11k_pci_free_msi(struct ath11k_pci *ab_pci) 932{ 933 pci_free_irq_vectors(ab_pci->pdev); 934} 935 | 1// SPDX-License-Identifier: BSD-3-Clause-Clear 2/* 3 * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. 4 */ 5 6#include <linux/module.h> 7#include <linux/msi.h> 8#include <linux/pci.h> --- 919 unchanged lines hidden (view full) --- 928 return ret; 929} 930 931static void ath11k_pci_free_msi(struct ath11k_pci *ab_pci) 932{ 933 pci_free_irq_vectors(ab_pci->pdev); 934} 935 |
936static int ath11k_pci_config_msi_data(struct ath11k_pci *ab_pci) 937{ 938 struct msi_desc *msi_desc; 939 940 msi_desc = irq_get_msi_desc(ab_pci->pdev->irq); 941 if (!msi_desc) { 942 ath11k_err(ab_pci->ab, "msi_desc is NULL!\n"); 943 pci_free_irq_vectors(ab_pci->pdev); 944 return -EINVAL; 945 } 946 947 ab_pci->msi_ep_base_data = msi_desc->msg.data; 948 949 ath11k_dbg(ab_pci->ab, ATH11K_DBG_PCI, "pci after request_irq msi_ep_base_data %d\n", 950 ab_pci->msi_ep_base_data); 951 952 return 0; 953} 954 |
|
936static int ath11k_pci_claim(struct ath11k_pci *ab_pci, struct pci_dev *pdev) 937{ 938 struct ath11k_base *ab = ab_pci->ab; 939 u16 device_id; 940 int ret = 0; 941 942 pci_read_config_word(pdev, PCI_DEVICE_ID, &device_id); 943 if (device_id != ab_pci->dev_id) { --- 393 unchanged lines hidden (view full) --- 1337 ath11k_pci_init_qmi_ce_config(ab); 1338 1339 ret = ath11k_pci_config_irq(ab); 1340 if (ret) { 1341 ath11k_err(ab, "failed to config irq: %d\n", ret); 1342 goto err_ce_free; 1343 } 1344 | 955static int ath11k_pci_claim(struct ath11k_pci *ab_pci, struct pci_dev *pdev) 956{ 957 struct ath11k_base *ab = ab_pci->ab; 958 u16 device_id; 959 int ret = 0; 960 961 pci_read_config_word(pdev, PCI_DEVICE_ID, &device_id); 962 if (device_id != ab_pci->dev_id) { --- 393 unchanged lines hidden (view full) --- 1356 ath11k_pci_init_qmi_ce_config(ab); 1357 1358 ret = ath11k_pci_config_irq(ab); 1359 if (ret) { 1360 ath11k_err(ab, "failed to config irq: %d\n", ret); 1361 goto err_ce_free; 1362 } 1363 |
1364 /* kernel may allocate a dummy vector before request_irq and 1365 * then allocate a real vector when request_irq is called. 1366 * So get msi_data here again to avoid spurious interrupt 1367 * as msi_data will configured to srngs. 1368 */ 1369 ret = ath11k_pci_config_msi_data(ab_pci); 1370 if (ret) { 1371 ath11k_err(ab, "failed to config msi_data: %d\n", ret); 1372 goto err_free_irq; 1373 } 1374 |
|
1345 ret = ath11k_core_init(ab); 1346 if (ret) { 1347 ath11k_err(ab, "failed to init core: %d\n", ret); 1348 goto err_free_irq; 1349 } 1350 return 0; 1351 1352err_free_irq: --- 124 unchanged lines hidden --- | 1375 ret = ath11k_core_init(ab); 1376 if (ret) { 1377 ath11k_err(ab, "failed to init core: %d\n", ret); 1378 goto err_free_irq; 1379 } 1380 return 0; 1381 1382err_free_irq: --- 124 unchanged lines hidden --- |