* [linux-next:master 11193/12612] drivers/net/wireless/mediatek/mt76/mt7921/mac.c:829:14: sparse: sparse: cast to restricted __le32
@ 2021-06-23 16:45 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-06-23 16:45 UTC (permalink / raw)
To: Deren Wu; +Cc: kbuild-all, Linux Memory Management List, Felix Fietkau
[-- Attachment #1: Type: text/plain, Size: 4768 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: d61c8b66c84080ecf8f9f4d9272ab4ec78029a59
commit: 3cce2b98e0241ff238e25eca1dbb480534a7695a [11193/12612] mt76: mt7921: introduce mac tx done handling
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3cce2b98e0241ff238e25eca1dbb480534a7695a
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 3cce2b98e0241ff238e25eca1dbb480534a7695a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/net/wireless/mediatek/mt76/mt7921/mac.c:829:14: sparse: sparse: cast to restricted __le32
>> drivers/net/wireless/mediatek/mt76/mt7921/mac.c:829:14: sparse: sparse: restricted __le32 degrades to integer
>> drivers/net/wireless/mediatek/mt76/mt7921/mac.c:829:14: sparse: sparse: restricted __le32 degrades to integer
vim +829 drivers/net/wireless/mediatek/mt76/mt7921/mac.c
751
752 void mt7921_mac_write_txwi(struct mt7921_dev *dev, __le32 *txwi,
753 struct sk_buff *skb, struct mt76_wcid *wcid,
754 struct ieee80211_key_conf *key, bool beacon)
755 {
756 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
757 struct ieee80211_vif *vif = info->control.vif;
758 struct mt76_phy *mphy = &dev->mphy;
759 u8 pid, p_fmt, q_idx, omac_idx = 0, wmm_idx = 0;
760 bool is_8023 = info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP;
761 u16 tx_count = 15;
762 u32 val;
763
764 if (vif) {
765 struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
766
767 omac_idx = mvif->omac_idx;
768 wmm_idx = mvif->wmm_idx;
769 }
770
771 if (beacon) {
772 p_fmt = MT_TX_TYPE_FW;
773 q_idx = MT_LMAC_BCN0;
774 } else if (skb_get_queue_mapping(skb) >= MT_TXQ_PSD) {
775 p_fmt = MT_TX_TYPE_CT;
776 q_idx = MT_LMAC_ALTX0;
777 } else {
778 p_fmt = MT_TX_TYPE_CT;
779 q_idx = wmm_idx * MT7921_MAX_WMM_SETS +
780 mt7921_lmac_mapping(dev, skb_get_queue_mapping(skb));
781 }
782
783 val = FIELD_PREP(MT_TXD0_TX_BYTES, skb->len + MT_TXD_SIZE) |
784 FIELD_PREP(MT_TXD0_PKT_FMT, p_fmt) |
785 FIELD_PREP(MT_TXD0_Q_IDX, q_idx);
786 txwi[0] = cpu_to_le32(val);
787
788 val = MT_TXD1_LONG_FORMAT |
789 FIELD_PREP(MT_TXD1_WLAN_IDX, wcid->idx) |
790 FIELD_PREP(MT_TXD1_OWN_MAC, omac_idx);
791
792 txwi[1] = cpu_to_le32(val);
793 txwi[2] = 0;
794
795 val = FIELD_PREP(MT_TXD3_REM_TX_COUNT, tx_count);
796 if (key)
797 val |= MT_TXD3_PROTECT_FRAME;
798 if (info->flags & IEEE80211_TX_CTL_NO_ACK)
799 val |= MT_TXD3_NO_ACK;
800
801 txwi[3] = cpu_to_le32(val);
802 txwi[4] = 0;
803 txwi[5] = 0;
804 txwi[6] = 0;
805 txwi[7] = wcid->amsdu ? cpu_to_le32(MT_TXD7_HW_AMSDU) : 0;
806
807 if (is_8023)
808 mt7921_mac_write_txwi_8023(dev, txwi, skb, wcid);
809 else
810 mt7921_mac_write_txwi_80211(dev, txwi, skb, key);
811
812 if (txwi[2] & cpu_to_le32(MT_TXD2_FIX_RATE)) {
813 u16 rate;
814
815 /* hardware won't add HTC for mgmt/ctrl frame */
816 txwi[2] |= cpu_to_le32(MT_TXD2_HTC_VLD);
817
818 if (mphy->chandef.chan->band == NL80211_BAND_5GHZ)
819 rate = MT7921_5G_RATE_DEFAULT;
820 else
821 rate = MT7921_2G_RATE_DEFAULT;
822
823 val = MT_TXD6_FIXED_BW |
824 FIELD_PREP(MT_TXD6_TX_RATE, rate);
825 txwi[6] |= cpu_to_le32(val);
826 txwi[3] |= cpu_to_le32(MT_TXD3_BA_DISABLE);
827 }
828
> 829 if ((FIELD_GET(MT_TXD2_FRAME_TYPE, txwi[2]) &
830 (IEEE80211_FTYPE_DATA >> 2)) &&
831 mt7921_next_txs_timeout(dev, wcid)) {
832 mt7921_next_txs_set(dev, wcid, 250);
833 pid = mt7921_next_pid(dev, wcid);
834 val = MT_TXD5_TX_STATUS_MCU | FIELD_PREP(MT_TXD5_PID, pid);
835 txwi[5] |= cpu_to_le32(val);
836 }
837 }
838
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 73067 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-23 16:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23 16:45 [linux-next:master 11193/12612] drivers/net/wireless/mediatek/mt76/mt7921/mac.c:829:14: sparse: sparse: cast to restricted __le32 kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox