drivers/video/fbdev/mx3fb.c:1336:26: sparse: sparse: incorrect type in assignment (different address spaces)

From: kernel test robot
Date: Wed Aug 19 2020 - 09:55:40 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 18445bf405cb331117bc98427b1ba6f12418ad17
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 9 weeks ago
config: arm64-randconfig-s031-20200819 (attached as .config)
compiler: aarch64-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.2-183-gaa6ede3b-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# 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__' ARCH=arm64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

>> drivers/video/fbdev/mx3fb.c:1336:26: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected char [noderef] __iomem *screen_base @@ got void * @@
>> drivers/video/fbdev/mx3fb.c:1336:26: sparse: expected char [noderef] __iomem *screen_base
drivers/video/fbdev/mx3fb.c:1336:26: sparse: got void *
>> drivers/video/fbdev/mx3fb.c:1359:17: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/video/fbdev/mx3fb.c:1377:56: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void *cpu_addr @@ got char [noderef] __iomem *screen_base @@
drivers/video/fbdev/mx3fb.c:1377:56: sparse: expected void *cpu_addr
>> drivers/video/fbdev/mx3fb.c:1377:56: sparse: got char [noderef] __iomem *screen_base
drivers/video/fbdev/mx3fb.c:1094:25: sparse: sparse: cast removes address space '__iomem' of expression

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=670d0a4b10704667765f7d18f7592993d02783aa
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
vim +1336 drivers/video/fbdev/mx3fb.c

86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1313
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1314 /*
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1315 * Main framebuffer functions
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1316 */
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1317
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1318 /**
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1319 * mx3fb_map_video_memory() - allocates the DRAM memory for the frame buffer.
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1320 * @fbi: framebuffer information pointer
537a1bf059fa31 drivers/video/mx3fb.c Krzysztof Helt 2009-06-30 1321 * @mem_len: length of mapped memory
20de03dae54e10 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-08-06 1322 * @lock: do not lock during initialisation
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1323 * @return: Error code indicating success or failure
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1324 *
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1325 * This buffer is remapped into a non-cached, non-buffered, memory region to
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1326 * allow palette and pixel writes to occur without flushing the cache. Once this
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1327 * area is remapped, all virtual memory access to the video memory should occur
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1328 * at the new region.
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1329 */
20de03dae54e10 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-08-06 1330 static int mx3fb_map_video_memory(struct fb_info *fbi, unsigned int mem_len,
20de03dae54e10 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-08-06 1331 bool lock)
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1332 {
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1333 int retval = 0;
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1334 dma_addr_t addr;
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1335
f6e45661f9be54 drivers/video/fbdev/mx3fb.c Luis R. Rodriguez 2016-01-22 @1336 fbi->screen_base = dma_alloc_wc(fbi->device, mem_len, &addr,
f6e45661f9be54 drivers/video/fbdev/mx3fb.c Luis R. Rodriguez 2016-01-22 1337 GFP_DMA | GFP_KERNEL);
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1338
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1339 if (!fbi->screen_base) {
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1340 dev_err(fbi->device, "Cannot allocate %u bytes framebuffer memory\n",
537a1bf059fa31 drivers/video/mx3fb.c Krzysztof Helt 2009-06-30 1341 mem_len);
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1342 retval = -EBUSY;
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1343 goto err0;
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1344 }
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1345
20de03dae54e10 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-08-06 1346 if (lock)
537a1bf059fa31 drivers/video/mx3fb.c Krzysztof Helt 2009-06-30 1347 mutex_lock(&fbi->mm_lock);
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1348 fbi->fix.smem_start = addr;
537a1bf059fa31 drivers/video/mx3fb.c Krzysztof Helt 2009-06-30 1349 fbi->fix.smem_len = mem_len;
20de03dae54e10 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-08-06 1350 if (lock)
537a1bf059fa31 drivers/video/mx3fb.c Krzysztof Helt 2009-06-30 1351 mutex_unlock(&fbi->mm_lock);
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1352
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1353 dev_dbg(fbi->device, "allocated fb @ p=0x%08x, v=0x%p, size=%d.\n",
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1354 (uint32_t) fbi->fix.smem_start, fbi->screen_base, fbi->fix.smem_len);
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1355
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1356 fbi->screen_size = fbi->fix.smem_len;
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1357
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1358 /* Clear the screen */
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 @1359 memset((char *)fbi->screen_base, 0, fbi->fix.smem_len);
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1360
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1361 return 0;
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1362
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1363 err0:
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1364 fbi->fix.smem_len = 0;
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1365 fbi->fix.smem_start = 0;
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1366 fbi->screen_base = NULL;
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1367 return retval;
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1368 }
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1369
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1370 /**
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1371 * mx3fb_unmap_video_memory() - de-allocate frame buffer memory.
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1372 * @fbi: framebuffer information pointer
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1373 * @return: error code indicating success or failure
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1374 */
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1375 static int mx3fb_unmap_video_memory(struct fb_info *fbi)
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1376 {
f6e45661f9be54 drivers/video/fbdev/mx3fb.c Luis R. Rodriguez 2016-01-22 @1377 dma_free_wc(fbi->device, fbi->fix.smem_len, fbi->screen_base,
f6e45661f9be54 drivers/video/fbdev/mx3fb.c Luis R. Rodriguez 2016-01-22 1378 fbi->fix.smem_start);
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1379
f3d8496e9c8418 drivers/video/mx3fb.c Fabio Estevam 2013-02-21 1380 fbi->screen_base = NULL;
537a1bf059fa31 drivers/video/mx3fb.c Krzysztof Helt 2009-06-30 1381 mutex_lock(&fbi->mm_lock);
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1382 fbi->fix.smem_start = 0;
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1383 fbi->fix.smem_len = 0;
537a1bf059fa31 drivers/video/mx3fb.c Krzysztof Helt 2009-06-30 1384 mutex_unlock(&fbi->mm_lock);
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1385 return 0;
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1386 }
86528da229a448 drivers/video/mx3fb.c Guennadi Liakhovetski 2009-01-21 1387

:::::: The code at line 1336 was first introduced by commit
:::::: f6e45661f9be546811b62b2b01f32f4bf0c436c0 dma, mm/pat: Rename dma_*_writecombine() to dma_*_wc()

:::::: TO: Luis R. Rodriguez <mcgrof@xxxxxxxx>
:::::: CC: Ingo Molnar <mingo@xxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip