[peterz-queue:mm/tlb 4/10] arch/parisc/include/asm/pgalloc.h:69:6: error: implicit declaration of function '__pmd_free'; did you mean 'pmd_free'?
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git mm/tlb
head: 32b651c868d125e442604bc845063f37eac3e32c
commit: 0ebda728f2d1e406e1c1561c9697ba5a1def950b [4/10] parisc/tlb: Fix __p*_free_tlb()
config: parisc-randconfig-r002-20210615 (attached as .config)
compiler: hppa64-linux-gcc (GCC) 9.3.0
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
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?...
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue mm/tlb
git checkout 0ebda728f2d1e406e1c1561c9697ba5a1def950b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from mm/memory.c:81:
mm/memory.c: In function 'free_pmd_range':
>> arch/parisc/include/asm/pgalloc.h:69:6: error: implicit declaration of function '__pmd_free'; did you mean 'pmd_free'? [-Werror=implicit-function-declaration]
69 | if (__pmd_free((tlb)->mm, (pmd))) \
| ^~~~~~~~~~
include/asm-generic/tlb.h:638:3: note: in expansion of macro '__pmd_free_tlb'
638 | __pmd_free_tlb(tlb, pmdp, address); \
| ^~~~~~~~~~~~~~
mm/memory.c:266:2: note: in expansion of macro 'pmd_free_tlb'
266 | pmd_free_tlb(tlb, pmd, start);
| ^~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +69 arch/parisc/include/asm/pgalloc.h
66
67 #define __pmd_free_tlb(tlb, pmd, addr) \
68 do { \
> 69 if (__pmd_free((tlb)->mm, (pmd))) \
70 tlb_remove_table((tlb), (pmd)); \
71 } while (0)
72
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[staging:staging-testing 371/409] drivers/staging/rtl8188eu/core/rtw_efuse.c:239:8: warning: variable 'aaa' set but not used
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-testing
head: 5b4f167ef3555ec4c334a8dc89c1b44bb2c6bff5
commit: 9a6780227ece18b6ad1ae6514a46a6850dfa9971 [371/409] staging: rtl8188eu: remove all DBG_88E calls from core/rtw_efuse.c
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.0
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
# https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit...
git remote add staging https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
git fetch --no-tags staging staging-testing
git checkout 9a6780227ece18b6ad1ae6514a46a6850dfa9971
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/staging/rtl8188eu/core/rtw_efuse.c: In function 'efuse_read_phymap_from_txpktbuf':
>> drivers/staging/rtl8188eu/core/rtw_efuse.c:239:8: warning: variable 'aaa' set but not used [-Wunused-but-set-variable]
239 | u16 aaa;
| ^~~
>> drivers/staging/rtl8188eu/core/rtw_efuse.c:238:16: warning: variable 'aaabak' set but not used [-Wunused-but-set-variable]
238 | u16 lenbak, aaabak;
| ^~~~~~
>> drivers/staging/rtl8188eu/core/rtw_efuse.c:238:8: warning: variable 'lenbak' set but not used [-Wunused-but-set-variable]
238 | u16 lenbak, aaabak;
| ^~~~~~
vim +/aaa +239 drivers/staging/rtl8188eu/core/rtw_efuse.c
ee5f8a431ead8f3 navin patidar 2014-06-20 199
ee5f8a431ead8f3 navin patidar 2014-06-20 200 static void efuse_read_phymap_from_txpktbuf(
ee5f8a431ead8f3 navin patidar 2014-06-20 201 struct adapter *adapter,
ee5f8a431ead8f3 navin patidar 2014-06-20 202 int bcnhead, /* beacon head, where FW store len(2-byte) and efuse physical map. */
ee5f8a431ead8f3 navin patidar 2014-06-20 203 u8 *content, /* buffer to store efuse physical map */
ee5f8a431ead8f3 navin patidar 2014-06-20 204 u16 *size /* for efuse content: the max byte to read. will update to byte read */
ee5f8a431ead8f3 navin patidar 2014-06-20 205 )
ee5f8a431ead8f3 navin patidar 2014-06-20 206 {
ee5f8a431ead8f3 navin patidar 2014-06-20 207 u16 dbg_addr = 0;
ed73749426deb28 Rémy Oudompheng 2015-11-02 208 unsigned long start = 0;
ee5f8a431ead8f3 navin patidar 2014-06-20 209 u8 reg_0x143 = 0;
ee5f8a431ead8f3 navin patidar 2014-06-20 210 u32 lo32 = 0, hi32 = 0;
ee5f8a431ead8f3 navin patidar 2014-06-20 211 u16 len = 0, count = 0;
ee5f8a431ead8f3 navin patidar 2014-06-20 212 int i = 0;
ee5f8a431ead8f3 navin patidar 2014-06-20 213 u16 limit = *size;
ee5f8a431ead8f3 navin patidar 2014-06-20 214
ee5f8a431ead8f3 navin patidar 2014-06-20 215 u8 *pos = content;
ee5f8a431ead8f3 navin patidar 2014-06-20 216
ee5f8a431ead8f3 navin patidar 2014-06-20 217 if (bcnhead < 0) /* if not valid */
ee5f8a431ead8f3 navin patidar 2014-06-20 218 bcnhead = usb_read8(adapter, REG_TDECTRL + 1);
ee5f8a431ead8f3 navin patidar 2014-06-20 219
ee5f8a431ead8f3 navin patidar 2014-06-20 220 usb_write8(adapter, REG_PKT_BUFF_ACCESS_CTRL, TXPKT_BUF_SELECT);
ee5f8a431ead8f3 navin patidar 2014-06-20 221
ee5f8a431ead8f3 navin patidar 2014-06-20 222 dbg_addr = bcnhead * 128 / 8; /* 8-bytes addressing */
ee5f8a431ead8f3 navin patidar 2014-06-20 223
ee5f8a431ead8f3 navin patidar 2014-06-20 224 while (1) {
ee5f8a431ead8f3 navin patidar 2014-06-20 225 usb_write16(adapter, REG_PKTBUF_DBG_ADDR, dbg_addr + i);
ee5f8a431ead8f3 navin patidar 2014-06-20 226
ee5f8a431ead8f3 navin patidar 2014-06-20 227 usb_write8(adapter, REG_TXPKTBUF_DBG, 0);
ee5f8a431ead8f3 navin patidar 2014-06-20 228 start = jiffies;
ee5f8a431ead8f3 navin patidar 2014-06-20 229 while (!(reg_0x143 = usb_read8(adapter, REG_TXPKTBUF_DBG)) &&
9a6780227ece18b Phillip Potter 2021-06-15 230 jiffies_to_msecs(jiffies - start) < 1000)
c8cb5f2c780a600 Jiayi Ye 2014-10-20 231 usleep_range(1000, 2000);
ee5f8a431ead8f3 navin patidar 2014-06-20 232
ee5f8a431ead8f3 navin patidar 2014-06-20 233 lo32 = usb_read32(adapter, REG_PKTBUF_DBG_DATA_L);
ee5f8a431ead8f3 navin patidar 2014-06-20 234 hi32 = usb_read32(adapter, REG_PKTBUF_DBG_DATA_H);
ee5f8a431ead8f3 navin patidar 2014-06-20 235
ee5f8a431ead8f3 navin patidar 2014-06-20 236 if (i == 0) {
ee5f8a431ead8f3 navin patidar 2014-06-20 237 u8 lenc[2];
ee5f8a431ead8f3 navin patidar 2014-06-20 @238 u16 lenbak, aaabak;
ee5f8a431ead8f3 navin patidar 2014-06-20 @239 u16 aaa;
7d2af82cc5f5713 Yamanappagouda Patil 2016-12-22 240
ee5f8a431ead8f3 navin patidar 2014-06-20 241 lenc[0] = usb_read8(adapter, REG_PKTBUF_DBG_DATA_L);
ee5f8a431ead8f3 navin patidar 2014-06-20 242 lenc[1] = usb_read8(adapter, REG_PKTBUF_DBG_DATA_L + 1);
ee5f8a431ead8f3 navin patidar 2014-06-20 243
ee5f8a431ead8f3 navin patidar 2014-06-20 244 aaabak = le16_to_cpup((__le16 *)lenc);
ee5f8a431ead8f3 navin patidar 2014-06-20 245 lenbak = le16_to_cpu(*((__le16 *)lenc));
ee5f8a431ead8f3 navin patidar 2014-06-20 246 aaa = le16_to_cpup((__le16 *)&lo32);
ee5f8a431ead8f3 navin patidar 2014-06-20 247 len = le16_to_cpu(*((__le16 *)&lo32));
ee5f8a431ead8f3 navin patidar 2014-06-20 248
530c9b1b21fc41f Ivan Safonov 2015-10-27 249 limit = min_t(u16, len - 2, limit);
ee5f8a431ead8f3 navin patidar 2014-06-20 250
ee5f8a431ead8f3 navin patidar 2014-06-20 251 memcpy(pos, ((u8 *)&lo32) + 2, (limit >= count + 2) ? 2 : limit - count);
ee5f8a431ead8f3 navin patidar 2014-06-20 252 count += (limit >= count + 2) ? 2 : limit - count;
ee5f8a431ead8f3 navin patidar 2014-06-20 253 pos = content + count;
ee5f8a431ead8f3 navin patidar 2014-06-20 254
ee5f8a431ead8f3 navin patidar 2014-06-20 255 } else {
ee5f8a431ead8f3 navin patidar 2014-06-20 256 memcpy(pos, ((u8 *)&lo32), (limit >= count + 4) ? 4 : limit - count);
ee5f8a431ead8f3 navin patidar 2014-06-20 257 count += (limit >= count + 4) ? 4 : limit - count;
ee5f8a431ead8f3 navin patidar 2014-06-20 258 pos = content + count;
ee5f8a431ead8f3 navin patidar 2014-06-20 259 }
ee5f8a431ead8f3 navin patidar 2014-06-20 260
ee5f8a431ead8f3 navin patidar 2014-06-20 261 if (limit > count && len - 2 > count) {
ee5f8a431ead8f3 navin patidar 2014-06-20 262 memcpy(pos, (u8 *)&hi32, (limit >= count + 4) ? 4 : limit - count);
ee5f8a431ead8f3 navin patidar 2014-06-20 263 count += (limit >= count + 4) ? 4 : limit - count;
ee5f8a431ead8f3 navin patidar 2014-06-20 264 pos = content + count;
ee5f8a431ead8f3 navin patidar 2014-06-20 265 }
ee5f8a431ead8f3 navin patidar 2014-06-20 266
ee5f8a431ead8f3 navin patidar 2014-06-20 267 if (limit <= count || len - 2 <= count)
ee5f8a431ead8f3 navin patidar 2014-06-20 268 break;
ee5f8a431ead8f3 navin patidar 2014-06-20 269 i++;
ee5f8a431ead8f3 navin patidar 2014-06-20 270 }
ee5f8a431ead8f3 navin patidar 2014-06-20 271 usb_write8(adapter, REG_PKT_BUFF_ACCESS_CTRL, DISABLE_TRXPKT_BUF_ACCESS);
ee5f8a431ead8f3 navin patidar 2014-06-20 272 *size = count;
ee5f8a431ead8f3 navin patidar 2014-06-20 273 }
ee5f8a431ead8f3 navin patidar 2014-06-20 274
:::::: The code at line 239 was first introduced by commit
:::::: ee5f8a431ead8f334f4c04f91ecafa34cb9d52ca staging: rtl8188eu: Move all efuse related code to rtw_efuse.c
:::::: TO: navin patidar <navin.patidar(a)gmail.com>
:::::: CC: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[atishp04:dma_non_coherent_test 6/48] drivers/soc/sifive/sifive_l2_cache.c:151:3: error: implicit declaration of function 'writeq'; did you mean 'writeb'?
by kernel test robot
Hi Tom,
FYI, the error/warning still remains.
tree: https://github.com/atishp04/linux dma_non_coherent_test
head: b6a8eeec059715370d35fdb32c8c3fe41e2b69c1
commit: e0d5ab480cafc73def31f4dd297f854bad07dcb8 [6/48] sifive/sifive_l2_cache: Add sifive_l2_flush64_range function
config: riscv-randconfig-r005-20210615 (attached as .config)
compiler: riscv32-linux-gcc (GCC) 9.3.0
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
# https://github.com/atishp04/linux/commit/e0d5ab480cafc73def31f4dd297f854b...
git remote add atishp04 https://github.com/atishp04/linux
git fetch --no-tags atishp04 dma_non_coherent_test
git checkout e0d5ab480cafc73def31f4dd297f854bad07dcb8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/soc/sifive/sifive_l2_cache.c: In function 'sifive_l2_flush64_range':
>> drivers/soc/sifive/sifive_l2_cache.c:151:3: error: implicit declaration of function 'writeq'; did you mean 'writeb'? [-Werror=implicit-function-declaration]
151 | writeq(line, l2_base + SIFIVE_L2_FLUSH64);
| ^~~~~~
| writeb
cc1: some warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for LOCKDEP
Depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT && (FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86)
Selected by
- LOCK_STAT && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
- DEBUG_LOCK_ALLOC && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
vim +151 drivers/soc/sifive/sifive_l2_cache.c
122
123 #ifdef CONFIG_SIFIVE_L2_FLUSH
124 void sifive_l2_flush64_range(unsigned long start, unsigned long len)
125 {
126 unsigned long line;
127
128 if(!l2_base) {
129 pr_warn("L2CACHE: base addr invalid, skipping flush\n");
130 return;
131 }
132
133 /* TODO: if (len == 0), skipping flush or going on? */
134 if(!len) {
135 pr_debug("L2CACHE: flush64 range @ 0x%lx(len:0)\n", start);
136 return;
137 }
138
139 /* make sure the address is in the range */
140 if(start < CONFIG_SIFIVE_L2_FLUSH_START ||
141 (start + len) > (CONFIG_SIFIVE_L2_FLUSH_START +
142 CONFIG_SIFIVE_L2_FLUSH_SIZE)) {
143 pr_warn("L2CACHE: flush64 out of range: %lx(%lx), skip flush\n",
144 start, len);
145 return;
146 }
147
148 mb(); /* sync */
149 for (line = start; line < start + len;
150 line += SIFIVE_L2_FLUSH64_LINE_LEN) {
> 151 writeq(line, l2_base + SIFIVE_L2_FLUSH64);
152 mb();
153 }
154 }
155 EXPORT_SYMBOL_GPL(sifive_l2_flush64_range);
156 #endif
157
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
drivers/uio/uio_aec.c:50:49: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 009c9aa5be652675a06d5211e1640e02bbb1c33d
commit: 8f28ca6bd8211214faf717677bbffe375c2a6072 iomap: constify ioreadX() iomem argument (as in generic implementation)
date: 10 months ago
config: alpha-randconfig-s031-20210615 (attached as .config)
compiler: alpha-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/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 8f28ca6bd8211214faf717677bbffe375c2a6072
# 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=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/uio/uio_aec.c:44:49: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void [noderef] __iomem *int_flag @@ got void * @@
drivers/uio/uio_aec.c:44:49: sparse: expected void [noderef] __iomem *int_flag
drivers/uio/uio_aec.c:44:49: sparse: got void *
>> drivers/uio/uio_aec.c:50:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:50:49: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:50:49: sparse: got void *
drivers/uio/uio_aec.c:59:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:59:9: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:59:9: sparse: got void *
drivers/uio/uio_aec.c:59:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:59:9: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:59:9: sparse: got void *
drivers/uio/uio_aec.c:59:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:59:9: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:59:9: sparse: got void *
drivers/uio/uio_aec.c:59:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:59:9: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:59:9: sparse: got void *
drivers/uio/uio_aec.c:59:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:59:9: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:59:9: sparse: got void *
drivers/uio/uio_aec.c:59:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:59:9: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:59:9: sparse: got void *
drivers/uio/uio_aec.c:88:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *priv @@ got void [noderef] __iomem * @@
drivers/uio/uio_aec.c:88:20: sparse: expected void *priv
drivers/uio/uio_aec.c:88:20: sparse: got void [noderef] __iomem *
drivers/uio/uio_aec.c:104:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:104:42: sparse: expected void [noderef] __iomem *addr
drivers/uio/uio_aec.c:104:42: sparse: got void *
drivers/uio/uio_aec.c:105:43: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:105:43: sparse: expected void [noderef] __iomem *addr
drivers/uio/uio_aec.c:105:43: sparse: got void *
drivers/uio/uio_aec.c:106:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:106:34: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:106:34: sparse: got void *
drivers/uio/uio_aec.c:115:31: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got void *priv @@
drivers/uio/uio_aec.c:115:31: sparse: expected void [noderef] __iomem *
drivers/uio/uio_aec.c:115:31: sparse: got void *priv
drivers/uio/uio_aec.c:130:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:130:42: sparse: expected void [noderef] __iomem *addr
drivers/uio/uio_aec.c:130:42: sparse: got void *
drivers/uio/uio_aec.c:131:43: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:131:43: sparse: expected void [noderef] __iomem *addr
drivers/uio/uio_aec.c:131:43: sparse: got void *
drivers/uio/uio_aec.c:133:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:133:28: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:133:28: sparse: got void *
drivers/uio/uio_aec.c:138:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void *priv @@
drivers/uio/uio_aec.c:138:21: sparse: expected void volatile [noderef] __iomem *addr
drivers/uio/uio_aec.c:138:21: sparse: got void *priv
vim +50 drivers/uio/uio_aec.c
1bafeb378e915f Brandon Philips 2009-01-27 41
1bafeb378e915f Brandon Philips 2009-01-27 42 static irqreturn_t aectc_irq(int irq, struct uio_info *dev_info)
1bafeb378e915f Brandon Philips 2009-01-27 43 {
1bafeb378e915f Brandon Philips 2009-01-27 @44 void __iomem *int_flag = dev_info->priv + INTA_DRVR_ADDR;
1bafeb378e915f Brandon Philips 2009-01-27 45 unsigned char status = ioread8(int_flag);
1bafeb378e915f Brandon Philips 2009-01-27 46
1bafeb378e915f Brandon Philips 2009-01-27 47
1bafeb378e915f Brandon Philips 2009-01-27 48 if ((status & INTA_ENABLED_FLAG) && (status & INTA_FLAG)) {
1bafeb378e915f Brandon Philips 2009-01-27 49 /* application writes 0x00 to 0x2F to get next interrupt */
1bafeb378e915f Brandon Philips 2009-01-27 @50 status = ioread8(dev_info->priv + MAILBOX);
1bafeb378e915f Brandon Philips 2009-01-27 51 return IRQ_HANDLED;
1bafeb378e915f Brandon Philips 2009-01-27 52 }
1bafeb378e915f Brandon Philips 2009-01-27 53
1bafeb378e915f Brandon Philips 2009-01-27 54 return IRQ_NONE;
1bafeb378e915f Brandon Philips 2009-01-27 55 }
1bafeb378e915f Brandon Philips 2009-01-27 56
:::::: The code at line 50 was first introduced by commit
:::::: 1bafeb378e915f39b1bf44ee0871823d6f402ea5 uio: add the uio_aec driver
:::::: TO: Brandon Philips <brandon(a)ifup.org>
:::::: CC: Greg Kroah-Hartman <gregkh(a)suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
drivers/net/wan/fsl_ucc_hdlc.c:305:17: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 009c9aa5be652675a06d5211e1640e02bbb1c33d
commit: e5fc436f06eef54ef512ea55a9db8eb9f2e76959 sparse: use static inline for __chk_{user,io}_ptr()
date: 10 months ago
config: arm-randconfig-s032-20210615 (attached as .config)
compiler: arm-linux-gnueabi-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/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e5fc436f06eef54ef512ea55a9db8eb9f2e76959
# 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=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/net/wan/fsl_ucc_hdlc.c:305:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:305:17: sparse: expected void const volatile [noderef] __iomem *ptr
drivers/net/wan/fsl_ucc_hdlc.c:305:17: sparse: got restricted __be16 *
drivers/net/wan/fsl_ucc_hdlc.c:306:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:306:17: sparse: expected void volatile [noderef] __iomem *addr
drivers/net/wan/fsl_ucc_hdlc.c:306:17: sparse: got restricted __be32 *
drivers/net/wan/fsl_ucc_hdlc.c:316:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:316:17: sparse: expected void const volatile [noderef] __iomem *ptr
drivers/net/wan/fsl_ucc_hdlc.c:316:17: sparse: got restricted __be16 *
drivers/net/wan/fsl_ucc_hdlc.c:317:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:317:17: sparse: expected void volatile [noderef] __iomem *addr
drivers/net/wan/fsl_ucc_hdlc.c:317:17: sparse: got restricted __be32 *
drivers/net/wan/fsl_ucc_hdlc.c:368:29: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] @@ got restricted __be16 [usertype] @@
drivers/net/wan/fsl_ucc_hdlc.c:368:29: sparse: expected unsigned short [usertype]
drivers/net/wan/fsl_ucc_hdlc.c:368:29: sparse: got restricted __be16 [usertype]
drivers/net/wan/fsl_ucc_hdlc.c:375:36: sparse: sparse: restricted __be16 degrades to integer
drivers/net/wan/fsl_ucc_hdlc.c:398:12: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct qe_bd [noderef] __iomem *bd @@ got struct qe_bd *curtx_bd @@
drivers/net/wan/fsl_ucc_hdlc.c:398:12: sparse: expected struct qe_bd [noderef] __iomem *bd
drivers/net/wan/fsl_ucc_hdlc.c:398:12: sparse: got struct qe_bd *curtx_bd
drivers/net/wan/fsl_ucc_hdlc.c:408:35: sparse: sparse: dereference of noderef expression
drivers/net/wan/fsl_ucc_hdlc.c:421:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct qe_bd [noderef] __iomem *[assigned] bd @@ got struct qe_bd *tx_bd_base @@
drivers/net/wan/fsl_ucc_hdlc.c:421:20: sparse: expected struct qe_bd [noderef] __iomem *[assigned] bd
drivers/net/wan/fsl_ucc_hdlc.c:421:20: sparse: got struct qe_bd *tx_bd_base
drivers/net/wan/fsl_ucc_hdlc.c:423:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/net/wan/fsl_ucc_hdlc.c:423:16: sparse: struct qe_bd [noderef] __iomem *
drivers/net/wan/fsl_ucc_hdlc.c:423:16: sparse: struct qe_bd *
drivers/net/wan/fsl_ucc_hdlc.c:458:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:458:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:458:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:458:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:502:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:502:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:502:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:502:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:524:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:524:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:524:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:524:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:548:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:548:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:548:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:548:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:592:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:607:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:607:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:607:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:607:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:850:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct qe_mux *qe_mux_reg @@ got struct qe_mux [noderef] __iomem * @@
drivers/net/wan/fsl_ucc_hdlc.c:853:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:853:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:853:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:853:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:853:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:853:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:854:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:854:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:854:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:854:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:854:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:854:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:857:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:857:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:857:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:857:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:857:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:857:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:860:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const volatile [noderef] __iomem *from @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:865:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct qe_mux *qe_mux_reg @@ got struct qe_mux [noderef] __iomem * @@
drivers/net/wan/fsl_ucc_hdlc.c:867:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *to @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:869:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:870:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:872:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:992:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:993:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:1003:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *ptr @@ got restricted __be16 * @@
drivers/net/wan/fsl_ucc_hdlc.c:1004:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __be32 * @@
drivers/net/wan/fsl_ucc_hdlc.c:408:35: sparse: sparse: dereference of noderef expression
drivers/net/wan/fsl_ucc_hdlc.c:408:35: sparse: sparse: dereference of noderef expression
drivers/net/wan/fsl_ucc_hdlc.c:723:29: sparse: sparse: dereference of noderef expression
drivers/net/wan/fsl_ucc_hdlc.c:814:21: sparse: sparse: dereference of noderef expression
drivers/net/wan/fsl_ucc_hdlc.c:1020:29: sparse: sparse: dereference of noderef expression
vim +305 drivers/net/wan/fsl_ucc_hdlc.c
c19b6d246a35627 Zhao Qiang 2016-06-06 77
c19b6d246a35627 Zhao Qiang 2016-06-06 78 static int uhdlc_init(struct ucc_hdlc_private *priv)
c19b6d246a35627 Zhao Qiang 2016-06-06 79 {
c19b6d246a35627 Zhao Qiang 2016-06-06 80 struct ucc_tdm_info *ut_info;
c19b6d246a35627 Zhao Qiang 2016-06-06 81 struct ucc_fast_info *uf_info;
c19b6d246a35627 Zhao Qiang 2016-06-06 82 u32 cecr_subblock;
c19b6d246a35627 Zhao Qiang 2016-06-06 83 u16 bd_status;
c19b6d246a35627 Zhao Qiang 2016-06-06 84 int ret, i;
c19b6d246a35627 Zhao Qiang 2016-06-06 85 void *bd_buffer;
c19b6d246a35627 Zhao Qiang 2016-06-06 86 dma_addr_t bd_dma_addr;
be2e9415f8b366a Rasmus Villemoes 2019-11-28 87 s32 riptr;
be2e9415f8b366a Rasmus Villemoes 2019-11-28 88 s32 tiptr;
c19b6d246a35627 Zhao Qiang 2016-06-06 89 u32 gumr;
c19b6d246a35627 Zhao Qiang 2016-06-06 90
c19b6d246a35627 Zhao Qiang 2016-06-06 91 ut_info = priv->ut_info;
c19b6d246a35627 Zhao Qiang 2016-06-06 92 uf_info = &ut_info->uf_info;
c19b6d246a35627 Zhao Qiang 2016-06-06 93
c19b6d246a35627 Zhao Qiang 2016-06-06 94 if (priv->tsa) {
c19b6d246a35627 Zhao Qiang 2016-06-06 95 uf_info->tsa = 1;
c19b6d246a35627 Zhao Qiang 2016-06-06 96 uf_info->ctsp = 1;
040b7c94e4ec585 David Gounaris 2018-09-03 97 uf_info->cds = 1;
040b7c94e4ec585 David Gounaris 2018-09-03 98 uf_info->ctss = 1;
040b7c94e4ec585 David Gounaris 2018-09-03 99 } else {
040b7c94e4ec585 David Gounaris 2018-09-03 100 uf_info->cds = 0;
040b7c94e4ec585 David Gounaris 2018-09-03 101 uf_info->ctsp = 0;
040b7c94e4ec585 David Gounaris 2018-09-03 102 uf_info->ctss = 0;
c19b6d246a35627 Zhao Qiang 2016-06-06 103 }
067bb938dad61e5 Holger Brunck 2017-05-17 104
067bb938dad61e5 Holger Brunck 2017-05-17 105 /* This sets HPM register in CMXUCR register which configures a
067bb938dad61e5 Holger Brunck 2017-05-17 106 * open drain connected HDLC bus
067bb938dad61e5 Holger Brunck 2017-05-17 107 */
067bb938dad61e5 Holger Brunck 2017-05-17 108 if (priv->hdlc_bus)
067bb938dad61e5 Holger Brunck 2017-05-17 109 uf_info->brkpt_support = 1;
067bb938dad61e5 Holger Brunck 2017-05-17 110
c19b6d246a35627 Zhao Qiang 2016-06-06 111 uf_info->uccm_mask = ((UCC_HDLC_UCCE_RXB | UCC_HDLC_UCCE_RXF |
c19b6d246a35627 Zhao Qiang 2016-06-06 112 UCC_HDLC_UCCE_TXB) << 16);
c19b6d246a35627 Zhao Qiang 2016-06-06 113
c19b6d246a35627 Zhao Qiang 2016-06-06 114 ret = ucc_fast_init(uf_info, &priv->uccf);
c19b6d246a35627 Zhao Qiang 2016-06-06 115 if (ret) {
c19b6d246a35627 Zhao Qiang 2016-06-06 116 dev_err(priv->dev, "Failed to init uccf.");
c19b6d246a35627 Zhao Qiang 2016-06-06 117 return ret;
c19b6d246a35627 Zhao Qiang 2016-06-06 118 }
c19b6d246a35627 Zhao Qiang 2016-06-06 119
c19b6d246a35627 Zhao Qiang 2016-06-06 120 priv->uf_regs = priv->uccf->uf_regs;
c19b6d246a35627 Zhao Qiang 2016-06-06 121 ucc_fast_disable(priv->uccf, COMM_DIR_RX | COMM_DIR_TX);
c19b6d246a35627 Zhao Qiang 2016-06-06 122
c19b6d246a35627 Zhao Qiang 2016-06-06 123 /* Loopback mode */
c19b6d246a35627 Zhao Qiang 2016-06-06 124 if (priv->loopback) {
c19b6d246a35627 Zhao Qiang 2016-06-06 125 dev_info(priv->dev, "Loopback Mode\n");
54e9e0874938ba5 Holger Brunck 2017-05-17 126 /* use the same clock when work in loopback */
54e9e0874938ba5 Holger Brunck 2017-05-17 127 qe_setbrg(ut_info->uf_info.rx_clock, 20000000, 1);
54e9e0874938ba5 Holger Brunck 2017-05-17 128
c19b6d246a35627 Zhao Qiang 2016-06-06 129 gumr = ioread32be(&priv->uf_regs->gumr);
c19b6d246a35627 Zhao Qiang 2016-06-06 130 gumr |= (UCC_FAST_GUMR_LOOPBACK | UCC_FAST_GUMR_CDS |
c19b6d246a35627 Zhao Qiang 2016-06-06 131 UCC_FAST_GUMR_TCI);
c19b6d246a35627 Zhao Qiang 2016-06-06 132 gumr &= ~(UCC_FAST_GUMR_CTSP | UCC_FAST_GUMR_RSYN);
c19b6d246a35627 Zhao Qiang 2016-06-06 133 iowrite32be(gumr, &priv->uf_regs->gumr);
c19b6d246a35627 Zhao Qiang 2016-06-06 134 }
c19b6d246a35627 Zhao Qiang 2016-06-06 135
c19b6d246a35627 Zhao Qiang 2016-06-06 136 /* Initialize SI */
c19b6d246a35627 Zhao Qiang 2016-06-06 137 if (priv->tsa)
c19b6d246a35627 Zhao Qiang 2016-06-06 138 ucc_tdm_init(priv->utdm, priv->ut_info);
c19b6d246a35627 Zhao Qiang 2016-06-06 139
c19b6d246a35627 Zhao Qiang 2016-06-06 140 /* Write to QE CECR, UCCx channel to Stop Transmission */
c19b6d246a35627 Zhao Qiang 2016-06-06 141 cecr_subblock = ucc_fast_get_qe_cr_subblock(uf_info->ucc_num);
c19b6d246a35627 Zhao Qiang 2016-06-06 142 ret = qe_issue_cmd(QE_STOP_TX, cecr_subblock,
c19b6d246a35627 Zhao Qiang 2016-06-06 143 QE_CR_PROTOCOL_UNSPECIFIED, 0);
c19b6d246a35627 Zhao Qiang 2016-06-06 144
c19b6d246a35627 Zhao Qiang 2016-06-06 145 /* Set UPSMR normal mode (need fixed)*/
c19b6d246a35627 Zhao Qiang 2016-06-06 146 iowrite32be(0, &priv->uf_regs->upsmr);
c19b6d246a35627 Zhao Qiang 2016-06-06 147
067bb938dad61e5 Holger Brunck 2017-05-17 148 /* hdlc_bus mode */
067bb938dad61e5 Holger Brunck 2017-05-17 149 if (priv->hdlc_bus) {
067bb938dad61e5 Holger Brunck 2017-05-17 150 u32 upsmr;
067bb938dad61e5 Holger Brunck 2017-05-17 151
067bb938dad61e5 Holger Brunck 2017-05-17 152 dev_info(priv->dev, "HDLC bus Mode\n");
067bb938dad61e5 Holger Brunck 2017-05-17 153 upsmr = ioread32be(&priv->uf_regs->upsmr);
067bb938dad61e5 Holger Brunck 2017-05-17 154
067bb938dad61e5 Holger Brunck 2017-05-17 155 /* bus mode and retransmit enable, with collision window
067bb938dad61e5 Holger Brunck 2017-05-17 156 * set to 8 bytes
067bb938dad61e5 Holger Brunck 2017-05-17 157 */
067bb938dad61e5 Holger Brunck 2017-05-17 158 upsmr |= UCC_HDLC_UPSMR_RTE | UCC_HDLC_UPSMR_BUS |
067bb938dad61e5 Holger Brunck 2017-05-17 159 UCC_HDLC_UPSMR_CW8;
067bb938dad61e5 Holger Brunck 2017-05-17 160 iowrite32be(upsmr, &priv->uf_regs->upsmr);
067bb938dad61e5 Holger Brunck 2017-05-17 161
067bb938dad61e5 Holger Brunck 2017-05-17 162 /* explicitly disable CDS & CTSP */
067bb938dad61e5 Holger Brunck 2017-05-17 163 gumr = ioread32be(&priv->uf_regs->gumr);
067bb938dad61e5 Holger Brunck 2017-05-17 164 gumr &= ~(UCC_FAST_GUMR_CDS | UCC_FAST_GUMR_CTSP);
067bb938dad61e5 Holger Brunck 2017-05-17 165 /* set automatic sync to explicitly ignore CD signal */
067bb938dad61e5 Holger Brunck 2017-05-17 166 gumr |= UCC_FAST_GUMR_SYNL_AUTO;
067bb938dad61e5 Holger Brunck 2017-05-17 167 iowrite32be(gumr, &priv->uf_regs->gumr);
067bb938dad61e5 Holger Brunck 2017-05-17 168 }
067bb938dad61e5 Holger Brunck 2017-05-17 169
c19b6d246a35627 Zhao Qiang 2016-06-06 170 priv->rx_ring_size = RX_BD_RING_LEN;
c19b6d246a35627 Zhao Qiang 2016-06-06 171 priv->tx_ring_size = TX_BD_RING_LEN;
c19b6d246a35627 Zhao Qiang 2016-06-06 172 /* Alloc Rx BD */
c19b6d246a35627 Zhao Qiang 2016-06-06 173 priv->rx_bd_base = dma_alloc_coherent(priv->dev,
5b8aad93c52bdda Holger Brunck 2017-05-17 174 RX_BD_RING_LEN * sizeof(struct qe_bd),
c19b6d246a35627 Zhao Qiang 2016-06-06 175 &priv->dma_rx_bd, GFP_KERNEL);
c19b6d246a35627 Zhao Qiang 2016-06-06 176
c19b6d246a35627 Zhao Qiang 2016-06-06 177 if (!priv->rx_bd_base) {
c19b6d246a35627 Zhao Qiang 2016-06-06 178 dev_err(priv->dev, "Cannot allocate MURAM memory for RxBDs\n");
c19b6d246a35627 Zhao Qiang 2016-06-06 179 ret = -ENOMEM;
1efb597d8bf56cb Zhao Qiang 2016-07-15 180 goto free_uccf;
c19b6d246a35627 Zhao Qiang 2016-06-06 181 }
c19b6d246a35627 Zhao Qiang 2016-06-06 182
c19b6d246a35627 Zhao Qiang 2016-06-06 183 /* Alloc Tx BD */
c19b6d246a35627 Zhao Qiang 2016-06-06 184 priv->tx_bd_base = dma_alloc_coherent(priv->dev,
5b8aad93c52bdda Holger Brunck 2017-05-17 185 TX_BD_RING_LEN * sizeof(struct qe_bd),
c19b6d246a35627 Zhao Qiang 2016-06-06 186 &priv->dma_tx_bd, GFP_KERNEL);
c19b6d246a35627 Zhao Qiang 2016-06-06 187
c19b6d246a35627 Zhao Qiang 2016-06-06 188 if (!priv->tx_bd_base) {
c19b6d246a35627 Zhao Qiang 2016-06-06 189 dev_err(priv->dev, "Cannot allocate MURAM memory for TxBDs\n");
c19b6d246a35627 Zhao Qiang 2016-06-06 190 ret = -ENOMEM;
1efb597d8bf56cb Zhao Qiang 2016-07-15 191 goto free_rx_bd;
c19b6d246a35627 Zhao Qiang 2016-06-06 192 }
c19b6d246a35627 Zhao Qiang 2016-06-06 193
c19b6d246a35627 Zhao Qiang 2016-06-06 194 /* Alloc parameter ram for ucc hdlc */
85deed56032b6c9 Holger Brunck 2017-05-22 195 priv->ucc_pram_offset = qe_muram_alloc(sizeof(struct ucc_hdlc_param),
c19b6d246a35627 Zhao Qiang 2016-06-06 196 ALIGNMENT_OF_UCC_HDLC_PRAM);
c19b6d246a35627 Zhao Qiang 2016-06-06 197
be2e9415f8b366a Rasmus Villemoes 2019-11-28 198 if (priv->ucc_pram_offset < 0) {
24a24d07d688a46 Colin Ian King 2016-08-28 199 dev_err(priv->dev, "Can not allocate MURAM for hdlc parameter.\n");
c19b6d246a35627 Zhao Qiang 2016-06-06 200 ret = -ENOMEM;
1efb597d8bf56cb Zhao Qiang 2016-07-15 201 goto free_tx_bd;
c19b6d246a35627 Zhao Qiang 2016-06-06 202 }
c19b6d246a35627 Zhao Qiang 2016-06-06 203
6396bb221514d28 Kees Cook 2018-06-12 204 priv->rx_skbuff = kcalloc(priv->rx_ring_size,
6396bb221514d28 Kees Cook 2018-06-12 205 sizeof(*priv->rx_skbuff),
c19b6d246a35627 Zhao Qiang 2016-06-06 206 GFP_KERNEL);
c19b6d246a35627 Zhao Qiang 2016-06-06 207 if (!priv->rx_skbuff)
1efb597d8bf56cb Zhao Qiang 2016-07-15 208 goto free_ucc_pram;
c19b6d246a35627 Zhao Qiang 2016-06-06 209
6396bb221514d28 Kees Cook 2018-06-12 210 priv->tx_skbuff = kcalloc(priv->tx_ring_size,
6396bb221514d28 Kees Cook 2018-06-12 211 sizeof(*priv->tx_skbuff),
c19b6d246a35627 Zhao Qiang 2016-06-06 212 GFP_KERNEL);
c19b6d246a35627 Zhao Qiang 2016-06-06 213 if (!priv->tx_skbuff)
1efb597d8bf56cb Zhao Qiang 2016-07-15 214 goto free_rx_skbuff;
c19b6d246a35627 Zhao Qiang 2016-06-06 215
c19b6d246a35627 Zhao Qiang 2016-06-06 216 priv->skb_curtx = 0;
c19b6d246a35627 Zhao Qiang 2016-06-06 217 priv->skb_dirtytx = 0;
c19b6d246a35627 Zhao Qiang 2016-06-06 218 priv->curtx_bd = priv->tx_bd_base;
c19b6d246a35627 Zhao Qiang 2016-06-06 219 priv->dirty_tx = priv->tx_bd_base;
c19b6d246a35627 Zhao Qiang 2016-06-06 220 priv->currx_bd = priv->rx_bd_base;
c19b6d246a35627 Zhao Qiang 2016-06-06 221 priv->currx_bdnum = 0;
c19b6d246a35627 Zhao Qiang 2016-06-06 222
c19b6d246a35627 Zhao Qiang 2016-06-06 223 /* init parameter base */
c19b6d246a35627 Zhao Qiang 2016-06-06 224 cecr_subblock = ucc_fast_get_qe_cr_subblock(uf_info->ucc_num);
c19b6d246a35627 Zhao Qiang 2016-06-06 225 ret = qe_issue_cmd(QE_ASSIGN_PAGE_TO_DEVICE, cecr_subblock,
c19b6d246a35627 Zhao Qiang 2016-06-06 226 QE_CR_PROTOCOL_UNSPECIFIED, priv->ucc_pram_offset);
c19b6d246a35627 Zhao Qiang 2016-06-06 227
c19b6d246a35627 Zhao Qiang 2016-06-06 228 priv->ucc_pram = (struct ucc_hdlc_param __iomem *)
c19b6d246a35627 Zhao Qiang 2016-06-06 229 qe_muram_addr(priv->ucc_pram_offset);
c19b6d246a35627 Zhao Qiang 2016-06-06 230
c19b6d246a35627 Zhao Qiang 2016-06-06 231 /* Zero out parameter ram */
c19b6d246a35627 Zhao Qiang 2016-06-06 232 memset_io(priv->ucc_pram, 0, sizeof(struct ucc_hdlc_param));
c19b6d246a35627 Zhao Qiang 2016-06-06 233
c19b6d246a35627 Zhao Qiang 2016-06-06 234 /* Alloc riptr, tiptr */
c19b6d246a35627 Zhao Qiang 2016-06-06 235 riptr = qe_muram_alloc(32, 32);
be2e9415f8b366a Rasmus Villemoes 2019-11-28 236 if (riptr < 0) {
c19b6d246a35627 Zhao Qiang 2016-06-06 237 dev_err(priv->dev, "Cannot allocate MURAM mem for Receive internal temp data pointer\n");
c19b6d246a35627 Zhao Qiang 2016-06-06 238 ret = -ENOMEM;
1efb597d8bf56cb Zhao Qiang 2016-07-15 239 goto free_tx_skbuff;
c19b6d246a35627 Zhao Qiang 2016-06-06 240 }
c19b6d246a35627 Zhao Qiang 2016-06-06 241
c19b6d246a35627 Zhao Qiang 2016-06-06 242 tiptr = qe_muram_alloc(32, 32);
be2e9415f8b366a Rasmus Villemoes 2019-11-28 243 if (tiptr < 0) {
c19b6d246a35627 Zhao Qiang 2016-06-06 244 dev_err(priv->dev, "Cannot allocate MURAM mem for Transmit internal temp data pointer\n");
c19b6d246a35627 Zhao Qiang 2016-06-06 245 ret = -ENOMEM;
1efb597d8bf56cb Zhao Qiang 2016-07-15 246 goto free_riptr;
c19b6d246a35627 Zhao Qiang 2016-06-06 247 }
148587a59f6b858 Rasmus Villemoes 2019-11-28 248 if (riptr != (u16)riptr || tiptr != (u16)tiptr) {
148587a59f6b858 Rasmus Villemoes 2019-11-28 249 dev_err(priv->dev, "MURAM allocation out of addressable range\n");
148587a59f6b858 Rasmus Villemoes 2019-11-28 250 ret = -ENOMEM;
148587a59f6b858 Rasmus Villemoes 2019-11-28 251 goto free_tiptr;
148587a59f6b858 Rasmus Villemoes 2019-11-28 252 }
c19b6d246a35627 Zhao Qiang 2016-06-06 253
c19b6d246a35627 Zhao Qiang 2016-06-06 254 /* Set RIPTR, TIPTR */
c19b6d246a35627 Zhao Qiang 2016-06-06 255 iowrite16be(riptr, &priv->ucc_pram->riptr);
c19b6d246a35627 Zhao Qiang 2016-06-06 256 iowrite16be(tiptr, &priv->ucc_pram->tiptr);
c19b6d246a35627 Zhao Qiang 2016-06-06 257
c19b6d246a35627 Zhao Qiang 2016-06-06 258 /* Set MRBLR */
c19b6d246a35627 Zhao Qiang 2016-06-06 259 iowrite16be(MAX_RX_BUF_LENGTH, &priv->ucc_pram->mrblr);
c19b6d246a35627 Zhao Qiang 2016-06-06 260
c19b6d246a35627 Zhao Qiang 2016-06-06 261 /* Set RBASE, TBASE */
c19b6d246a35627 Zhao Qiang 2016-06-06 262 iowrite32be(priv->dma_rx_bd, &priv->ucc_pram->rbase);
c19b6d246a35627 Zhao Qiang 2016-06-06 263 iowrite32be(priv->dma_tx_bd, &priv->ucc_pram->tbase);
c19b6d246a35627 Zhao Qiang 2016-06-06 264
c19b6d246a35627 Zhao Qiang 2016-06-06 265 /* Set RSTATE, TSTATE */
c19b6d246a35627 Zhao Qiang 2016-06-06 266 iowrite32be(BMR_GBL | BMR_BIG_ENDIAN, &priv->ucc_pram->rstate);
c19b6d246a35627 Zhao Qiang 2016-06-06 267 iowrite32be(BMR_GBL | BMR_BIG_ENDIAN, &priv->ucc_pram->tstate);
c19b6d246a35627 Zhao Qiang 2016-06-06 268
c19b6d246a35627 Zhao Qiang 2016-06-06 269 /* Set C_MASK, C_PRES for 16bit CRC */
c19b6d246a35627 Zhao Qiang 2016-06-06 270 iowrite32be(CRC_16BIT_MASK, &priv->ucc_pram->c_mask);
c19b6d246a35627 Zhao Qiang 2016-06-06 271 iowrite32be(CRC_16BIT_PRES, &priv->ucc_pram->c_pres);
c19b6d246a35627 Zhao Qiang 2016-06-06 272
c19b6d246a35627 Zhao Qiang 2016-06-06 273 iowrite16be(MAX_FRAME_LENGTH, &priv->ucc_pram->mflr);
c19b6d246a35627 Zhao Qiang 2016-06-06 274 iowrite16be(DEFAULT_RFTHR, &priv->ucc_pram->rfthr);
c19b6d246a35627 Zhao Qiang 2016-06-06 275 iowrite16be(DEFAULT_RFTHR, &priv->ucc_pram->rfcnt);
045f77baf6b429a David Gounaris 2018-09-03 276 iowrite16be(priv->hmask, &priv->ucc_pram->hmask);
c19b6d246a35627 Zhao Qiang 2016-06-06 277 iowrite16be(DEFAULT_HDLC_ADDR, &priv->ucc_pram->haddr1);
c19b6d246a35627 Zhao Qiang 2016-06-06 278 iowrite16be(DEFAULT_HDLC_ADDR, &priv->ucc_pram->haddr2);
c19b6d246a35627 Zhao Qiang 2016-06-06 279 iowrite16be(DEFAULT_HDLC_ADDR, &priv->ucc_pram->haddr3);
c19b6d246a35627 Zhao Qiang 2016-06-06 280 iowrite16be(DEFAULT_HDLC_ADDR, &priv->ucc_pram->haddr4);
c19b6d246a35627 Zhao Qiang 2016-06-06 281
c19b6d246a35627 Zhao Qiang 2016-06-06 282 /* Get BD buffer */
750afb08ca71310 Luis Chamberlain 2019-01-04 283 bd_buffer = dma_alloc_coherent(priv->dev,
750afb08ca71310 Luis Chamberlain 2019-01-04 284 (RX_BD_RING_LEN + TX_BD_RING_LEN) * MAX_RX_BUF_LENGTH,
c19b6d246a35627 Zhao Qiang 2016-06-06 285 &bd_dma_addr, GFP_KERNEL);
c19b6d246a35627 Zhao Qiang 2016-06-06 286
c19b6d246a35627 Zhao Qiang 2016-06-06 287 if (!bd_buffer) {
c19b6d246a35627 Zhao Qiang 2016-06-06 288 dev_err(priv->dev, "Could not allocate buffer descriptors\n");
c19b6d246a35627 Zhao Qiang 2016-06-06 289 ret = -ENOMEM;
1efb597d8bf56cb Zhao Qiang 2016-07-15 290 goto free_tiptr;
c19b6d246a35627 Zhao Qiang 2016-06-06 291 }
c19b6d246a35627 Zhao Qiang 2016-06-06 292
c19b6d246a35627 Zhao Qiang 2016-06-06 293 priv->rx_buffer = bd_buffer;
c19b6d246a35627 Zhao Qiang 2016-06-06 294 priv->tx_buffer = bd_buffer + RX_BD_RING_LEN * MAX_RX_BUF_LENGTH;
c19b6d246a35627 Zhao Qiang 2016-06-06 295
c19b6d246a35627 Zhao Qiang 2016-06-06 296 priv->dma_rx_addr = bd_dma_addr;
c19b6d246a35627 Zhao Qiang 2016-06-06 297 priv->dma_tx_addr = bd_dma_addr + RX_BD_RING_LEN * MAX_RX_BUF_LENGTH;
c19b6d246a35627 Zhao Qiang 2016-06-06 298
c19b6d246a35627 Zhao Qiang 2016-06-06 299 for (i = 0; i < RX_BD_RING_LEN; i++) {
c19b6d246a35627 Zhao Qiang 2016-06-06 300 if (i < (RX_BD_RING_LEN - 1))
c19b6d246a35627 Zhao Qiang 2016-06-06 301 bd_status = R_E_S | R_I_S;
c19b6d246a35627 Zhao Qiang 2016-06-06 302 else
c19b6d246a35627 Zhao Qiang 2016-06-06 303 bd_status = R_E_S | R_I_S | R_W_S;
c19b6d246a35627 Zhao Qiang 2016-06-06 304
c19b6d246a35627 Zhao Qiang 2016-06-06 @305 iowrite16be(bd_status, &priv->rx_bd_base[i].status);
c19b6d246a35627 Zhao Qiang 2016-06-06 306 iowrite32be(priv->dma_rx_addr + i * MAX_RX_BUF_LENGTH,
c19b6d246a35627 Zhao Qiang 2016-06-06 307 &priv->rx_bd_base[i].buf);
c19b6d246a35627 Zhao Qiang 2016-06-06 308 }
c19b6d246a35627 Zhao Qiang 2016-06-06 309
c19b6d246a35627 Zhao Qiang 2016-06-06 310 for (i = 0; i < TX_BD_RING_LEN; i++) {
c19b6d246a35627 Zhao Qiang 2016-06-06 311 if (i < (TX_BD_RING_LEN - 1))
c19b6d246a35627 Zhao Qiang 2016-06-06 312 bd_status = T_I_S | T_TC_S;
c19b6d246a35627 Zhao Qiang 2016-06-06 313 else
c19b6d246a35627 Zhao Qiang 2016-06-06 314 bd_status = T_I_S | T_TC_S | T_W_S;
c19b6d246a35627 Zhao Qiang 2016-06-06 315
c19b6d246a35627 Zhao Qiang 2016-06-06 316 iowrite16be(bd_status, &priv->tx_bd_base[i].status);
c19b6d246a35627 Zhao Qiang 2016-06-06 317 iowrite32be(priv->dma_tx_addr + i * MAX_RX_BUF_LENGTH,
c19b6d246a35627 Zhao Qiang 2016-06-06 318 &priv->tx_bd_base[i].buf);
c19b6d246a35627 Zhao Qiang 2016-06-06 319 }
c19b6d246a35627 Zhao Qiang 2016-06-06 320
c19b6d246a35627 Zhao Qiang 2016-06-06 321 return 0;
c19b6d246a35627 Zhao Qiang 2016-06-06 322
1efb597d8bf56cb Zhao Qiang 2016-07-15 323 free_tiptr:
c19b6d246a35627 Zhao Qiang 2016-06-06 324 qe_muram_free(tiptr);
1efb597d8bf56cb Zhao Qiang 2016-07-15 325 free_riptr:
c19b6d246a35627 Zhao Qiang 2016-06-06 326 qe_muram_free(riptr);
1efb597d8bf56cb Zhao Qiang 2016-07-15 327 free_tx_skbuff:
c19b6d246a35627 Zhao Qiang 2016-06-06 328 kfree(priv->tx_skbuff);
1efb597d8bf56cb Zhao Qiang 2016-07-15 329 free_rx_skbuff:
c19b6d246a35627 Zhao Qiang 2016-06-06 330 kfree(priv->rx_skbuff);
1efb597d8bf56cb Zhao Qiang 2016-07-15 331 free_ucc_pram:
c19b6d246a35627 Zhao Qiang 2016-06-06 332 qe_muram_free(priv->ucc_pram_offset);
1efb597d8bf56cb Zhao Qiang 2016-07-15 333 free_tx_bd:
c19b6d246a35627 Zhao Qiang 2016-06-06 334 dma_free_coherent(priv->dev,
5b8aad93c52bdda Holger Brunck 2017-05-17 335 TX_BD_RING_LEN * sizeof(struct qe_bd),
c19b6d246a35627 Zhao Qiang 2016-06-06 336 priv->tx_bd_base, priv->dma_tx_bd);
1efb597d8bf56cb Zhao Qiang 2016-07-15 337 free_rx_bd:
c19b6d246a35627 Zhao Qiang 2016-06-06 338 dma_free_coherent(priv->dev,
5b8aad93c52bdda Holger Brunck 2017-05-17 339 RX_BD_RING_LEN * sizeof(struct qe_bd),
c19b6d246a35627 Zhao Qiang 2016-06-06 340 priv->rx_bd_base, priv->dma_rx_bd);
1efb597d8bf56cb Zhao Qiang 2016-07-15 341 free_uccf:
c19b6d246a35627 Zhao Qiang 2016-06-06 342 ucc_fast_free(priv->uccf);
c19b6d246a35627 Zhao Qiang 2016-06-06 343
c19b6d246a35627 Zhao Qiang 2016-06-06 344 return ret;
c19b6d246a35627 Zhao Qiang 2016-06-06 345 }
c19b6d246a35627 Zhao Qiang 2016-06-06 346
:::::: The code at line 305 was first introduced by commit
:::::: c19b6d246a35627c3a69b2fa6bdece212b48214b drivers/net: support hdlc function for QE-UCC
:::::: TO: Zhao Qiang <qiang.zhao(a)nxp.com>
:::::: CC: David S. Miller <davem(a)davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[linux-next:master 5653/9209] drivers/scsi/mpi3mr/mpi3mr_fw.c:1172:2: warning: 'strncpy' output may be truncated copying 16 bytes from a string of length 64
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 25fe90f43fa312213b653dc1f12fd2d80f855883
commit: 824a156633dfdb0e17979a0d0bb2c757d1bb949c [5653/9209] scsi: mpi3mr: Base driver code
config: x86_64-randconfig-r031-20210615 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
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 824a156633dfdb0e17979a0d0bb2c757d1bb949c
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/scsi/mpi3mr/mpi3mr_fw.c: In function 'mpi3mr_issue_iocinit':
>> drivers/scsi/mpi3mr/mpi3mr_fw.c:1172:2: warning: 'strncpy' output may be truncated copying 16 bytes from a string of length 64 [-Wstringop-truncation]
1172 | strncpy(drv_info->os_name, utsname()->sysname, sizeof(drv_info->os_name));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/mpi3mr/mpi3mr_fw.c:1174:2: warning: 'strncpy' output may be truncated copying 12 bytes from a string of length 64 [-Wstringop-truncation]
1174 | strncpy(drv_info->os_version, utsname()->release, sizeof(drv_info->os_version));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/strncpy +1172 drivers/scsi/mpi3mr/mpi3mr_fw.c
1145
1146 /**
1147 * mpi3mr_issue_iocinit - Send IOC Init
1148 * @mrioc: Adapter instance reference
1149 *
1150 * Issue IOC Init MPI request through admin queue and wait for
1151 * the completion of it or time out.
1152 *
1153 * Return: 0 on success, non-zero on failures.
1154 */
1155 static int mpi3mr_issue_iocinit(struct mpi3mr_ioc *mrioc)
1156 {
1157 struct mpi3_ioc_init_request iocinit_req;
1158 struct mpi3_driver_info_layout *drv_info;
1159 dma_addr_t data_dma;
1160 u32 data_len = sizeof(*drv_info);
1161 int retval = 0;
1162 ktime_t current_time;
1163
1164 drv_info = dma_alloc_coherent(&mrioc->pdev->dev, data_len, &data_dma,
1165 GFP_KERNEL);
1166 if (!drv_info) {
1167 retval = -1;
1168 goto out;
1169 }
1170 drv_info->information_length = cpu_to_le32(data_len);
1171 strncpy(drv_info->driver_signature, "Broadcom", sizeof(drv_info->driver_signature));
> 1172 strncpy(drv_info->os_name, utsname()->sysname, sizeof(drv_info->os_name));
1173 drv_info->os_name[sizeof(drv_info->os_name) - 1] = 0;
1174 strncpy(drv_info->os_version, utsname()->release, sizeof(drv_info->os_version));
1175 drv_info->os_version[sizeof(drv_info->os_version) - 1] = 0;
1176 strncpy(drv_info->driver_name, MPI3MR_DRIVER_NAME, sizeof(drv_info->driver_name));
1177 strncpy(drv_info->driver_version, MPI3MR_DRIVER_VERSION, sizeof(drv_info->driver_version));
1178 strncpy(drv_info->driver_release_date, MPI3MR_DRIVER_RELDATE, sizeof(drv_info->driver_release_date));
1179 drv_info->driver_capabilities = 0;
1180 memcpy((u8 *)&mrioc->driver_info, (u8 *)drv_info,
1181 sizeof(mrioc->driver_info));
1182
1183 memset(&iocinit_req, 0, sizeof(iocinit_req));
1184 mutex_lock(&mrioc->init_cmds.mutex);
1185 if (mrioc->init_cmds.state & MPI3MR_CMD_PENDING) {
1186 retval = -1;
1187 ioc_err(mrioc, "Issue IOCInit: Init command is in use\n");
1188 mutex_unlock(&mrioc->init_cmds.mutex);
1189 goto out;
1190 }
1191 mrioc->init_cmds.state = MPI3MR_CMD_PENDING;
1192 mrioc->init_cmds.is_waiting = 1;
1193 mrioc->init_cmds.callback = NULL;
1194 iocinit_req.host_tag = cpu_to_le16(MPI3MR_HOSTTAG_INITCMDS);
1195 iocinit_req.function = MPI3_FUNCTION_IOC_INIT;
1196 iocinit_req.mpi_version.mpi3_version.dev = MPI3_VERSION_DEV;
1197 iocinit_req.mpi_version.mpi3_version.unit = MPI3_VERSION_UNIT;
1198 iocinit_req.mpi_version.mpi3_version.major = MPI3_VERSION_MAJOR;
1199 iocinit_req.mpi_version.mpi3_version.minor = MPI3_VERSION_MINOR;
1200 iocinit_req.who_init = MPI3_WHOINIT_HOST_DRIVER;
1201 iocinit_req.reply_free_queue_depth = cpu_to_le16(mrioc->reply_free_qsz);
1202 iocinit_req.reply_free_queue_address =
1203 cpu_to_le64(mrioc->reply_free_q_dma);
1204 iocinit_req.sense_buffer_length = cpu_to_le16(MPI3MR_SENSEBUF_SZ);
1205 iocinit_req.sense_buffer_free_queue_depth =
1206 cpu_to_le16(mrioc->sense_buf_q_sz);
1207 iocinit_req.sense_buffer_free_queue_address =
1208 cpu_to_le64(mrioc->sense_buf_q_dma);
1209 iocinit_req.driver_information_address = cpu_to_le64(data_dma);
1210
1211 current_time = ktime_get_real();
1212 iocinit_req.time_stamp = cpu_to_le64(ktime_to_ms(current_time));
1213
1214 init_completion(&mrioc->init_cmds.done);
1215 retval = mpi3mr_admin_request_post(mrioc, &iocinit_req,
1216 sizeof(iocinit_req), 1);
1217 if (retval) {
1218 ioc_err(mrioc, "Issue IOCInit: Admin Post failed\n");
1219 goto out_unlock;
1220 }
1221 wait_for_completion_timeout(&mrioc->init_cmds.done,
1222 (MPI3MR_INTADMCMD_TIMEOUT * HZ));
1223 if (!(mrioc->init_cmds.state & MPI3MR_CMD_COMPLETE)) {
1224 mpi3mr_set_diagsave(mrioc);
1225 mpi3mr_issue_reset(mrioc,
1226 MPI3_SYSIF_HOST_DIAG_RESET_ACTION_DIAG_FAULT,
1227 MPI3MR_RESET_FROM_IOCINIT_TIMEOUT);
1228 mrioc->unrecoverable = 1;
1229 ioc_err(mrioc, "Issue IOCInit: command timed out\n");
1230 retval = -1;
1231 goto out_unlock;
1232 }
1233 if ((mrioc->init_cmds.ioc_status & MPI3_IOCSTATUS_STATUS_MASK)
1234 != MPI3_IOCSTATUS_SUCCESS) {
1235 ioc_err(mrioc,
1236 "Issue IOCInit: Failed ioc_status(0x%04x) Loginfo(0x%08x)\n",
1237 (mrioc->init_cmds.ioc_status & MPI3_IOCSTATUS_STATUS_MASK),
1238 mrioc->init_cmds.ioc_loginfo);
1239 retval = -1;
1240 goto out_unlock;
1241 }
1242
1243 out_unlock:
1244 mrioc->init_cmds.state = MPI3MR_CMD_NOTUSED;
1245 mutex_unlock(&mrioc->init_cmds.mutex);
1246
1247 out:
1248 if (drv_info)
1249 dma_free_coherent(&mrioc->pdev->dev, data_len, drv_info,
1250 data_dma);
1251
1252 return retval;
1253 }
1254
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
arch/powerpc/include/asm/page.h:24:20: warning: conversion from 'long unsigned int' to 'u16' {aka 'short unsigned int'} changes value from '262144' to '0'
by kernel test robot
Hi Christophe,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 009c9aa5be652675a06d5211e1640e02bbb1c33d
commit: 4eeef098b43242ed145c83fba9989d586d707589 powerpc/44x: Remove STDBINUTILS kconfig option
date: 5 months ago
config: powerpc-randconfig-r032-20210615 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.0
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
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 4eeef098b43242ed145c83fba9989d586d707589
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from arch/powerpc/include/asm/thread_info.h:13,
from include/linux/thread_info.h:56,
from include/asm-generic/preempt.h:5,
from ./arch/powerpc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/umh.h:4,
from include/linux/kmod.h:9,
from include/linux/module.h:16,
from drivers/net/vmxnet3/vmxnet3_drv.c:27:
drivers/net/vmxnet3/vmxnet3_drv.c: In function 'vmxnet3_rq_init':
>> arch/powerpc/include/asm/page.h:24:20: warning: conversion from 'long unsigned int' to 'u16' {aka 'short unsigned int'} changes value from '262144' to '0' [-Woverflow]
24 | #define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
| ^
drivers/net/vmxnet3/vmxnet3_drv.c:1784:29: note: in expansion of macro 'PAGE_SIZE'
1784 | rq->buf_info[0][i].len = PAGE_SIZE;
| ^~~~~~~~~
>> arch/powerpc/include/asm/page.h:24:20: warning: conversion from 'long unsigned int' to 'u16' {aka 'short unsigned int'} changes value from '262144' to '0' [-Woverflow]
24 | #define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
| ^
drivers/net/vmxnet3/vmxnet3_drv.c:1789:28: note: in expansion of macro 'PAGE_SIZE'
1789 | rq->buf_info[1][i].len = PAGE_SIZE;
| ^~~~~~~~~
vim +24 arch/powerpc/include/asm/page.h
5cd16ee934eafc include/asm-powerpc/page.h Michael Ellerman 2005-11-11 16
5cd16ee934eafc include/asm-powerpc/page.h Michael Ellerman 2005-11-11 17 /*
e12401222f749c arch/powerpc/include/asm/page.h Yuri Tikhonov 2009-01-29 18 * On regular PPC32 page size is 4K (but we support 4K/16K/64K/256K pages
555f4fdb93e70d arch/powerpc/include/asm/page.h Christophe Leroy 2019-02-21 19 * on PPC44x and 4K/16K on 8xx). For PPC64 we support either 4K or 64K software
5cd16ee934eafc include/asm-powerpc/page.h Michael Ellerman 2005-11-11 20 * page size. When using 64K pages however, whether we are really supporting
5cd16ee934eafc include/asm-powerpc/page.h Michael Ellerman 2005-11-11 21 * 64K pages in HW or not is irrelevant to those definitions.
5cd16ee934eafc include/asm-powerpc/page.h Michael Ellerman 2005-11-11 22 */
555f4fdb93e70d arch/powerpc/include/asm/page.h Christophe Leroy 2019-02-21 23 #define PAGE_SHIFT CONFIG_PPC_PAGE_SHIFT
5cd16ee934eafc include/asm-powerpc/page.h Michael Ellerman 2005-11-11 @24 #define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
5cd16ee934eafc include/asm-powerpc/page.h Michael Ellerman 2005-11-11 25
:::::: The code at line 24 was first introduced by commit
:::::: 5cd16ee934eafca74a6bb790328950cec68a8b78 [PATCH] powerpc: Merge page.h
:::::: TO: Michael Ellerman <michael(a)ellerman.id.au>
:::::: CC: Paul Mackerras <paulus(a)samba.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months