All of lore.kernel.org
 help / color / mirror / Atom feed
* [asahilinux:bits/240-isp 55/56] drivers/media/platform/apple/avd/avd-hw.c:96:72: warning: right shift count >= width of type
@ 2026-07-10 18:03 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-07-10 18:03 UTC (permalink / raw)
  To: sofus; +Cc: oe-kbuild-all, Janne Grunau

tree:   https://github.com/AsahiLinux/linux bits/240-isp
head:   edd1529cbf30f69240acea99fa8225683c555200
commit: 9d77b27426e338bbf4f4df0676c1e064e046527e [55/56] media: apple: add avd driver
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20260711/202607110132.JRWh1CDJ-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260711/202607110132.JRWh1CDJ-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/202607110132.JRWh1CDJ-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/io.h:12,
                    from include/linux/iopoll.h:14,
                    from drivers/media/platform/apple/avd/avd-hw.c:4:
   drivers/media/platform/apple/avd/avd-hw.c: In function 't8112_configure_stream':
>> drivers/media/platform/apple/avd/avd-hw.c:96:72: warning: right shift count >= width of type [-Wshift-count-overflow]
      96 |                 w32(AVD_V4_VP_INSN_FIFO_IOVA_HI + (fifo_idx * 4), addr >> 32);
         |                                                                        ^~
   arch/sh/include/asm/io.h:30:83: note: in definition of macro '__raw_writel'
      30 | #define __raw_writel(v,a)       (__chk_io_ptr(a), *(volatile u32 __force *)(a) = (v))
         |                                                                                   ^
   arch/sh/include/asm/io.h:45:66: note: in expansion of macro 'ioswabl'
      45 | #define writel_relaxed(v,c)     ((void)__raw_writel((__force u32)ioswabl(v),c))
         |                                                                  ^~~~~~~
   drivers/media/platform/apple/avd/avd-hw.c:74:24: note: in expansion of macro 'writel_relaxed'
      74 | #define w32(reg, val) (writel_relaxed(val, avd->ctrl + (reg)))
         |                        ^~~~~~~~~~~~~~
   drivers/media/platform/apple/avd/avd-hw.c:96:17: note: in expansion of macro 'w32'
      96 |                 w32(AVD_V4_VP_INSN_FIFO_IOVA_HI + (fifo_idx * 4), addr >> 32);
         |                 ^~~
   drivers/media/platform/apple/avd/avd-hw.c: In function 't8122_configure_stream':
   drivers/media/platform/apple/avd/avd-hw.c:110:64: warning: right shift count >= width of type [-Wshift-count-overflow]
     110 |         w32(AVD_V5_VP_INSN_FIFO_IOVA_HI + (fifo_idx * 4), addr >> 32);
         |                                                                ^~
   arch/sh/include/asm/io.h:30:83: note: in definition of macro '__raw_writel'
      30 | #define __raw_writel(v,a)       (__chk_io_ptr(a), *(volatile u32 __force *)(a) = (v))
         |                                                                                   ^
   arch/sh/include/asm/io.h:45:66: note: in expansion of macro 'ioswabl'
      45 | #define writel_relaxed(v,c)     ((void)__raw_writel((__force u32)ioswabl(v),c))
         |                                                                  ^~~~~~~
   drivers/media/platform/apple/avd/avd-hw.c:74:24: note: in expansion of macro 'writel_relaxed'
      74 | #define w32(reg, val) (writel_relaxed(val, avd->ctrl + (reg)))
         |                        ^~~~~~~~~~~~~~
   drivers/media/platform/apple/avd/avd-hw.c:110:9: note: in expansion of macro 'w32'
     110 |         w32(AVD_V5_VP_INSN_FIFO_IOVA_HI + (fifo_idx * 4), addr >> 32);
         |         ^~~
--
   In file included from drivers/media/platform/apple/avd/avd-h264.c:24:
   drivers/media/platform/apple/avd/avd-inst.h: In function 'push_address':
