From: kernel test robot <lkp@intel.com>
To: Ivan Vecera <ivecera@redhat.com>, netdev@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, Jiri Pirko <jiri@resnulli.us>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Prathosh Satish <Prathosh.Satish@microchip.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Michal Schmidt <mschmidt@redhat.com>,
Petr Oros <poros@redhat.com>
Subject: Re: [PATCH net-next 2/5] dpll: zl3073x: Add low-level flash functions
Date: Sat, 26 Jul 2025 18:36:56 +0800 [thread overview]
Message-ID: <202507261837.ofrYjyeT-lkp@intel.com> (raw)
In-Reply-To: <20250725154136.1008132-3-ivecera@redhat.com>
Hi Ivan,
kernel test robot noticed the following build warnings:
[auto build test WARNING on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/Ivan-Vecera/dpll-zl3073x-Add-functions-to-access-hardware-registers/20250725-234600
base: net-next/main
patch link: https://lore.kernel.org/r/20250725154136.1008132-3-ivecera%40redhat.com
patch subject: [PATCH net-next 2/5] dpll: zl3073x: Add low-level flash functions
config: x86_64-buildonly-randconfig-003-20250726 (https://download.01.org/0day-ci/archive/20250726/202507261837.ofrYjyeT-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250726/202507261837.ofrYjyeT-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/202507261837.ofrYjyeT-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/dpll/zl3073x/flash.c: In function 'zl3073x_flash_sectors':
>> drivers/dpll/zl3073x/flash.c:294:70: warning: '%zu' directive output may be truncated writing between 1 and 15 bytes into a region of size 11 [-Wformat-truncation=]
294 | snprintf(comp_str, sizeof(comp_str), "%s-part%zu",
| ^~~
drivers/dpll/zl3073x/flash.c:294:62: note: directive argument in the range [1, 281474976710656]
294 | snprintf(comp_str, sizeof(comp_str), "%s-part%zu",
| ^~~~~~~~~~~~
drivers/dpll/zl3073x/flash.c:294:25: note: 'snprintf' output 7 or more bytes (assuming 21) into a destination of size 16
294 | snprintf(comp_str, sizeof(comp_str), "%s-part%zu",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
295 | component, (ptr - data) / max_block_size + 1);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +294 drivers/dpll/zl3073x/flash.c
245
246 /**
247 * zl3073x_flash_sectors - Flash sectors
248 * @zldev: zl3073x device structure
249 * @component: component name
250 * @page: destination flash page
251 * @addr: device memory address to load data
252 * @data: pointer to data to be flashed
253 * @size: size of data
254 * @extack: netlink extack pointer to report errors
255 *
256 * The function flashes given @data with size of @size to the internal flash
257 * memory block starting from page @page. The function uses sector flash
258 * method and has to take into account the flash sector size reported by
259 * flashing utility. Input data are spliced into blocks according this
260 * sector size and each block is flashed separately.
261 *
262 * Return: 0 on success, <0 on error
263 */
264 int zl3073x_flash_sectors(struct zl3073x_dev *zldev, const char *component,
265 u32 page, u32 addr, const void *data, size_t size,
266 struct netlink_ext_ack *extack)
267 {
268 #define ZL_FLASH_MAX_BLOCK_SIZE 0x0001E000
269 #define ZL_FLASH_PAGE_SIZE 256
270 size_t max_block_size, block_size, sector_size;
271 const void *ptr, *end;
272 int rc;
273
274 /* Get flash sector size */
275 rc = zl3073x_flash_get_sector_size(zldev, §or_size);
276 if (rc) {
277 ZL_FLASH_ERR_MSG(zldev, extack,
278 "Failed to get flash sector size");
279 return rc;
280 }
281
282 /* Determine max block size depending on sector size */
283 max_block_size = ALIGN_DOWN(ZL_FLASH_MAX_BLOCK_SIZE, sector_size);
284
285 for (ptr = data, end = data + size; ptr < end; ptr += block_size) {
286 char comp_str[16];
287
288 block_size = min_t(size_t, max_block_size, end - ptr);
289
290 /* Add suffix '-partN' if the requested component size is
291 * greater than max_block_size.
292 */
293 if (max_block_size < size)
> 294 snprintf(comp_str, sizeof(comp_str), "%s-part%zu",
295 component, (ptr - data) / max_block_size + 1);
296 else
297 strscpy(comp_str, component);
298
299 /* Download block to device memory */
300 rc = zl3073x_flash_download(zldev, comp_str, addr, ptr,
301 block_size, extack);
302 if (rc)
303 goto finish;
304
305 /* Set address to flash from */
306 rc = zl3073x_write_u32(zldev, ZL_REG_IMAGE_START_ADDR, addr);
307 if (rc)
308 goto finish;
309
310 /* Set size of block to flash */
311 rc = zl3073x_write_u32(zldev, ZL_REG_IMAGE_SIZE, block_size);
312 if (rc)
313 goto finish;
314
315 /* Set destination page to flash */
316 rc = zl3073x_write_u32(zldev, ZL_REG_FLASH_INDEX_WRITE, page);
317 if (rc)
318 goto finish;
319
320 /* Set filling pattern */
321 rc = zl3073x_write_u32(zldev, ZL_REG_FILL_PATTERN, U32_MAX);
322 if (rc)
323 goto finish;
324
325 zl3073x_devlink_flash_notify(zldev, "Flashing image", comp_str,
326 0, 0);
327
328 dev_dbg(zldev->dev, "Flashing %zu bytes to page %u\n",
329 block_size, page);
330
331 /* Execute sectors flash operation */
332 rc = zl3073x_flash_cmd_wait(zldev, ZL_WRITE_FLASH_OP_SECTORS,
333 extack);
334 if (rc)
335 goto finish;
336
337 /* Move to next page */
338 page += block_size / ZL_FLASH_PAGE_SIZE;
339 }
340
341 finish:
342 zl3073x_devlink_flash_notify(zldev,
343 rc ? "Flashing failed" : "Flashing done",
344 component, 0, 0);
345
346 return rc;
347 }
348
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-07-26 10:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-25 15:41 [PATCH net-next 0/5] dpll: zl3073x: Add support for devlink flash Ivan Vecera
2025-07-25 15:41 ` [PATCH net-next 1/5] dpll: zl3073x: Add functions to access hardware registers Ivan Vecera
2025-07-25 15:41 ` [PATCH net-next 2/5] dpll: zl3073x: Add low-level flash functions Ivan Vecera
2025-07-26 10:36 ` kernel test robot [this message]
2025-07-25 15:41 ` [PATCH net-next 3/5] dpll: zl3073x: Add firmware loading functionality Ivan Vecera
2025-07-26 20:33 ` Simon Horman
2025-07-29 15:20 ` Ivan Vecera
2025-07-25 15:41 ` [PATCH net-next 4/5] dpll: zl3073x: Refactor DPLL initialization Ivan Vecera
2025-07-26 10:57 ` kernel test robot
2025-07-25 15:41 ` [PATCH net-next 5/5] dpll: zl3073x: Implement devlink flash callback Ivan Vecera
2025-07-25 17:18 ` [PATCH net-next 0/5] dpll: zl3073x: Add support for devlink flash Ivan Vecera
2025-07-25 17:42 ` Jakub Kicinski
2025-07-25 17:59 ` Ivan Vecera
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=202507261837.ofrYjyeT-lkp@intel.com \
--to=lkp@intel.com \
--cc=Prathosh.Satish@microchip.com \
--cc=corbet@lwn.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=ivecera@redhat.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mschmidt@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=poros@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).