[kvalo-ath:ath12k-bringup 49/53] drivers/net/wireless/ath/ath12k/dp_mon.c:2140:18: warning: variable 'rx_buf_sz' is uninitialized when used here
From: kernel test robot
Date: Wed Jun 22 2022 - 01:25:42 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath12k-bringup
head: cc108fac9c287f5624daedca923743587adcafd1
commit: caa2f39cd59ba34be73e788ca2f6d8ed45de980f [49/53] ath12k: remove debugfs support
config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20220622/202206221338.iV0Co3Bt-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project af6d2a0b6825e71965f3e2701a63c239fa0ad70f)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?id=caa2f39cd59ba34be73e788ca2f6d8ed45de980f
git remote add kvalo-ath https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
git fetch --no-tags kvalo-ath ath12k-bringup
git checkout caa2f39cd59ba34be73e788ca2f6d8ed45de980f
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/net/ drivers/pci/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
drivers/net/wireless/ath/ath12k/dp_mon.c:884:13: warning: variable 'pkt_type' set but not used [-Wunused-but-set-variable]
static u32 pkt_type;
^
>> drivers/net/wireless/ath/ath12k/dp_mon.c:2140:18: warning: variable 'rx_buf_sz' is uninitialized when used here [-Wuninitialized]
log_type, rx_buf_sz);
^~~~~~~~~
drivers/net/wireless/ath/ath12k/dp_mon.c:2080:15: note: initialize the variable 'rx_buf_sz' to silence this warning
u32 rx_buf_sz;
^
= 0
2 warnings generated.
vim +/rx_buf_sz +2140 drivers/net/wireless/ath/ath12k/dp_mon.c
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2059
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2060 int ath12k_dp_mon_srng_process(struct ath12k *ar, int mac_id, int *budget,
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2061 bool flag, struct napi_struct *napi)
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2062 {
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2063 struct hal_mon_dest_desc *mon_dst_desc;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2064 struct ath12k_pdev_dp *pdev_dp = &ar->dp;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2065 struct ath12k_mon_data *pmon = (struct ath12k_mon_data *)&pdev_dp->mon_data;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2066 struct ath12k_base *ab = ar->ab;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2067 struct ath12k_dp *dp = &ab->dp;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2068 struct sk_buff *skb;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2069 struct ath12k_skb_rxcb *rxcb;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2070 struct dp_srng *mon_dst_ring;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2071 struct hal_srng *srng;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2072 struct dp_rxdma_ring *buf_ring;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2073 u64 cookie;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2074 u32 ppdu_id;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2075 int num_buffs_reaped = 0, srng_id, buf_id;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2076 u8 dest_idx = 0, i;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2077 bool end_of_ppdu;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2078 struct hal_rx_mon_ppdu_info *ppdu_info;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2079 struct ath12k_peer *peer = NULL;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2080 u32 rx_buf_sz;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2081 u16 log_type = 0;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2082
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2083 ppdu_info = &pmon->mon_ppdu_info;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2084 memset(ppdu_info, 0, sizeof(*ppdu_info));
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2085 ppdu_info->peer_id = HAL_INVALID_PEERID;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2086
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2087 srng_id = ath12k_hw_mac_id_to_srng_id(&ab->hw_params, mac_id);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2088
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2089 if (flag == ATH12K_DP_RX_MONITOR_MODE) {
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2090 mon_dst_ring = &pdev_dp->rxdma_mon_dst_ring[srng_id];
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2091 buf_ring = &dp->rxdma_mon_buf_ring;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2092 } else {
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2093 mon_dst_ring = &pdev_dp->tx_mon_dst_ring[srng_id];
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2094 buf_ring = &dp->tx_mon_buf_ring;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2095 }
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2096
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2097 srng = &ab->hal.srng_list[mon_dst_ring->ring_id];
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2098
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2099 spin_lock_bh(&srng->lock);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2100 ath12k_hal_srng_access_begin(ab, srng);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2101
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2102 while (likely(*budget)) {
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2103 *budget -= 1;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2104 mon_dst_desc = (struct hal_mon_dest_desc *)
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2105 ath12k_hal_srng_dst_peek(ab, srng);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2106 if (unlikely(!mon_dst_desc))
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2107 break;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2108
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2109 cookie = mon_dst_desc->cookie;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2110 buf_id = u32_get_bits(cookie, DP_RXDMA_BUF_COOKIE_BUF_ID);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2111
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2112 spin_lock_bh(&buf_ring->idr_lock);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2113 skb = idr_remove(&buf_ring->bufs_idr, buf_id);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2114 spin_unlock_bh(&buf_ring->idr_lock);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2115
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2116 if (unlikely(!skb)) {
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2117 ath12k_warn(ab, "montior destination with invalid buf_id %d\n",
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2118 buf_id);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2119 goto move_next;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2120 }
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2121
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2122 rxcb = ATH12K_SKB_RXCB(skb);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2123 dma_unmap_single(ab->dev, rxcb->paddr,
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2124 skb->len + skb_tailroom(skb),
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2125 DMA_FROM_DEVICE);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2126
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2127 pmon->dest_skb_q[dest_idx] = skb;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2128 dest_idx++;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2129 ppdu_id = mon_dst_desc->ppdu_id;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2130 end_of_ppdu = u32_get_bits(mon_dst_desc->info0,
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2131 HAL_MON_DEST_INFO0_END_OF_PPDU);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2132 if (!end_of_ppdu)
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2133 continue;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2134
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2135 for (i = 0; i < dest_idx; i++) {
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2136 skb = pmon->dest_skb_q[i];
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2137
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2138 if (log_type)
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2139 trace_ath12k_htt_rxdesc(ar, skb->data,
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 @2140 log_type, rx_buf_sz);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2141
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2142 if (flag == ATH12K_DP_RX_MONITOR_MODE)
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2143 ath12k_dp_mon_rx_parse_mon_status(ar, pmon, mac_id,
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2144 skb, napi);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2145 else
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2146 ath12k_dp_mon_tx_parse_mon_status(ar, pmon, mac_id,
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2147 skb, napi, ppdu_id);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2148
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2149 peer = ath12k_peer_find_by_id(ab, ppdu_info->peer_id);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2150
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2151 if (!peer || !peer->sta) {
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2152 ath12k_dbg(ab, ATH12K_DBG_DATA,
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2153 "failed to find the peer with peer_id %d\n",
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2154 ppdu_info->peer_id);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2155 dev_kfree_skb_any(skb);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2156 continue;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2157 }
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2158
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2159 dev_kfree_skb_any(skb);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2160 pmon->dest_skb_q[i] = NULL;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2161 }
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2162
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2163 dest_idx = 0;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2164 move_next:
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2165 ath12k_dp_mon_buf_replenish(ab, buf_ring, 1);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2166 ath12k_hal_srng_src_get_next_entry(ab, srng);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2167 num_buffs_reaped++;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2168 }
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2169
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2170 ath12k_hal_srng_access_end(ab, srng);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2171 spin_unlock_bh(&srng->lock);
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2172
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2173 return num_buffs_reaped;
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2174 }
f40abb4788a2a3 Vasanthakumar Thiagarajan 2022-02-01 2175
:::::: The code at line 2140 was first introduced by commit
:::::: f40abb4788a2a3868606a29d99583421e0874350 ath12k: New driver for Qualcomm 11be hw family
:::::: TO: Vasanthakumar Thiagarajan <quic_vthiagar@xxxxxxxxxxx>
:::::: CC: Kalle Valo <quic_kvalo@xxxxxxxxxxx>
--
0-DAY CI Kernel Test Service
https://01.org/lkp