>> drivers/media/platform/apple/avd/avd-inst.h:41:43: warning: right shift count >= width of type [-Wshift-count-overflow]
      41 |                 push(avd, ctx, (u32)(addr >> 32));
         |                                           ^~
   drivers/media/platform/apple/avd/avd-h264.c: In function 'stream_slice':
>> drivers/media/platform/apple/avd/avd-h264.c:383:41: warning: right shift count >= width of type [-Wshift-count-overflow]
     383 |                         | (u32)(slc_a84 >> 32), "slc_a7c_cmd_set_coded_slice");
         |                                         ^~
   drivers/media/platform/apple/avd/avd-inst.h:64:41: note: in definition of macro 'push'
      64 | #define push(inst, name) push(avd, ctx, inst)
         |                                         ^~~~


vim +96 drivers/media/platform/apple/avd/avd-hw.c

     2	
     3	#include "linux/dev_printk.h"
   > 4	#include <linux/iopoll.h>
     5	
     6	#include "avd.h"
     7	#include "avd-regs.h"
     8	
     9	/* The plan is to move this to the cm3 */
    10	
    11	#define AVD_V3_VP_INSN_FIFO_IOVA	0x4068
    12	#define AVD_V3_VP_INSN_FIFO_MASK	0x4084
    13	#define AVD_V3_VP_INSN_FIFO_CACH	0x40a0
    14	#define AVD_V3_VP_INSN_FIFO_XFER	0x40bc
    15	#define AVD_V3_VP_CTRL_UNK	  0x4040
    16	#define AVD_V3_CTRL_CM3_IRQ_MASK	0x405c
    17	
    18	#define AVD_V4_VP_INSN_FIFO_IOVA_HI	0x30c
    19	#define AVD_V4_VP_INSN_FIFO_IOVA_LO	0x150
    20	#define AVD_V4_VP_INSN_FIFO_MASK	0x18c
    21	#define AVD_V4_VP_INSN_FIFO_CACH	0x1c8
    22	#define AVD_V4_VP_INSN_FIFO_XFER	0x204
    23	#define AVD_V4_VP_CTRL_CM3_IRQ_MASK	0x0fc
    24	#define AVD_V4_PP_CTRL_CM3_IRQ_MASK	0x120
    25	
    26	/* seems stabile after this */
    27	#define AVD_V5_VP_INSN_FIFO_IOVA_HI	0x20c
    28	#define AVD_V5_VP_INSN_FIFO_IOVA_LO	0x1d0
    29	#define AVD_V5_VP_INSN_FIFO_MASK	0x248
    30	#define AVD_V5_VP_INSN_FIFO_CACH	0x284
    31	#define AVD_V5_VP_INSN_FIFO_XFER	0x2c0
    32	#define AVD_V5_VP_CTRL_CM3_IRQ_MASK	0x15c
    33	#define AVD_V5_PP_CTRL_CM3_IRQ_MASK	0x190
    34	
    35	#define AVD_CM3_UNK	  BIT(0)
    36	#define AVD_CM3_ERROR	BIT(1)
    37	#define AVD_CM3_DONE	BIT(2)
    38	#define AVD_CM3_FULL	BIT(3)
    39	
    40	#define AVD_VP_CM3_MASK (AVD_CM3_UNK | AVD_CM3_ERROR | AVD_CM3_DONE)
    41	#define AVD_PP_CM3_MASK (AVD_CM3_UNK | AVD_CM3_DONE)
    42	
    43	int avd_boot(struct avd_dev *avd)
    44	{
    45		u32 val;
    46		int ret;
    47	
    48		if (avd->variant->revision != 3)
    49			dev_info_once(avd->dev, "booting hw version: %04x",
    50					readl_relaxed(avd->ctrl));
    51	
    52		memcpy_toio(avd->code, avd->fw->data, avd->fw->size);
    53	
    54		writel_relaxed(AVD_MBOX_ENABLE, avd->mbox + AVD_REG_MBOX1_STATUS);
    55		writel_relaxed(AVD_MBOX1_NOT_EMPTY, avd->mbox + AVD_REG_MBOX_IRQ_ENABLE);
    56		writel_relaxed(AVD_RUN_CTRL_UNK_RUN, avd->mbox + AVD_REG_RUN_CTRL);
    57	
    58		/* wait for cm3 to boot */
    59		ret = readl_poll_timeout(avd->mbox + AVD_REG_FLAG0_SET,
    60				val, val == 1, 10, 10000);
    61		if (ret)
    62			return ret;
    63	
    64		return 0;
    65	}
    66	
    67	void avd_shutdown(struct avd_dev *avd)
    68	{
    69		writel_relaxed(AVD_RUN_CTRL_UNK_STOP, avd->mbox + AVD_REG_RUN_CTRL);
    70		writel_relaxed(1, avd->mbox + AVD_REG_FLAG0_CLR);
    71		writel_relaxed(0, avd->mbox + AVD_REG_MBOX_IRQ_ENABLE);
    72	}
    73	
    74	#define w32(reg, val) (writel_relaxed(val, avd->ctrl + (reg)))
    75	#define m32(reg, val) (w32(reg, (val) | readl_relaxed(avd->ctrl + (reg))))
    76	
    77	void t8103_configure_stream(struct avd_dev *avd, dma_addr_t addr, u8 fifo_idx,
    78				  u32 vp_slot)
    79	{
    80		w32(AVD_V3_VP_INSN_FIFO_IOVA + (fifo_idx * 4), addr >> 8);
    81		w32(AVD_V3_VP_INSN_FIFO_MASK + (fifo_idx * 4), 0x100000);
    82		w32(AVD_V3_VP_INSN_FIFO_CACH + (fifo_idx * 4), 0);
    83		w32(AVD_V3_VP_INSN_FIFO_XFER + (fifo_idx * 4), 0);
    84	
    85		w32(AVD_V3_VP_CTRL_UNK + (vp_slot * 4), 0);
    86		m32(AVD_V3_CTRL_CM3_IRQ_MASK,
    87		    AVD_VP_CM3_MASK << (vp_slot * 5) | (AVD_PP_CM3_MASK << 20));
    88	}
    89	
    90	void t8112_configure_stream(struct avd_dev *avd, dma_addr_t addr, u8 fifo_idx,
    91				  u32 vp_slot)
    92	{
    93		if (avd->variant->quirks & AVD_QUIRK_LSR) {
    94			w32(AVD_V4_VP_INSN_FIFO_IOVA_LO + (fifo_idx * 4), addr >> 8);
    95		} else {
  > 96			w32(AVD_V4_VP_INSN_FIFO_IOVA_HI + (fifo_idx * 4), addr >> 32);
    97			w32(AVD_V4_VP_INSN_FIFO_IOVA_LO + (fifo_idx * 4), addr & 0xffffffff);
    98		}
    99		w32(AVD_V4_VP_INSN_FIFO_MASK + (fifo_idx * 4), 0);
   100		w32(AVD_V4_VP_INSN_FIFO_CACH + (fifo_idx * 4), 0);
   101		w32(AVD_V4_VP_INSN_FIFO_XFER + (fifo_idx * 4), 0);
   102	
   103		m32(AVD_V4_VP_CTRL_CM3_IRQ_MASK + (vp_slot * 4), AVD_VP_CM3_MASK);
   104		m32(AVD_V4_PP_CTRL_CM3_IRQ_MASK, AVD_PP_CM3_MASK);
   105	}
   106	

--
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-07-10 18:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-10 18:03 [asahilinux:bits/240-isp 55/56] drivers/media/platform/apple/avd/avd-hw.c:96:72: warning: right shift count >= width of type kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.