Re: [PATCH 2/2] firmware: arm_scmi: Support 'reg-io-width' property for shared memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Florian,

kernel test robot noticed the following build errors:

[auto build test ERROR on next-20240809]
[cannot apply to robh/for-next soc/for-next linus/master v6.11-rc2 v6.11-rc1 v6.10 v6.11-rc2]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Florian-Fainelli/dt-bindings-sram-Document-reg-io-width-property/20240811-055659
base:   next-20240809
patch link:    https://lore.kernel.org/r/20240810214621.14417-3-florian.fainelli%40broadcom.com
patch subject: [PATCH 2/2] firmware: arm_scmi: Support 'reg-io-width' property for shared memory
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20240811/202408112059.XkTMhslU-lkp@xxxxxxxxx/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project f86594788ce93b696675c94f54016d27a6c21d18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240811/202408112059.XkTMhslU-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408112059.XkTMhslU-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

   In file included from drivers/firmware/arm_scmi/shmem.c:9:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     548 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     561 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from drivers/firmware/arm_scmi/shmem.c:9:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     574 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from drivers/firmware/arm_scmi/shmem.c:9:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     585 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     595 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     605 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
>> drivers/firmware/arm_scmi/shmem.c:98:4: error: call to undeclared function 'iowrite64'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      98 |                         __shmem_copy_toio_tpl(64);
         |                         ^
   drivers/firmware/arm_scmi/shmem.c:39:3: note: expanded from macro '__shmem_copy_toio_tpl'
      39 |                 iowrite##s(((u##s *)(xfer->tx.buf))[i / shmem_io_width],        \
         |                 ^
   <scratch space>:43:1: note: expanded from here
      43 | iowrite64
         | ^
   6 warnings and 1 error generated.


vim +/iowrite64 +98 drivers/firmware/arm_scmi/shmem.c

    36	
    37	#define __shmem_copy_toio_tpl(s)			\
    38		for (unsigned int i = 0; i < xfer->tx.len; i += shmem_io_width)		\
    39			iowrite##s(((u##s *)(xfer->tx.buf))[i / shmem_io_width],	\
    40				   shmem->msg_payload + i);
    41	
    42	#define __shmem_copy_fromio_tpl(s)			\
    43		for (unsigned int i = 0; i < xfer->rx.len; i += shmem_io_width)		\
    44			((u##s *)(xfer->rx.buf))[i / shmem_io_width] = 			\
    45				 ioread##s(shmem->msg_payload + shmem_io_width + i);
    46	
    47	static void shmem_tx_prepare(struct scmi_shared_mem __iomem *shmem,
    48				     struct scmi_xfer *xfer,
    49				     struct scmi_chan_info *cinfo,
    50				     u32 shmem_io_width)
    51	{
    52		ktime_t stop;
    53	
    54		/*
    55		 * Ideally channel must be free by now unless OS timeout last
    56		 * request and platform continued to process the same, wait
    57		 * until it releases the shared memory, otherwise we may endup
    58		 * overwriting its response with new message payload or vice-versa.
    59		 * Giving up anyway after twice the expected channel timeout so as
    60		 * not to bail-out on intermittent issues where the platform is
    61		 * occasionally a bit slower to answer.
    62		 *
    63		 * Note that after a timeout is detected we bail-out and carry on but
    64		 * the transport functionality is probably permanently compromised:
    65		 * this is just to ease debugging and avoid complete hangs on boot
    66		 * due to a misbehaving SCMI firmware.
    67		 */
    68		stop = ktime_add_ms(ktime_get(), 2 * cinfo->rx_timeout_ms);
    69		spin_until_cond((ioread32(&shmem->channel_status) &
    70				 SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE) ||
    71				 ktime_after(ktime_get(), stop));
    72		if (!(ioread32(&shmem->channel_status) &
    73		      SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE)) {
    74			WARN_ON_ONCE(1);
    75			dev_err(cinfo->dev,
    76				"Timeout waiting for a free TX channel !\n");
    77			return;
    78		}
    79	
    80		/* Mark channel busy + clear error */
    81		iowrite32(0x0, &shmem->channel_status);
    82		iowrite32(xfer->hdr.poll_completion ? 0 : SCMI_SHMEM_FLAG_INTR_ENABLED,
    83			  &shmem->flags);
    84		iowrite32(sizeof(shmem->msg_header) + xfer->tx.len, &shmem->length);
    85		iowrite32(pack_scmi_header(&xfer->hdr), &shmem->msg_header);
    86		if (xfer->tx.buf) {
    87			switch (shmem_io_width) {
    88			case 1:
    89				__shmem_copy_toio_tpl(8);
    90				break;
    91			case 2:
    92				__shmem_copy_toio_tpl(16);
    93				break;
    94			case 4:
    95				__shmem_copy_toio_tpl(32);
    96				break;
    97			case 8:
  > 98				__shmem_copy_toio_tpl(64);
    99				break;
   100			default:
   101				memcpy_toio(shmem->msg_payload, xfer->tx.buf, xfer->tx.len);
   102				break;
   103			}
   104		}
   105	}
   106	

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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux