mac80211: ath11k: sync with upstream
[openwrt/staging/pepe2k.git] / package / kernel / mac80211 / patches / ath11k / 0089-wifi-ath11k-Add-missing-hw_ops-get_ring_selector-for.patch
1 From ce282d8de71f07f0056ea319541141152c65f552 Mon Sep 17 00:00:00 2001
2 From: Ziyang Huang <hzyitc@outlook.com>
3 Date: Thu, 15 Jun 2023 14:41:48 +0300
4 Subject: [PATCH] wifi: ath11k: Add missing hw_ops->get_ring_selector() for
5 IPQ5018
6
7 During sending data after clients connected, hw_ops->get_ring_selector()
8 will be called. But for IPQ5018, this member isn't set, and the
9 following NULL pointer exception will be occurred:
10
11 [ 38.840478] 8<--- cut here ---
12 [ 38.840517] Unable to handle kernel NULL pointer dereference at virtual address 00000000
13 ...
14 [ 38.923161] PC is at 0x0
15 [ 38.927930] LR is at ath11k_dp_tx+0x70/0x730 [ath11k]
16 ...
17 [ 39.063264] Process hostapd (pid: 1034, stack limit = 0x801ceb3d)
18 [ 39.068994] Stack: (0x856a9a68 to 0x856aa000)
19 ...
20 [ 39.438467] [<7f323804>] (ath11k_dp_tx [ath11k]) from [<7f314e6c>] (ath11k_mac_op_tx+0x80/0x190 [ath11k])
21 [ 39.446607] [<7f314e6c>] (ath11k_mac_op_tx [ath11k]) from [<7f17dbe0>] (ieee80211_handle_wake_tx_queue+0x7c/0xc0 [mac80211])
22 [ 39.456162] [<7f17dbe0>] (ieee80211_handle_wake_tx_queue [mac80211]) from [<7f174450>] (ieee80211_probereq_get+0x584/0x704 [mac80211])
23 [ 39.467443] [<7f174450>] (ieee80211_probereq_get [mac80211]) from [<7f178c40>] (ieee80211_tx_prepare_skb+0x1f8/0x248 [mac80211])
24 [ 39.479334] [<7f178c40>] (ieee80211_tx_prepare_skb [mac80211]) from [<7f179e28>] (__ieee80211_subif_start_xmit+0x32c/0x3d4 [mac80211])
25 [ 39.491053] [<7f179e28>] (__ieee80211_subif_start_xmit [mac80211]) from [<7f17af08>] (ieee80211_tx_control_port+0x19c/0x288 [mac80211])
26 [ 39.502946] [<7f17af08>] (ieee80211_tx_control_port [mac80211]) from [<7f0fc704>] (nl80211_tx_control_port+0x174/0x1d4 [cfg80211])
27 [ 39.515017] [<7f0fc704>] (nl80211_tx_control_port [cfg80211]) from [<808ceac4>] (genl_rcv_msg+0x154/0x340)
28 [ 39.526814] [<808ceac4>] (genl_rcv_msg) from [<808cdb74>] (netlink_rcv_skb+0xb8/0x11c)
29 [ 39.536446] [<808cdb74>] (netlink_rcv_skb) from [<808ce1d0>] (genl_rcv+0x28/0x34)
30 [ 39.544344] [<808ce1d0>] (genl_rcv) from [<808cd234>] (netlink_unicast+0x174/0x274)
31 [ 39.551895] [<808cd234>] (netlink_unicast) from [<808cd510>] (netlink_sendmsg+0x1dc/0x440)
32 [ 39.559362] [<808cd510>] (netlink_sendmsg) from [<808596e0>] (____sys_sendmsg+0x1a8/0x1fc)
33 [ 39.567697] [<808596e0>] (____sys_sendmsg) from [<8085b1a8>] (___sys_sendmsg+0xa4/0xdc)
34 [ 39.575941] [<8085b1a8>] (___sys_sendmsg) from [<8085b310>] (sys_sendmsg+0x44/0x74)
35 [ 39.583841] [<8085b310>] (sys_sendmsg) from [<80300060>] (ret_fast_syscall+0x0/0x40)
36 ...
37 [ 39.620734] Code: bad PC value
38 [ 39.625869] ---[ end trace 8aef983ad3cbc032 ]---
39
40 Fixes: ba60f2793d3a ("wifi: ath11k: initialize hw_ops for IPQ5018")
41 Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
42 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
43 Link: https://lore.kernel.org/r/TYZPR01MB5556D6E3F63EAB5129D11420C953A@TYZPR01MB5556.apcprd01.prod.exchangelabs.com
44 ---
45 drivers/net/wireless/ath/ath11k/hw.c | 2 +-
46 1 file changed, 1 insertion(+), 1 deletion(-)
47
48 --- a/drivers/net/wireless/ath/ath11k/hw.c
49 +++ b/drivers/net/wireless/ath/ath11k/hw.c
50 @@ -1178,7 +1178,7 @@ const struct ath11k_hw_ops ipq5018_ops =
51 .mpdu_info_get_peerid = ath11k_hw_ipq8074_mpdu_info_get_peerid,
52 .rx_desc_mac_addr2_valid = ath11k_hw_ipq9074_rx_desc_mac_addr2_valid,
53 .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq9074_rx_desc_mpdu_start_addr2,
54 -
55 + .get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector,
56 };
57
58 #define ATH11K_TX_RING_MASK_0 BIT(0)