tree: https://github.com/superna9999/linux v6.1/amlogic/spicc-dma head: 683cea730cdabf850910c5cd1da3001da3cbb9d0 commit: 683cea730cdabf850910c5cd1da3001da3cbb9d0 [3/3] Add dma for spicc config: arm-randconfig-r002-20220912 compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 1546df49f5a6d09df78f569e4137ddb365a3e827) 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 arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi # https://github.com/superna9999/linux/commit/683cea730cdabf850910c5cd1da3001da3cbb9d0 git remote add superna9999 https://github.com/superna9999/linux git fetch --no-tags superna9999 v6.1/amlogic/spicc-dma git checkout 683cea730cdabf850910c5cd1da3001da3cbb9d0 # 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=arm SHELL=/bin/bash drivers/spi/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/spi/spi-meson-spicc.c:334:81: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat] dev_info(&spicc->pdev->dev, "setting DMA burst (remain %d words %d req %d)\n", spicc->xfer_remain, words, req); ~~ ^~~~~~~~~~~~~~~~~~ %lu include/linux/dev_printk.h:150:67: note: expanded from macro 'dev_info' dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__) ~~~ ^~~~~~~~~~~ include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap' _p_func(dev, fmt, ##__VA_ARGS__); \ ~~~ ^~~~~~~~~~~ >> drivers/spi/spi-meson-spicc.c:334:108: warning: variable 'req' is uninitialized when used here [-Wuninitialized] dev_info(&spicc->pdev->dev, "setting DMA burst (remain %d words %d req %d)\n", spicc->xfer_remain, words, req); ^~~ include/linux/dev_printk.h:150:67: note: expanded from macro 'dev_info' dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~~ include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap' _p_func(dev, fmt, ##__VA_ARGS__); \ ^~~~~~~~~~~ drivers/spi/spi-meson-spicc.c:319:25: note: initialize the variable 'req' to silence this warning unsigned int words, req; ^ = 0 drivers/spi/spi-meson-spicc.c:232:12: warning: unused function 'meson_spicc_calc_dma_len' [-Wunused-function] static u32 meson_spicc_calc_dma_len(struct meson_spicc_device *spicc, u32 *req) ^ 3 warnings generated. vim +334 drivers/spi/spi-meson-spicc.c 263 264 #if 0 265 static void meson_spicc_setup_dma_burst(struct meson_spicc_device *spicc) 266 { 267 unsigned int words, req; 268 unsigned int count_en = 0; 269 unsigned int txfifo_thres = 0; 270 unsigned int read_req = 0; 271 unsigned int rxfifo_thres = 31; 272 unsigned int write_req = 0; 273 unsigned int ld_ctr1 = 0; 274 275 pr_info("%s: SPICC_DMAREG %x SPICC_LD_CNTL1 %x TESTREG %x\n", __func__, readl_relaxed(spicc->base + SPICC_DMAREG), readl_relaxed(spicc->base + SPICC_LD_CNTL1), readl_relaxed(spicc->base + SPICC_TESTREG) & 0x3ff); 276 277 words = meson_spicc_calc_dma_len(spicc, &req); 278 279 dev_info(&spicc->pdev->dev, "setting DMA burst (remain %d words %d req %d)\n", spicc->xfer_remain, words, req); 280 281 /* Setup Xfer variables */ 282 spicc->xfer_remain -= words * spicc->bytes_per_word; 283 284 //words /= req; 285 if (spicc->tx_buf) { 286 count_en |= DMA_WRITE_COUNTER_EN; 287 txfifo_thres = req - 1; //spicc->bytes_per_word; //req; //spicc->data->fifo_size + 1 - req; 288 write_req = 0; 289 ld_ctr1 |= FIELD_PREP(DMA_WRITE_COUNTER, words); 290 } 291 292 if (spicc->rx_buf) { 293 count_en |= DMA_READ_COUNTER_EN; 294 rxfifo_thres = 0; //req - 1; 295 read_req = req - 1; 296 ld_ctr1 |= FIELD_PREP(DMA_READ_COUNTER, words << 1); 297 } 298 299 dev_info(&spicc->pdev->dev, "setting DMA conf (txfifo_thres %d rxfifo_thres %d read_req %d write_req %d)\n", txfifo_thres, rxfifo_thres, read_req, write_req); 300 301 /* Enable DMA write/read counter */ 302 writel_relaxed(count_en, spicc->base + SPICC_LD_CNTL0); 303 304 /* Setup burst length */ 305 writel_relaxed(ld_ctr1, spicc->base + SPICC_LD_CNTL1); 306 307 writel_relaxed(SPICC_DMA_ENABLE | SPICC_DMA_URGENT | 308 FIELD_PREP(SPICC_TXFIFO_THRESHOLD_MASK, txfifo_thres) | 309 FIELD_PREP(SPICC_READ_BURST_MASK, read_req) | 310 FIELD_PREP(SPICC_RXFIFO_THRESHOLD_MASK, rxfifo_thres) | 311 FIELD_PREP(SPICC_WRITE_BURST_MASK, write_req), 312 spicc->base + SPICC_DMAREG); 313 314 pr_info("%s: SPICC_DMAREG %x\n", __func__, readl_relaxed(spicc->base + SPICC_DMAREG)); 315 } 316 #else 317 static void meson_spicc_setup_dma_burst(struct meson_spicc_device *spicc) 318 { 319 unsigned int words, req; 320 unsigned int count_en = 0; 321 unsigned int txfifo_thres = 0; 322 unsigned int read_req = 1; 323 unsigned int rxfifo_thres = 31; 324 unsigned int write_req = 1; 325 unsigned int ld_ctr1 = 0; 326 327 pr_info("%s: SPICC_DMAREG %x SPICC_LD_CNTL1 %x TESTREG %x\n", __func__, readl_relaxed(spicc->base + SPICC_DMAREG), readl_relaxed(spicc->base + SPICC_LD_CNTL1), readl_relaxed(spicc->base + SPICC_TESTREG) & 0x3ff); 328 329 //words = meson_spicc_calc_dma_len(spicc, &req); 330 words = min_t(unsigned int, 331 spicc->xfer_remain / spicc->bytes_per_word, 332 spicc->data->fifo_size); 333 > 334 dev_info(&spicc->pdev->dev, "setting DMA burst (remain %d words %d req %d)\n", spicc->xfer_remain, words, req); 335 336 writel_bits_relaxed(SPICC_BURSTLENGTH_MASK, 337 FIELD_PREP(SPICC_BURSTLENGTH_MASK, 338 words - 1), 339 spicc->base + SPICC_CONREG); 340 341 /* Setup Xfer variables */ 342 spicc->xfer_remain -= words * spicc->bytes_per_word; 343 344 //words /= req; 345 if (spicc->tx_buf) { 346 count_en |= DMA_WRITE_COUNTER_EN; 347 txfifo_thres = spicc->bytes_per_word - 1; 348 write_req = words - 1; 349 ld_ctr1 |= FIELD_PREP(DMA_WRITE_COUNTER, 1); 350 } 351 352 if (spicc->rx_buf) { 353 count_en |= DMA_READ_COUNTER_EN; 354 rxfifo_thres = words - 1; 355 read_req = words - 1; 356 ld_ctr1 |= FIELD_PREP(DMA_READ_COUNTER, 1); 357 } 358 359 dev_info(&spicc->pdev->dev, "setting DMA conf (txfifo_thres %d rxfifo_thres %d read_req %d write_req %d)\n", txfifo_thres, rxfifo_thres, read_req, write_req); 360 361 /* Enable DMA write/read counter */ 362 writel_relaxed(count_en, spicc->base + SPICC_LD_CNTL0); 363 364 /* Setup burst length */ 365 writel_relaxed(ld_ctr1, spicc->base + SPICC_LD_CNTL1); 366 367 writel_relaxed(SPICC_DMA_ENABLE | SPICC_DMA_URGENT | 368 FIELD_PREP(SPICC_TXFIFO_THRESHOLD_MASK, txfifo_thres) | 369 FIELD_PREP(SPICC_READ_BURST_MASK, read_req) | 370 FIELD_PREP(SPICC_RXFIFO_THRESHOLD_MASK, rxfifo_thres) | 371 FIELD_PREP(SPICC_WRITE_BURST_MASK, write_req), 372 spicc->base + SPICC_DMAREG); 373 374 pr_info("%s: SPICC_DMAREG %x\n", __func__, readl_relaxed(spicc->base + SPICC_DMAREG)); 375 } 376 #endif 377 -- 0-DAY CI Kernel Test Service https://01.org/lkp