All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH 1/2] mt76: mt7615: fix TSF configuration
Date: Thu, 04 Mar 2021 14:08:00 +0800	[thread overview]
Message-ID: <202103041438.EUASPF5A-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 7851 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <61d40a20375f888c122ee0e186168fc2db863fc3.1614058187.git.ryder.lee@mediatek.com>
References: <61d40a20375f888c122ee0e186168fc2db863fc3.1614058187.git.ryder.lee@mediatek.com>
TO: Ryder Lee <ryder.lee@mediatek.com>
TO: Felix Fietkau <nbd@nbd.name>
TO: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
CC: Shayne Chen <shayne.chen@mediatek.com>
CC: linux-wireless(a)vger.kernel.org
CC: linux-mediatek(a)lists.infradead.org
CC: Ryder Lee <ryder.lee@mediatek.com>

Hi Ryder,

I love your patch! Perhaps something to improve:

[auto build test WARNING on wireless-drivers-next/master]
[also build test WARNING on wireless-drivers/master v5.12-rc1 next-20210303]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Ryder-Lee/mt76-mt7615-fix-TSF-configuration/20210223-164744
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
:::::: branch date: 9 days ago
:::::: commit date: 9 days ago
config: x86_64-randconfig-m001-20210304 (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 <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

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

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

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33737 bytes --]

             reply	other threads:[~2021-03-04  6:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04  6:08 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-02-23  8:43 [PATCH 1/2] mt76: mt7615: fix TSF configuration Ryder Lee
2021-02-23  8:43 ` Ryder Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202103041438.EUASPF5A-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.