Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [asahilinux:bits/240-isp 20/53] drivers/media/platform/apple/isp/isp-fw.c:290:46: warning: shift count >= width of type
@ 2026-05-10 16:57 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-05-10 16:57 UTC (permalink / raw)
  To: Asahi Lina; +Cc: llvm, oe-kbuild-all, Janne Grunau

tree:   https://github.com/AsahiLinux/linux bits/240-isp
head:   50d4a0c32a10908320be6a9f3971221f726d4a20
commit: ea1d8ea146083e1beae8ebba03a97a558205cec6 [20/53] media: apple: isp: Support >32bit VAs for t602x
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20260511/202605110032.WXJJE5s2-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260511/202605110032.WXJJE5s2-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605110032.WXJJE5s2-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/media/platform/apple/isp/isp-fw.c:216:5: warning: no previous prototype for function 'apple_isp_alloc_firmware_surface' [-Wmissing-prototypes]
     216 | int apple_isp_alloc_firmware_surface(struct apple_isp *isp)
         |     ^
   drivers/media/platform/apple/isp/isp-fw.c:216:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     216 | int apple_isp_alloc_firmware_surface(struct apple_isp *isp)
         | ^
         | static 
   drivers/media/platform/apple/isp/isp-fw.c:235:6: warning: no previous prototype for function 'apple_isp_free_firmware_surface' [-Wmissing-prototypes]
     235 | void apple_isp_free_firmware_surface(struct apple_isp *isp)
         |      ^
   drivers/media/platform/apple/isp/isp-fw.c:235:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     235 | void apple_isp_free_firmware_surface(struct apple_isp *isp)
         | ^
         | static 
