93a9da8fc2e5da81398ef2b34194deaca767a1db
[openwrt/staging/blogic.git] /
1 From f117276638b7600b981b3fe28550823cfbe1ef23 Mon Sep 17 00:00:00 2001
2 From: Douglas Anderson <dianders@chromium.org>
3 Date: Wed, 1 Feb 2023 08:54:42 -0800
4 Subject: [PATCH] wifi: ath11k: Use platform_get_irq() to get the interrupt
5
6 As of commit a1a2b7125e10 ("of/platform: Drop static setup of IRQ
7 resource from DT core"), we need to use platform_get_irq() instead of
8 platform_get_resource() to get our IRQs because
9 platform_get_resource() simply won't get them anymore.
10
11 This was already fixed in several other Atheros WiFi drivers,
12 apparently in response to Zeal Robot reports. An example of another
13 fix is commit 9503a1fc123d ("ath9k: Use platform_get_irq() to get the
14 interrupt"). ath11k seems to have been missed in this effort, though.
15
16 Without this change, WiFi wasn't coming up on my Qualcomm sc7280-based
17 hardware. Specifically, "platform_get_resource(pdev, IORESOURCE_IRQ,
18 i)" was failing even for i=0.
19
20 Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
21
22 Fixes: a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core")
23 Fixes: 00402f49d26f ("ath11k: Add support for WCN6750 device")
24 Signed-off-by: Douglas Anderson <dianders@chromium.org>
25 Tested-by: Jun Yu <junyuu@chromium.org>
26 Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
27 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
28 Link: https://lore.kernel.org/r/20230201084131.v2.1.I69cf3d56c97098287fe3a70084ee515098390b70@changeid
29 ---
30 drivers/net/wireless/ath/ath11k/ahb.c | 8 ++++----
31 1 file changed, 4 insertions(+), 4 deletions(-)
32
33 --- a/drivers/net/wireless/ath/ath11k/ahb.c
34 +++ b/drivers/net/wireless/ath/ath11k/ahb.c
35 @@ -874,11 +874,11 @@ static int ath11k_ahb_setup_msi_resource
36 ab->pci.msi.ep_base_data = int_prop + 32;
37
38 for (i = 0; i < ab->pci.msi.config->total_vectors; i++) {
39 - res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
40 - if (!res)
41 - return -ENODEV;
42 + ret = platform_get_irq(pdev, i);
43 + if (ret < 0)
44 + return ret;
45
46 - ab->pci.msi.irqs[i] = res->start;
47 + ab->pci.msi.irqs[i] = ret;
48 }
49
50 set_bit(ATH11K_FLAG_MULTI_MSI_VECTORS, &ab->dev_flags);