From: kernel test robot <lkp@intel.com>
To: Keguang Zhang via B4 Relay
<devnull+keguang.zhang.gmail.com@kernel.org>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-media@vger.kernel.org,
Keguang Zhang <keguang.zhang@gmail.com>
Subject: Re: [PATCH v9 2/2] mtd: rawnand: Add Loongson-1 NAND Controller Driver
Date: Sun, 22 Sep 2024 00:45:55 +0800 [thread overview]
Message-ID: <202409220010.vctkHddZ-lkp@intel.com> (raw)
In-Reply-To: <20240920-loongson1-nand-v9-2-9cc7b9345a03@gmail.com>
Hi Keguang,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 62f92d634458a1e308bb699986b9147a6d670457]
url: https://github.com/intel-lab-lkp/linux/commits/Keguang-Zhang-via-B4-Relay/dt-bindings-mtd-Add-Loongson-1-NAND-Controller/20240920-191936
base: 62f92d634458a1e308bb699986b9147a6d670457
patch link: https://lore.kernel.org/r/20240920-loongson1-nand-v9-2-9cc7b9345a03%40gmail.com
patch subject: [PATCH v9 2/2] mtd: rawnand: Add Loongson-1 NAND Controller Driver
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240922/202409220010.vctkHddZ-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240922/202409220010.vctkHddZ-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/202409220010.vctkHddZ-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/mtd/nand/raw/loongson1_nand.c:349:17: warning: cast to smaller integer type 'u32' (aka 'unsigned int') from 'char *' [-Wpointer-to-int-cast]
349 | if (IS_ALIGNED((u32)op->buf, chip->buf_align) &&
| ^~~~~~~~~~~~
include/linux/align.h:13:30: note: expanded from macro 'IS_ALIGNED'
13 | #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
| ^
>> drivers/mtd/nand/raw/loongson1_nand.c:349:17: warning: cast to smaller integer type 'u32' (aka 'unsigned int') from 'char *' [-Wpointer-to-int-cast]
349 | if (IS_ALIGNED((u32)op->buf, chip->buf_align) &&
| ^~~~~~~~~~~~
include/linux/align.h:13:44: note: expanded from macro 'IS_ALIGNED'
13 | #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
| ^
2 warnings generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for OMAP2PLUS_MBOX
Depends on [n]: MAILBOX [=y] && (ARCH_OMAP2PLUS || ARCH_K3)
Selected by [y]:
- TI_K3_M4_REMOTEPROC [=y] && REMOTEPROC [=y] && (ARCH_K3 || COMPILE_TEST [=y])
vim +349 drivers/mtd/nand/raw/loongson1_nand.c
333
334 static int ls1x_nand_dma_transfer(struct ls1x_nfc *nfc,
335 struct ls1x_nfc_op *op)
336 {
337 struct nand_chip *chip = &nfc->chip;
338 struct dma_chan *chan = nfc->dma_chan;
339 struct device *dev = chan->device->dev;
340 struct dma_async_tx_descriptor *desc;
341 enum dma_data_direction data_dir =
342 op->is_write ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
343 enum dma_transfer_direction xfer_dir =
344 op->is_write ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
345 char *dma_buf = NULL;
346 dma_addr_t dma_addr;
347 int ret;
348
> 349 if (IS_ALIGNED((u32)op->buf, chip->buf_align) &&
350 IS_ALIGNED(op->len, chip->buf_align)) {
351 dma_addr = dma_map_single(dev, op->buf, op->len, data_dir);
352 if (dma_mapping_error(dev, dma_addr)) {
353 dev_err(dev, "failed to map DMA buffer\n");
354 return -ENXIO;
355 }
356 } else if (!op->is_write) {
357 dma_buf = dma_alloc_coherent(dev, op->dma_len, &dma_addr,
358 GFP_KERNEL);
359 if (!dma_buf)
360 return -ENOMEM;
361 } else {
362 dev_err(dev, "subpage writing not supported\n");
363 return -EOPNOTSUPP;
364 }
365
366 desc = dmaengine_prep_slave_single(chan, dma_addr, op->dma_len,
367 xfer_dir, DMA_PREP_INTERRUPT);
368 if (!desc) {
369 dev_err(dev, "failed to prepare DMA descriptor\n");
370 ret = PTR_ERR(desc);
371 goto err;
372 }
373 desc->callback = ls1x_nand_dma_callback;
374 desc->callback_param = nfc;
375
376 nfc->dma_cookie = dmaengine_submit(desc);
377 ret = dma_submit_error(nfc->dma_cookie);
378 if (ret) {
379 dev_err(dev, "failed to submit DMA descriptor\n");
380 goto err;
381 }
382
383 dev_dbg(dev, "issue DMA with cookie=%d\n", nfc->dma_cookie);
384 dma_async_issue_pending(chan);
385
386 ret = wait_for_completion_timeout(&nfc->dma_complete,
387 msecs_to_jiffies(2000));
388 if (!ret) {
389 dmaengine_terminate_sync(chan);
390 reinit_completion(&nfc->dma_complete);
391 ret = -ETIMEDOUT;
392 goto err;
393 }
394 ret = 0;
395
396 if (dma_buf)
397 memcpy(op->buf, dma_buf + op->aligned_offset, op->len);
398 err:
399 if (dma_buf)
400 dma_free_coherent(dev, op->dma_len, dma_buf, dma_addr);
401 else
402 dma_unmap_single(dev, dma_addr, op->len, data_dir);
403
404 return ret;
405 }
406
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Keguang Zhang via B4 Relay
<devnull+keguang.zhang.gmail.com@kernel.org>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-media@vger.kernel.org,
Keguang Zhang <keguang.zhang@gmail.com>
Subject: Re: [PATCH v9 2/2] mtd: rawnand: Add Loongson-1 NAND Controller Driver
Date: Sun, 22 Sep 2024 00:45:55 +0800 [thread overview]
Message-ID: <202409220010.vctkHddZ-lkp@intel.com> (raw)
In-Reply-To: <20240920-loongson1-nand-v9-2-9cc7b9345a03@gmail.com>
Hi Keguang,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 62f92d634458a1e308bb699986b9147a6d670457]
url: https://github.com/intel-lab-lkp/linux/commits/Keguang-Zhang-via-B4-Relay/dt-bindings-mtd-Add-Loongson-1-NAND-Controller/20240920-191936
base: 62f92d634458a1e308bb699986b9147a6d670457
patch link: https://lore.kernel.org/r/20240920-loongson1-nand-v9-2-9cc7b9345a03%40gmail.com
patch subject: [PATCH v9 2/2] mtd: rawnand: Add Loongson-1 NAND Controller Driver
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240922/202409220010.vctkHddZ-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240922/202409220010.vctkHddZ-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/202409220010.vctkHddZ-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/mtd/nand/raw/loongson1_nand.c:349:17: warning: cast to smaller integer type 'u32' (aka 'unsigned int') from 'char *' [-Wpointer-to-int-cast]
349 | if (IS_ALIGNED((u32)op->buf, chip->buf_align) &&
| ^~~~~~~~~~~~
include/linux/align.h:13:30: note: expanded from macro 'IS_ALIGNED'
13 | #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
| ^
>> drivers/mtd/nand/raw/loongson1_nand.c:349:17: warning: cast to smaller integer type 'u32' (aka 'unsigned int') from 'char *' [-Wpointer-to-int-cast]
349 | if (IS_ALIGNED((u32)op->buf, chip->buf_align) &&
| ^~~~~~~~~~~~
include/linux/align.h:13:44: note: expanded from macro 'IS_ALIGNED'
13 | #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
| ^
2 warnings generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for OMAP2PLUS_MBOX
Depends on [n]: MAILBOX [=y] && (ARCH_OMAP2PLUS || ARCH_K3)
Selected by [y]:
- TI_K3_M4_REMOTEPROC [=y] && REMOTEPROC [=y] && (ARCH_K3 || COMPILE_TEST [=y])
vim +349 drivers/mtd/nand/raw/loongson1_nand.c
333
334 static int ls1x_nand_dma_transfer(struct ls1x_nfc *nfc,
335 struct ls1x_nfc_op *op)
336 {
337 struct nand_chip *chip = &nfc->chip;
338 struct dma_chan *chan = nfc->dma_chan;
339 struct device *dev = chan->device->dev;
340 struct dma_async_tx_descriptor *desc;
341 enum dma_data_direction data_dir =
342 op->is_write ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
343 enum dma_transfer_direction xfer_dir =
344 op->is_write ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
345 char *dma_buf = NULL;
346 dma_addr_t dma_addr;
347 int ret;
348
> 349 if (IS_ALIGNED((u32)op->buf, chip->buf_align) &&
350 IS_ALIGNED(op->len, chip->buf_align)) {
351 dma_addr = dma_map_single(dev, op->buf, op->len, data_dir);
352 if (dma_mapping_error(dev, dma_addr)) {
353 dev_err(dev, "failed to map DMA buffer\n");
354 return -ENXIO;
355 }
356 } else if (!op->is_write) {
357 dma_buf = dma_alloc_coherent(dev, op->dma_len, &dma_addr,
358 GFP_KERNEL);
359 if (!dma_buf)
360 return -ENOMEM;
361 } else {
362 dev_err(dev, "subpage writing not supported\n");
363 return -EOPNOTSUPP;
364 }
365
366 desc = dmaengine_prep_slave_single(chan, dma_addr, op->dma_len,
367 xfer_dir, DMA_PREP_INTERRUPT);
368 if (!desc) {
369 dev_err(dev, "failed to prepare DMA descriptor\n");
370 ret = PTR_ERR(desc);
371 goto err;
372 }
373 desc->callback = ls1x_nand_dma_callback;
374 desc->callback_param = nfc;
375
376 nfc->dma_cookie = dmaengine_submit(desc);
377 ret = dma_submit_error(nfc->dma_cookie);
378 if (ret) {
379 dev_err(dev, "failed to submit DMA descriptor\n");
380 goto err;
381 }
382
383 dev_dbg(dev, "issue DMA with cookie=%d\n", nfc->dma_cookie);
384 dma_async_issue_pending(chan);
385
386 ret = wait_for_completion_timeout(&nfc->dma_complete,
387 msecs_to_jiffies(2000));
388 if (!ret) {
389 dmaengine_terminate_sync(chan);
390 reinit_completion(&nfc->dma_complete);
391 ret = -ETIMEDOUT;
392 goto err;
393 }
394 ret = 0;
395
396 if (dma_buf)
397 memcpy(op->buf, dma_buf + op->aligned_offset, op->len);
398 err:
399 if (dma_buf)
400 dma_free_coherent(dev, op->dma_len, dma_buf, dma_addr);
401 else
402 dma_unmap_single(dev, dma_addr, op->len, data_dir);
403
404 return ret;
405 }
406
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-09-21 16:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-20 11:18 [PATCH v9 0/2] Add support for Loongson-1 NAND Keguang Zhang
2024-09-20 11:18 ` Keguang Zhang via B4 Relay
2024-09-20 11:18 ` Keguang Zhang via B4 Relay
2024-09-20 11:18 ` [PATCH v9 1/2] dt-bindings: mtd: Add Loongson-1 NAND Controller Keguang Zhang
2024-09-20 11:18 ` Keguang Zhang via B4 Relay
2024-09-20 11:18 ` Keguang Zhang via B4 Relay
2024-09-22 20:33 ` Krzysztof Kozlowski
2024-09-22 20:33 ` Krzysztof Kozlowski
2024-09-20 11:18 ` [PATCH v9 2/2] mtd: rawnand: Add Loongson-1 NAND Controller Driver Keguang Zhang
2024-09-20 11:18 ` Keguang Zhang via B4 Relay
2024-09-20 11:18 ` Keguang Zhang via B4 Relay
2024-09-21 15:54 ` kernel test robot
2024-09-21 15:54 ` kernel test robot
2024-09-21 16:45 ` kernel test robot [this message]
2024-09-21 16:45 ` 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=202409220010.vctkHddZ-lkp@intel.com \
--to=lkp@intel.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=devnull+keguang.zhang.gmail.com@kernel.org \
--cc=keguang.zhang@gmail.com \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=miquel.raynal@bootlin.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=richard@nod.at \
--cc=robh@kernel.org \
--cc=vigneshr@ti.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 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.