mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Damien Riégel" <damien.riegel@silabs.com>, greybus-dev@lists.linaro.org
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	"Johan Hovold" <johan@kernel.org>,
	"Alex Elder" <elder@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Silicon Labs Kernel Team" <linux-devel@silabs.com>,
	"Gabriel Beaulieu" <gabriel.beaulieu@silabs.com>,
	"Damien Riégel" <damien.riegel@silabs.com>
Subject: Re: [PATCH 14/14] greybus: cpc: add CPC SDIO host driver
Date: Sat, 13 Dec 2025 17:02:17 +0800	[thread overview]
Message-ID: <202512131651.6JPWdgAH-lkp@intel.com> (raw)
In-Reply-To: <20251212161308.25678-15-damien.riegel@silabs.com>

Hi Damien,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.18 next-20251212]
[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/Damien-Ri-gel/greybus-cpc-add-minimal-CPC-Host-Device-infrastructure/20251213-010308
base:   linus/master
patch link:    https://lore.kernel.org/r/20251212161308.25678-15-damien.riegel%40silabs.com
patch subject: [PATCH 14/14] greybus: cpc: add CPC SDIO host driver
config: nios2-allmodconfig (https://download.01.org/0day-ci/archive/20251213/202512131651.6JPWdgAH-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251213/202512131651.6JPWdgAH-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/202512131651.6JPWdgAH-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/printk.h:621,
                    from include/asm-generic/bug.h:31,
                    from ./arch/nios2/include/generated/asm/bug.h:1,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:13,
                    from include/asm-generic/current.h:6,
                    from ./arch/nios2/include/generated/asm/current.h:1,
                    from include/linux/sched.h:12,
                    from include/linux/delay.h:13,
                    from drivers/greybus/cpc/sdio.c:9:
   drivers/greybus/cpc/sdio.c: In function 'cpc_sdio_get_payload_size':
>> drivers/greybus/cpc/sdio.c:166:35: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
     166 |                 dev_dbg(ctx->dev, "Invalid Greybus header size: %lu\n", gb_size);
         |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dynamic_debug.h:231:29: note: in definition of macro '__dynamic_func_call_cls'
     231 |                 func(&id, ##__VA_ARGS__);                       \
         |                             ^~~~~~~~~~~
   include/linux/dynamic_debug.h:261:9: note: in expansion of macro '_dynamic_func_call_cls'
     261 |         _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
         |         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/dynamic_debug.h:284:9: note: in expansion of macro '_dynamic_func_call'
     284 |         _dynamic_func_call(fmt, __dynamic_dev_dbg,              \
         |         ^~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:165:9: note: in expansion of macro 'dynamic_dev_dbg'
     165 |         dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~~~~~~~
   include/linux/dev_printk.h:165:30: note: in expansion of macro 'dev_fmt'
     165 |         dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                              ^~~~~~~
   drivers/greybus/cpc/sdio.c:166:17: note: in expansion of macro 'dev_dbg'
     166 |                 dev_dbg(ctx->dev, "Invalid Greybus header size: %lu\n", gb_size);
         |                 ^~~~~~~
   drivers/greybus/cpc/sdio.c:166:67: note: format string is defined here
     166 |                 dev_dbg(ctx->dev, "Invalid Greybus header size: %lu\n", gb_size);
         |                                                                 ~~^
         |                                                                   |
         |                                                                   long unsigned int
         |                                                                 %u
   In file included from include/linux/printk.h:621,
                    from include/asm-generic/bug.h:31,
                    from ./arch/nios2/include/generated/asm/bug.h:1,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:13,
                    from include/asm-generic/current.h:6,
                    from ./arch/nios2/include/generated/asm/current.h:1,
                    from include/linux/sched.h:12,
                    from include/linux/delay.h:13,
                    from drivers/greybus/cpc/sdio.c:9:
   drivers/greybus/cpc/sdio.c:172:35: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
     172 |                 dev_dbg(ctx->dev, "Payload size exceeds maximum: %lu\n", gb_size);
         |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dynamic_debug.h:231:29: note: in definition of macro '__dynamic_func_call_cls'
     231 |                 func(&id, ##__VA_ARGS__);                       \
         |                             ^~~~~~~~~~~
   include/linux/dynamic_debug.h:261:9: note: in expansion of macro '_dynamic_func_call_cls'
     261 |         _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
         |         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/dynamic_debug.h:284:9: note: in expansion of macro '_dynamic_func_call'
     284 |         _dynamic_func_call(fmt, __dynamic_dev_dbg,              \
         |         ^~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:165:9: note: in expansion of macro 'dynamic_dev_dbg'
     165 |         dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~~~~~~~~
   include/linux/dev_printk.h:165:30: note: in expansion of macro 'dev_fmt'
     165 |         dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                              ^~~~~~~
   drivers/greybus/cpc/sdio.c:172:17: note: in expansion of macro 'dev_dbg'
     172 |                 dev_dbg(ctx->dev, "Payload size exceeds maximum: %lu\n", gb_size);
         |                 ^~~~~~~
   drivers/greybus/cpc/sdio.c:172:68: note: format string is defined here
     172 |                 dev_dbg(ctx->dev, "Payload size exceeds maximum: %lu\n", gb_size);
         |                                                                  ~~^
         |                                                                    |
         |                                                                    long unsigned int
         |                                                                  %u
--
>> Warning: drivers/greybus/cpc/sdio.c:73 This comment starts with '/**', but isn't a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst
    * Return the memory requirement in bytes for the aggregated frame aligned to the block size


vim +166 drivers/greybus/cpc/sdio.c

   > 9	#include <linux/delay.h>
    10	#include <linux/device.h>
    11	#include <linux/kthread.h>
    12	#include <linux/minmax.h>
    13	#include <linux/mmc/sdio_func.h>
    14	#include <linux/mmc/sdio_ids.h>
    15	#include <linux/skbuff.h>
    16	#include <linux/slab.h>
    17	#include <linux/wait.h>
    18	#include <linux/workqueue.h>
    19	
    20	#include "cpc.h"
    21	#include "header.h"
    22	#include "host.h"
    23	
    24	#define GB_CPC_SDIO_MSG_SIZE_MAX 4096
    25	#define GB_CPC_SDIO_BLOCK_SIZE 256U
    26	#define GB_CPC_SDIO_FIFO_ADDR 0
    27	#define GB_CPC_SDIO_ALIGNMENT 4
    28	#define GB_CPC_SDIO_DEFAULT_AGGREGATION 1
    29	#define CPC_FRAME_HEADER_SIZE (CPC_HEADER_SIZE + GREYBUS_HEADER_SIZE)
    30	#define GB_CPC_SDIO_MAX_AGGREGATION ((GB_CPC_SDIO_BLOCK_SIZE - sizeof(u32)) / CPC_FRAME_HEADER_SIZE)
    31	
    32	enum cpc_sdio_flags {
    33		CPC_SDIO_FLAG_IRQ_RUNNING,
    34		CPC_SDIO_FLAG_TX_WORK_DELAYED,
    35		CPC_SDIO_FLAG_SHUTDOWN,
    36	};
    37	
    38	struct cpc_sdio {
    39		struct cpc_host_device *cpc_hd;
    40		struct device *dev;
    41		struct sdio_func *func;
    42	
    43		struct work_struct tx_work;
    44		unsigned long flags;
    45	
    46		wait_queue_head_t event_queue;
    47		u8 max_aggregation;
    48	};
    49	
    50	struct frame_header {
    51		struct cpc_header cpc;
    52		struct gb_operation_msg_hdr gb;
    53	} __packed;
    54	
    55	static inline struct cpc_sdio *cpc_hd_to_cpc_sdio(struct cpc_host_device *cpc_hd)
    56	{
    57		return (struct cpc_sdio *)cpc_hd->priv;
    58	}
    59	
    60	static int gb_cpc_sdio_wake_tx(struct cpc_host_device *cpc_hd)
    61	{
    62		struct cpc_sdio *ctx = cpc_hd_to_cpc_sdio(cpc_hd);
    63	
    64		if (test_bit(CPC_SDIO_FLAG_SHUTDOWN, &ctx->flags))
    65			return 0;
    66	
    67		/* Use system workqueue for TX processing */
    68		schedule_work(&ctx->tx_work);
    69	
    70		return 0;
    71	}
    72	
  > 73	/**
    74	 * Return the memory requirement in bytes for the aggregated frame aligned to the block size
    75	 */
    76	static size_t cpc_sdio_get_aligned_size(struct cpc_sdio *ctx, struct sk_buff_head *frame_list)
    77	{
    78		size_t size = 0;
    79		struct sk_buff *frame;
    80	
    81		/* Calculate total payload size */
    82		skb_queue_walk(frame_list, frame) {
    83			size_t payload_len = frame->len - CPC_FRAME_HEADER_SIZE;
    84	
    85			/* payload is aligned and padded to 4 bytes */
    86			size += ALIGN(payload_len, GB_CPC_SDIO_ALIGNMENT);
    87		}
    88	
    89		/* Make sure the total payload size is a round number of blocks */
    90		size = ALIGN(size, GB_CPC_SDIO_BLOCK_SIZE);
    91	
    92		/* Add an additional block for headers */
    93		size += GB_CPC_SDIO_BLOCK_SIZE;
    94	
    95		return size;
    96	}
    97	
    98	static unsigned char *cpc_sdio_build_aggregated_frame(struct cpc_sdio *ctx,
    99							      struct sk_buff_head *frame_list,
   100							      size_t *xfer_len)
   101	{
   102		unsigned char *tx_buff;
   103		struct sk_buff *frame;
   104		__le32 *frame_count;
   105		size_t xfer_size;
   106		unsigned int i = 0;
   107	
   108		xfer_size = cpc_sdio_get_aligned_size(ctx, frame_list);
   109	
   110		/* Allocate aggregated frame */
   111		tx_buff = kmalloc(xfer_size, GFP_KERNEL);
   112		if (!tx_buff)
   113			return NULL;
   114	
   115		frame_count = (__le32 *)tx_buff;
   116		*frame_count = cpu_to_le32(skb_queue_len(frame_list));
   117		i += 4;
   118	
   119		/* Copy frame headers to aggregate buffer */
   120		skb_queue_walk(frame_list, frame) {
   121			memcpy(&tx_buff[i], frame->data, CPC_FRAME_HEADER_SIZE);
   122			i += CPC_FRAME_HEADER_SIZE;
   123		}
   124	
   125		/* Zero-pad remainder of header block to fill complete SDIO block */
   126		if (i < GB_CPC_SDIO_BLOCK_SIZE)
   127			memset(&tx_buff[i], 0, GB_CPC_SDIO_BLOCK_SIZE - i);
   128	
   129		/* Start injecting payload at beginning of second block */
   130		i = GB_CPC_SDIO_BLOCK_SIZE;
   131	
   132		/* Build payload blocks if required */
   133		if (xfer_size > GB_CPC_SDIO_BLOCK_SIZE) {
   134			skb_queue_walk(frame_list, frame) {
   135				size_t payload_len, padding_len;
   136	
   137				if (frame->len <= CPC_FRAME_HEADER_SIZE)
   138					continue;
   139	
   140				payload_len = frame->len - CPC_FRAME_HEADER_SIZE;
   141				memcpy(&tx_buff[i], &frame->data[CPC_FRAME_HEADER_SIZE], payload_len);
   142				i += payload_len;
   143	
   144				padding_len = ALIGN(payload_len, GB_CPC_SDIO_ALIGNMENT) - payload_len;
   145				if (padding_len) {
   146					memset(&tx_buff[i], 0, padding_len);
   147					i += padding_len;
   148				}
   149			}
   150		}
   151	
   152		*xfer_len = xfer_size;
   153	
   154		return tx_buff;
   155	}
   156	
   157	static bool cpc_sdio_get_payload_size(struct cpc_sdio *ctx, const struct frame_header *header,
   158					      size_t *payload_size)
   159	{
   160		size_t gb_size;
   161	
   162		gb_size = le16_to_cpu(header->gb.size);
   163	
   164		/* Validate that the size is at least as large as the Greybus header */
   165		if (gb_size < GREYBUS_HEADER_SIZE) {
 > 166			dev_dbg(ctx->dev, "Invalid Greybus header size: %lu\n", gb_size);
   167			return false;
   168		}
   169	
   170		/* Validate maximum size */
   171		if (gb_size > (GB_CPC_SDIO_MSG_SIZE_MAX + GREYBUS_HEADER_SIZE)) {
   172			dev_dbg(ctx->dev, "Payload size exceeds maximum: %lu\n", gb_size);
   173			return false;
   174		}
   175	
   176		/* Size includes the Greybus header, so subtract it to get payload size */
   177		*payload_size = gb_size - GREYBUS_HEADER_SIZE;
   178	
   179		return true;
   180	}
   181	

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

  parent reply	other threads:[~2025-12-13  9:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-12 16:12 [PATCH 00/14] greybus: introduce CPC as transport layer Damien Riégel
2025-12-12 16:12 ` [PATCH 01/14] greybus: cpc: add minimal CPC Host Device infrastructure Damien Riégel
2025-12-12 16:12 ` [PATCH 02/14] greybus: cpc: introduce CPC cport structure Damien Riégel
2025-12-12 16:12 ` [PATCH 03/14] greybus: cpc: use socket buffers instead of gb_message in TX path Damien Riégel
2025-12-12 16:12 ` [PATCH 04/14] greybus: cpc: pack cport ID in Greybus header Damien Riégel
2025-12-12 16:59   ` Yacin Belmihoub-Martel
2025-12-12 16:12 ` [PATCH 05/14] greybus: cpc: switch RX path to socket buffers Damien Riégel
2025-12-12 16:13 ` [PATCH 06/14] greybus: cpc: introduce CPC header structure Damien Riégel
2025-12-12 17:07   ` Yacin Belmihoub-Martel
2025-12-12 16:13 ` [PATCH 07/14] greybus: cpc: account for CPC header size in RX and TX path Damien Riégel
2025-12-12 16:13 ` [PATCH 08/14] greybus: cpc: add and validate sequence numbers Damien Riégel
2025-12-12 18:34   ` Yacin Belmihoub-Martel
2025-12-12 16:13 ` [PATCH 09/14] greybus: cpc: acknowledge all incoming messages Damien Riégel
2025-12-13 14:44   ` kernel test robot
2025-12-13 23:45   ` kernel test robot
2025-12-12 16:13 ` [PATCH 10/14] greybus: cpc: use holding queue instead of sending out immediately Damien Riégel
2025-12-12 16:13 ` [PATCH 11/14] greybus: cpc: honour remote's RX window Damien Riégel
2025-12-12 19:03   ` Yacin Belmihoub-Martel
2025-12-13  7:43   ` kernel test robot
2025-12-12 16:13 ` [PATCH 12/14] greybus: cpc: let host device drivers dequeue TX frames Damien Riégel
2025-12-12 16:13 ` [PATCH 13/14] greybus: cpc: add private data pointer in CPC Host Device Damien Riégel
2025-12-12 16:13 ` [PATCH 14/14] greybus: cpc: add CPC SDIO host driver Damien Riégel
2025-12-12 22:01   ` Yacin Belmihoub-Martel
2025-12-23  2:37     ` Damien Riégel
2025-12-13  9:02   ` kernel test robot [this message]
2025-12-13 19:40   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202512131651.6JPWdgAH-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=damien.riegel@silabs.com \
    --cc=elder@kernel.org \
    --cc=gabriel.beaulieu@silabs.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=johan@kernel.org \
    --cc=linux-devel@silabs.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®