CC: [email protected]
TO: [email protected]
TO: Guenter Roeck <[email protected]>

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel 
chromeos-5.4
head:   2844d73d89c22c4dddd33272e77e40f50582b1bb
commit: f56036cf6e75afafec0a9b989ef35e0dda25f0a0 [182/255] FROMGIT: mt76: 
mt7615: fix TSF configuration
:::::: branch date: 2 weeks ago
:::::: commit date: 2 weeks ago
config: i386-randconfig-m021-20210504 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c:74 
mt7663_usb_sdio_set_rates() warn: variable dereferenced before check 'sta' (see 
line 70)

vim +/sta +74 drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c

d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   63  
d1251709841d1d Lorenzo Bianconi 2020-11-08   64  static int 
mt7663_usb_sdio_set_rates(struct mt7615_dev *dev,
d1251709841d1d Lorenzo Bianconi 2020-11-08   65                                 
     struct mt7615_wtbl_rate_desc *wrd)
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   66  {
d1251709841d1d Lorenzo Bianconi 2020-11-08   67         struct mt7615_rate_desc 
*rate = &wrd->rate;
d1251709841d1d Lorenzo Bianconi 2020-11-08   68         struct mt7615_sta *sta 
= wrd->sta;
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   69         u32 w5, w27, addr, val;
f56036cf6e75af Ryder Lee        2021-02-23  @70         u16 idx = 
sta->vif->mt76.omac_idx;
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   71  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   72         
lockdep_assert_held(&dev->mt76.mutex);
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   73  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  @74         if (!sta)
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   75                 return -EINVAL;
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   76  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   77         if (!mt76_poll(dev, 
MT_WTBL_UPDATE, MT_WTBL_UPDATE_BUSY, 0, 5000))
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   78                 return 
-ETIMEDOUT;
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   79  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   80         addr = 
mt7615_mac_wtbl_addr(dev, sta->wcid.idx);
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   81  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   82         w27 = mt76_rr(dev, addr 
+ 27 * 4);
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   83         w27 &= 
~MT_WTBL_W27_CC_BW_SEL;
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   84         w27 |= 
FIELD_PREP(MT_WTBL_W27_CC_BW_SEL, rate->bw);
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   85  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   86         w5 = mt76_rr(dev, addr 
+ 5 * 4);
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   87         w5 &= 
~(MT_WTBL_W5_BW_CAP | MT_WTBL_W5_CHANGE_BW_RATE |
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   88                 
MT_WTBL_W5_MPDU_OK_COUNT |
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   89                 
MT_WTBL_W5_MPDU_FAIL_COUNT |
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   90                 
MT_WTBL_W5_RATE_IDX);
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   91         w5 |= 
FIELD_PREP(MT_WTBL_W5_BW_CAP, rate->bw) |
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   92               
FIELD_PREP(MT_WTBL_W5_CHANGE_BW_RATE,
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   93                          
rate->bw_idx ? rate->bw_idx - 1 : 7);
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   94  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   95         mt76_wr(dev, 
MT_WTBL_RIUCR0, w5);
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   96  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   97         mt76_wr(dev, 
MT_WTBL_RIUCR1,
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   98                 
FIELD_PREP(MT_WTBL_RIUCR1_RATE0, rate->probe_val) |
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15   99                 
FIELD_PREP(MT_WTBL_RIUCR1_RATE1, rate->val[0]) |
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  100                 
FIELD_PREP(MT_WTBL_RIUCR1_RATE2_LO, rate->val[1]));
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  101  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  102         mt76_wr(dev, 
MT_WTBL_RIUCR2,
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  103                 
FIELD_PREP(MT_WTBL_RIUCR2_RATE2_HI, rate->val[1] >> 8) |
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  104                 
FIELD_PREP(MT_WTBL_RIUCR2_RATE3, rate->val[1]) |
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  105                 
FIELD_PREP(MT_WTBL_RIUCR2_RATE4, rate->val[2]) |
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  106                 
FIELD_PREP(MT_WTBL_RIUCR2_RATE5_LO, rate->val[2]));
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  107  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  108         mt76_wr(dev, 
MT_WTBL_RIUCR3,
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  109                 
FIELD_PREP(MT_WTBL_RIUCR3_RATE5_HI, rate->val[2] >> 4) |
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  110                 
FIELD_PREP(MT_WTBL_RIUCR3_RATE6, rate->val[3]) |
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  111                 
FIELD_PREP(MT_WTBL_RIUCR3_RATE7, rate->val[3]));
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  112  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  113         mt76_wr(dev, 
MT_WTBL_UPDATE,
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  114                 
FIELD_PREP(MT_WTBL_UPDATE_WLAN_IDX, sta->wcid.idx) |
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  115                 
MT_WTBL_UPDATE_RATE_UPDATE |
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  116                 
MT_WTBL_UPDATE_TX_COUNT_CLEAR);
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  117  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  118         mt76_wr(dev, addr + 27 
* 4, w27);
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  119  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  120         sta->rate_probe = 
sta->rateset[rate->rateset].probe_rate.idx != -1;
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  121  
f56036cf6e75af Ryder Lee        2021-02-23  122         idx = idx > 
HW_BSSID_MAX ? HW_BSSID_0 : idx;
f56036cf6e75af Ryder Lee        2021-02-23  123         addr = idx > 1 ? 
MT_LPON_TCR2(idx): MT_LPON_TCR0(idx);
f56036cf6e75af Ryder Lee        2021-02-23  124  
f56036cf6e75af Ryder Lee        2021-02-23  125         mt76_set(dev, addr, 
MT_LPON_TCR_MODE); /* TSF read */
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  126         val = mt76_rr(dev, 
MT_LPON_UTTR0);
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  127         sta->rate_set_tsf = 
(val & ~BIT(0)) | rate->rateset;
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  128  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  129         if (!(sta->wcid.tx_info 
& MT_WCID_TX_INFO_SET))
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  130                 mt76_poll(dev, 
MT_WTBL_UPDATE, MT_WTBL_UPDATE_BUSY, 0, 5000);
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  131  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  132         sta->rate_count = 2 * 
MT7615_RATE_RETRY * sta->n_rates;
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  133         sta->wcid.tx_info |= 
MT_WCID_TX_INFO_SET;
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  134  
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  135         return 0;
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  136  }
d790cea7b38dd2 Lorenzo Bianconi 2020-07-15  137  

:::::: The code at line 74 was first introduced by commit
:::::: d790cea7b38dd2d6a76c55d1547c1c430dd6d431 UPSTREAM: mt76: mt7615: 
introduce mt7663-usb-sdio-common module

:::::: TO: Lorenzo Bianconi <[email protected]>
:::::: CC: Commit Bot <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to