public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Huan Yang" <link@vivo.com>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Benjamin Gaignard" <benjamin.gaignard@collabora.com>,
	"Brian Starkey" <Brian.Starkey@arm.com>,
	"John Stultz" <jstultz@google.com>,
	"T.J. Mercier" <tjmercier@google.com>,
	"Christian König" <christian.koenig@amd.com>,
	linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	opensource.kernel@vivo.com, Huan Yang <link@vivo.com>
Subject: Re: [PATCH 1/2] dma-buf: heaps: DMA_HEAP_IOCTL_ALLOC_READ_FILE framework
Date: Sat, 13 Jul 2024 18:33:23 +0800	[thread overview]
Message-ID: <202407131825.A44mFGu1-lkp@intel.com> (raw)
In-Reply-To: <20240711074221.459589-2-link@vivo.com>

Hi Huan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 523b23f0bee3014a7a752c9bb9f5c54f0eddae88]

url:    https://github.com/intel-lab-lkp/linux/commits/Huan-Yang/dma-buf-heaps-DMA_HEAP_IOCTL_ALLOC_READ_FILE-framework/20240711-155902
base:   523b23f0bee3014a7a752c9bb9f5c54f0eddae88
patch link:    https://lore.kernel.org/r/20240711074221.459589-2-link%40vivo.com
patch subject: [PATCH 1/2] dma-buf: heaps: DMA_HEAP_IOCTL_ALLOC_READ_FILE framework
config: i386-buildonly-randconfig-002-20240713 (https://download.01.org/0day-ci/archive/20240713/202407131825.A44mFGu1-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240713/202407131825.A44mFGu1-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/202407131825.A44mFGu1-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/dma-buf/dma-heap.c:293:18: warning: format specifies type 'long' but the argument has type 'ssize_t' (aka 'int') [-Wformat]
     292 |                         pr_err("failed to use buffer kernel_read_file %s, err=%ld, [%ld, %ld], f_sz=%ld\n",
         |                                                                               ~~~
         |                                                                               %zd
     293 |                                pathp, err, start, fsz, fsz);
         |                                       ^~~
   include/linux/printk.h:533:33: note: expanded from macro 'pr_err'
     533 |         printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |                                ~~~     ^~~~~~~~~~~
   include/linux/printk.h:490:60: note: expanded from macro 'printk'
     490 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
         |                                                     ~~~    ^~~~~~~~~~~
   include/linux/printk.h:462:19: note: expanded from macro 'printk_index_wrap'
     462 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
         |                         ~~~~    ^~~~~~~~~~~
>> drivers/dma-buf/dma-heap.c:293:23: warning: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
     292 |                         pr_err("failed to use buffer kernel_read_file %s, err=%ld, [%ld, %ld], f_sz=%ld\n",
         |                                                                                     ~~~
         |                                                                                     %zu
     293 |                                pathp, err, start, fsz, fsz);
         |                                            ^~~~~
   include/linux/printk.h:533:33: note: expanded from macro 'pr_err'
     533 |         printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |                                ~~~     ^~~~~~~~~~~
   include/linux/printk.h:490:60: note: expanded from macro 'printk'
     490 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
         |                                                     ~~~    ^~~~~~~~~~~
   include/linux/printk.h:462:19: note: expanded from macro 'printk_index_wrap'
     462 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
         |                         ~~~~    ^~~~~~~~~~~
   drivers/dma-buf/dma-heap.c:293:30: warning: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
     292 |                         pr_err("failed to use buffer kernel_read_file %s, err=%ld, [%ld, %ld], f_sz=%ld\n",
         |                                                                                          ~~~
         |                                                                                          %zu
     293 |                                pathp, err, start, fsz, fsz);
         |                                                   ^~~
   include/linux/printk.h:533:33: note: expanded from macro 'pr_err'
     533 |         printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |                                ~~~     ^~~~~~~~~~~
   include/linux/printk.h:490:60: note: expanded from macro 'printk'
     490 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
         |                                                     ~~~    ^~~~~~~~~~~
   include/linux/printk.h:462:19: note: expanded from macro 'printk_index_wrap'
     462 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
         |                         ~~~~    ^~~~~~~~~~~
   drivers/dma-buf/dma-heap.c:293:35: warning: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
     292 |                         pr_err("failed to use buffer kernel_read_file %s, err=%ld, [%ld, %ld], f_sz=%ld\n",
         |                                                                                                     ~~~
         |                                                                                                     %zu
     293 |                                pathp, err, start, fsz, fsz);
         |                                                        ^~~
   include/linux/printk.h:533:33: note: expanded from macro 'pr_err'
     533 |         printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |                                ~~~     ^~~~~~~~~~~
   include/linux/printk.h:490:60: note: expanded from macro 'printk'
     490 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
         |                                                     ~~~    ^~~~~~~~~~~
   include/linux/printk.h:462:19: note: expanded from macro 'printk_index_wrap'
     462 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
         |                         ~~~~    ^~~~~~~~~~~
   drivers/dma-buf/dma-heap.c:367:10: warning: format specifies type 'long' but the argument has type 'ssize_t' (aka 'int') [-Wformat]
     366 |                 pr_err("use kernel_read_file, err=%ld, [%ld, %ld], f_sz=%ld\n",
         |                                                   ~~~
         |                                                   %zd
     367 |                        err, start, (start + size), heap_file->fsz);
         |                        ^~~
   include/linux/printk.h:533:33: note: expanded from macro 'pr_err'
     533 |         printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |                                ~~~     ^~~~~~~~~~~
   include/linux/printk.h:490:60: note: expanded from macro 'printk'
     490 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
         |                                                     ~~~    ^~~~~~~~~~~
   include/linux/printk.h:462:19: note: expanded from macro 'printk_index_wrap'
     462 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
         |                         ~~~~    ^~~~~~~~~~~
   drivers/dma-buf/dma-heap.c:367:15: warning: format specifies type 'long' but the argument has type 'ssize_t' (aka 'int') [-Wformat]
     366 |                 pr_err("use kernel_read_file, err=%ld, [%ld, %ld], f_sz=%ld\n",
         |                                                         ~~~
         |                                                         %zd
     367 |                        err, start, (start + size), heap_file->fsz);
         |                             ^~~~~
   include/linux/printk.h:533:33: note: expanded from macro 'pr_err'
     533 |         printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |                                ~~~     ^~~~~~~~~~~
   include/linux/printk.h:490:60: note: expanded from macro 'printk'
     490 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
         |                                                     ~~~    ^~~~~~~~~~~
   include/linux/printk.h:462:19: note: expanded from macro 'printk_index_wrap'
     462 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
         |                         ~~~~    ^~~~~~~~~~~
   drivers/dma-buf/dma-heap.c:367:22: warning: format specifies type 'long' but the argument has type 'ssize_t' (aka 'int') [-Wformat]
     366 |                 pr_err("use kernel_read_file, err=%ld, [%ld, %ld], f_sz=%ld\n",
         |                                                              ~~~
         |                                                              %zd
     367 |                        err, start, (start + size), heap_file->fsz);
         |                                    ^~~~~~~~~~~~~~
   include/linux/printk.h:533:33: note: expanded from macro 'pr_err'
     533 |         printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |                                ~~~     ^~~~~~~~~~~
   include/linux/printk.h:490:60: note: expanded from macro 'printk'
     490 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
         |                                                     ~~~    ^~~~~~~~~~~
   include/linux/printk.h:462:19: note: expanded from macro 'printk_index_wrap'
     462 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
         |                         ~~~~    ^~~~~~~~~~~
   drivers/dma-buf/dma-heap.c:367:38: warning: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
     366 |                 pr_err("use kernel_read_file, err=%ld, [%ld, %ld], f_sz=%ld\n",
         |                                                                         ~~~
         |                                                                         %zu
     367 |                        err, start, (start + size), heap_file->fsz);
         |                                                    ^~~~~~~~~~~~~~
   include/linux/printk.h:533:33: note: expanded from macro 'pr_err'
     533 |         printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |                                ~~~     ^~~~~~~~~~~
   include/linux/printk.h:490:60: note: expanded from macro 'printk'
     490 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)