>> drivers/media/platform/apple/isp/isp-fw.c:290:46: warning: shift count >= width of type [-Wshift-count-overflow]
     290 |         isp_gpio_write32(isp, ISP_GPIO_1, args_iova >> 32);
         |                                                     ^  ~~
   drivers/media/platform/apple/isp/isp-fw.c:384:4: warning: format specifies type 'unsigned long long' but the argument has type 'dma_addr_t' (aka 'unsigned int') [-Wformat]
     382 |                 isp_dbg(isp, "chan: %s type: %d src: %d num: %d iova: 0x%llx\n",
         |                                                                         ~~~~
         |                                                                         %x
     383 |                         chan->name, chan->type, chan->src, chan->num,
     384 |                         chan->iova);
         |                         ^~~~~~~~~~
   drivers/media/platform/apple/isp/isp-drv.h:237:47: note: expanded from macro 'isp_dbg'
     237 |         dev_dbg((isp)->dev, "[%s] " fmt, __func__, ##__VA_ARGS__)
         |                                     ~~~              ^~~~~~~~~~~
   include/linux/dev_printk.h:165:39: note: expanded from macro 'dev_dbg'
     165 |         dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                      ~~~     ^~~~~~~~~~~
   include/linux/dynamic_debug.h:285:19: note: expanded from macro 'dynamic_dev_dbg'
     285 |                            dev, fmt, ##__VA_ARGS__)
         |                                 ~~~    ^~~~~~~~~~~
   include/linux/dynamic_debug.h:261:59: note: expanded from macro '_dynamic_func_call'
     261 |         _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
         |                                                                  ^~~~~~~~~~~
   include/linux/dynamic_debug.h:259:65: note: expanded from macro '_dynamic_func_call_cls'
     259 |         __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__)
         |                                                                        ^~~~~~~~~~~
   include/linux/dynamic_debug.h:231:15: note: expanded from macro '__dynamic_func_call_cls'
     231 |                 func(&id, ##__VA_ARGS__);                       \
         |                             ^~~~~~~~~~~
   drivers/media/platform/apple/isp/isp-fw.c:534:4: warning: format specifies type 'unsigned long long' but the argument has type 'dma_addr_t' (aka 'unsigned int') [-Wformat]
     533 |                 isp_dbg(isp, "freeing iova: 0x%llx size: 0x%llx virt: %pS\n",
         |                                               ~~~~
         |                                               %x
     534 |                         surf->iova, surf->size, (void *)surf->virt);
         |                         ^~~~~~~~~~
   drivers/media/platform/apple/isp/isp-drv.h:237:47: note: expanded from macro 'isp_dbg'
     237 |         dev_dbg((isp)->dev, "[%s] " fmt, __func__, ##__VA_ARGS__)
         |                                     ~~~              ^~~~~~~~~~~
   include/linux/dev_printk.h:165:39: note: expanded from macro 'dev_dbg'
     165 |         dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                      ~~~     ^~~~~~~~~~~
   include/linux/dynamic_debug.h:285:19: note: expanded from macro 'dynamic_dev_dbg'
     285 |                            dev, fmt, ##__VA_ARGS__)
         |                                 ~~~    ^~~~~~~~~~~
   include/linux/dynamic_debug.h:261:59: note: expanded from macro '_dynamic_func_call'
     261 |         _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
         |                                                                  ^~~~~~~~~~~
   include/linux/dynamic_debug.h:259:65: note: expanded from macro '_dynamic_func_call_cls'
     259 |         __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__)
         |                                                                        ^~~~~~~~~~~
   include/linux/dynamic_debug.h:231:15: note: expanded from macro '__dynamic_func_call_cls'
     231 |                 func(&id, ##__VA_ARGS__);                       \
         |                             ^~~~~~~~~~~
   drivers/media/platform/apple/isp/isp-fw.c:601:5: warning: no previous prototype for function 'apple_isp_firmware_boot' [-Wmissing-prototypes]
     601 | int apple_isp_firmware_boot(struct apple_isp *isp)
         |     ^
   drivers/media/platform/apple/isp/isp-fw.c:601:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     601 | int apple_isp_firmware_boot(struct apple_isp *isp)
         | ^
         | static 
   drivers/media/platform/apple/isp/isp-fw.c:622:6: warning: no previous prototype for function 'apple_isp_firmware_shutdown' [-Wmissing-prototypes]
     622 | void apple_isp_firmware_shutdown(struct apple_isp *isp)
         |      ^
   drivers/media/platform/apple/isp/isp-fw.c:622:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     622 | void apple_isp_firmware_shutdown(struct apple_isp *isp)
         | ^
         | static 
   7 warnings generated.


vim +290 drivers/media/platform/apple/isp/isp-fw.c

   245	
   246	static int isp_firmware_boot_stage2(struct apple_isp *isp)
   247	{
   248		struct isp_firmware_bootargs args;
   249		dma_addr_t args_iova;
   250		int err, retries;
   251	
   252		u32 num_ipc_chans = isp_gpio_read32(isp, ISP_GPIO_0);
   253		u32 args_offset = isp_gpio_read32(isp, ISP_GPIO_1);
   254		u32 extra_size = isp_gpio_read32(isp, ISP_GPIO_3);
   255		isp->num_ipc_chans = num_ipc_chans;
   256	
   257		if (!isp->num_ipc_chans) {
   258			dev_err(isp->dev, "No IPC channels found\n");
   259			return -ENODEV;
   260		}
   261	
   262		if (isp->num_ipc_chans != 7)
   263			dev_warn(isp->dev, "unexpected channel count (%d)\n",
   264				 num_ipc_chans);
   265	
   266		isp->extra_surf = isp_alloc_surface_vmap(isp, extra_size);
   267		if (!isp->extra_surf) {
   268			isp_err(isp, "failed to alloc surface for extra heap\n");
   269			return -ENOMEM;
   270		}
   271	
   272		args_iova = isp->ipc_surf->iova + args_offset + 0x40;
   273		isp->cmd_iova = args_iova + sizeof(args) + 0x40;
   274	
   275		memset(&args, 0, sizeof(args));
   276		args.ipc_iova = isp->ipc_surf->iova;
   277		args.ipc_size = isp->ipc_surf->size;
   278		args.shared_base = isp->fw.heap_top & 0xffffffff;
   279		args.shared_size = 0x10000000UL - args.shared_base;
   280		args.extra_iova = isp->extra_surf->iova;
   281		args.extra_size = isp->extra_surf->size;
   282		args.platform_id = isp->hw->platform_id;
   283		args.unk5 = 0x40;
   284		args.unk7 = 0x1;
   285		args.unk_iova1 = args_iova + sizeof(args) - 0xc;
   286		args.unk9 = 0x3;
   287		isp_iowrite(isp, args_iova, &args, sizeof(args));
   288	
   289		isp_gpio_write32(isp, ISP_GPIO_0, args_iova);
 > 290		isp_gpio_write32(isp, ISP_GPIO_1, args_iova >> 32);
   291		wmb();
   292	
   293		/* Wait for ISP_GPIO_7 to 0xf7fbdff9 -> 0x8042006 */
   294		isp_gpio_write32(isp, ISP_GPIO_7, 0xf7fbdff9);
   295	
   296		for (retries = 0; retries < ISP_FIRMWARE_MAX_TRIES; retries++) {
   297			u32 val = isp_gpio_read32(isp, ISP_GPIO_7);
   298			if (val == 0x8042006) {
   299				isp_dbg(isp,
   300					"got second magic number (0x%x) from firmware\n",
   301					val);
   302				break;
   303			}
   304			mdelay(ISP_FIRMWARE_MDELAY);
   305		}
   306		if (retries >= ISP_FIRMWARE_MAX_TRIES) {
   307			isp_err(isp,
   308				"never received second magic number from firmware\n");
   309			err = -ENODEV;
   310			goto free_extra;
   311		}
   312	
   313		return 0;
   314	
   315	free_extra:
   316		isp_free_surface(isp, isp->extra_surf);
   317		return err;
   318	}
   319	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-10 16:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-10 16:57 [asahilinux:bits/240-isp 20/53] drivers/media/platform/apple/isp/isp-fw.c:290:46: warning: shift count >= width of type 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