vim +293 drivers/dma-buf/dma-heap.c

   239	
   240	int dma_heap_submit_file_read(struct dma_heap_file_task *heap_ftask)
   241	{
   242		struct dma_heap_file_work *heap_fwork = init_file_work(heap_ftask);
   243		struct page *last = NULL;
   244		struct dma_heap_file *heap_file = heap_ftask->heap_file;
   245		size_t start = heap_ftask->roffset;
   246		struct file *file = heap_file->file;
   247		size_t fsz = heap_file->fsz;
   248	
   249		if (unlikely(!heap_fwork))
   250			return -ENOMEM;
   251	
   252		/**
   253		 * If file size is not page aligned, direct io can't process the tail.
   254		 * So, if reach to tail, remain the last page use buffer read.
   255		 */
   256		if (heap_file->direct && start + heap_ftask->rsize > fsz) {
   257			heap_fwork->need_size -= PAGE_SIZE;
   258			last = heap_ftask->parray[heap_ftask->pindex - 1];
   259		}
   260	
   261		spin_lock(&heap_fctl->lock);
   262		list_add_tail(&heap_fwork->list, &heap_fctl->works);
   263		spin_unlock(&heap_fctl->lock);
   264		atomic_inc(&heap_fctl->nr_work);
   265	
   266		wake_up(&heap_fctl->threadwq);
   267	
   268		if (last) {
   269			char *buf, *pathp;
   270			ssize_t err;
   271			void *buffer;
   272	
   273			buf = kmalloc(PATH_MAX, GFP_KERNEL);
   274			if (unlikely(!buf))
   275				return -ENOMEM;
   276	
   277			start = PAGE_ALIGN_DOWN(fsz);
   278	
   279			pathp = file_path(file, buf, PATH_MAX);
   280			if (IS_ERR(pathp)) {
   281				kfree(buf);
   282				return PTR_ERR(pathp);
   283			}
   284	
   285			buffer = kmap_local_page(last); // use page's kaddr.
   286			err = kernel_read_file_from_path(pathp, start, &buffer,
   287							 fsz - start, &fsz,
   288							 READING_POLICY);
   289			kunmap_local(buffer);
   290			kfree(buf);
   291			if (err < 0) {
   292				pr_err("failed to use buffer kernel_read_file %s, err=%ld, [%ld, %ld], f_sz=%ld\n",
 > 293				       pathp, err, start, fsz, fsz);
   294	
   295				return err;
   296			}
   297		}
   298	
   299		heap_ftask->roffset += heap_ftask->rsize;
   300		heap_ftask->rsize = 0;
   301		heap_ftask->pindex = 0;
   302		heap_ftask->rbatch = min_t(size_t,
   303					   PAGE_ALIGN(fsz) - heap_ftask->roffset,
   304					   heap_ftask->rbatch);
   305		return 0;
   306	}
   307	

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

  parent reply	other threads:[~2024-07-13 10:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11  7:42 [PATCH 0/2] Introduce DMA_HEAP_IOCTL_ALLOC_AND_READ Huan Yang
2024-07-11  7:42 ` [PATCH 1/2] dma-buf: heaps: DMA_HEAP_IOCTL_ALLOC_READ_FILE framework Huan Yang
2024-07-11  9:00   ` Christian König
2024-07-11  9:18     ` Huan Yang
2024-07-11 11:39       ` Christian König
2024-07-12  1:59         ` Huan Yang
2024-07-12  2:14           ` Huan Yang
2024-07-12  7:10             ` Christian König
2024-07-12  7:29               ` Huan Yang
2024-07-12  7:41                 ` Christian König
2024-07-12  7:52                   ` Huan Yang
2024-07-12 10:59                     ` Christian König
2024-07-12 11:12                       ` Huan Yang
2024-07-15  9:11     ` Daniel Vetter
2024-07-15 12:32       ` Christian König
2024-07-16  2:48         ` Huan Yang
2024-07-16  9:31           ` Daniel Vetter
2024-07-16 10:14             ` Huan Yang
2024-07-17 15:15               ` Daniel Vetter
2024-07-17 17:03                 ` Christoph Hellwig
2024-07-18  1:51                   ` Huan Yang
2024-07-18  3:08                     ` Christoph Hellwig
2024-07-18  3:12                       ` Huan Yang
2024-07-24  7:12                   ` Huan Yang
     [not found]             ` <d3ad46ea-df7f-4402-b48a-349e957f198b@amd.com>
2024-07-17  7:33               ` Huan Yang
2024-07-17 15:23               ` Daniel Vetter
2024-07-13 10:33   ` kernel test robot [this message]
2024-07-11  7:42 ` [PATCH 2/2] dma-buf: heaps: system_heap support DMA_HEAP_IOCTL_ALLOC_AND_READ Huan Yang

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=202407131825.A44mFGu1-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Brian.Starkey@arm.com \
    --cc=benjamin.gaignard@collabora.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jstultz@google.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=link@vivo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=opensource.kernel@vivo.com \
    --cc=sumit.semwal@linaro.org \
    --cc=tjmercier@google.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