From: kernel test robot <lkp@intel.com>
To: "Maxime Ripard" <mripard@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Saravana Kannan" <saravanak@google.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>
Cc: oe-kbuild-all@lists.linux.dev,
Mattijs Korpershoek <mkorpershoek@baylibre.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
linaro-mm-sig@lists.linaro.org,
Maxime Ripard <mripard@kernel.org>
Subject: Re: [PATCH 7/8] dma-buf: heaps: cma: Handle ECC flags
Date: Thu, 16 May 2024 20:48:15 +0800 [thread overview]
Message-ID: <202405162048.CExrV8yy-lkp@intel.com> (raw)
In-Reply-To: <20240515-dma-buf-ecc-heap-v1-7-54cbbd049511@kernel.org>
Hi Maxime,
kernel test robot noticed the following build errors:
[auto build test ERROR on a38297e3fb012ddfa7ce0321a7e5a8daeb1872b6]
url: https://github.com/intel-lab-lkp/linux/commits/Maxime-Ripard/dma-buf-heaps-Introduce-a-new-heap-for-reserved-memory/20240515-215850
base: a38297e3fb012ddfa7ce0321a7e5a8daeb1872b6
patch link: https://lore.kernel.org/r/20240515-dma-buf-ecc-heap-v1-7-54cbbd049511%40kernel.org
patch subject: [PATCH 7/8] dma-buf: heaps: cma: Handle ECC flags
config: mips-allmodconfig (https://download.01.org/0day-ci/archive/20240516/202405162048.CExrV8yy-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240516/202405162048.CExrV8yy-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/202405162048.CExrV8yy-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/dma-buf/heaps/cma_heap.c: In function 'cma_heap_allocate':
drivers/dma-buf/heaps/cma_heap.c:293:24: warning: returning 'int' from a function with return type 'struct dma_buf *' makes pointer from integer without a cast [-Wint-conversion]
293 | return -EINVAL;
| ^
drivers/dma-buf/heaps/cma_heap.c:296:24: warning: returning 'int' from a function with return type 'struct dma_buf *' makes pointer from integer without a cast [-Wint-conversion]
296 | return -EINVAL;
| ^
drivers/dma-buf/heaps/cma_heap.c: In function '__add_cma_heap':
>> drivers/dma-buf/heaps/cma_heap.c:386:13: error: implicit declaration of function 'of_memory_get_ecc_correction_bits' [-Werror=implicit-function-declaration]
386 | if (of_memory_get_ecc_correction_bits() > 0)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/of_memory_get_ecc_correction_bits +386 drivers/dma-buf/heaps/cma_heap.c
275
276 static struct dma_buf *cma_heap_allocate(struct dma_heap *heap,
277 unsigned long len,
278 unsigned long fd_flags,
279 unsigned long heap_flags)
280 {
281 struct cma_heap *cma_heap = dma_heap_get_drvdata(heap);
282 struct cma_heap_buffer *buffer;
283 DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
284 size_t size = PAGE_ALIGN(len);
285 pgoff_t pagecount = size >> PAGE_SHIFT;
286 unsigned long align = get_order(size);
287 struct page *cma_pages;
288 struct dma_buf *dmabuf;
289 int ret = -ENOMEM;
290 pgoff_t pg;
291
292 if (!cma_heap->ecc_enabled && (heap_flags & DMA_HEAP_FLAG_ECC_PROTECTED))
> 293 return -EINVAL;
294
295 if (cma_heap->ecc_enabled && (heap_flags & DMA_HEAP_FLAG_ECC_UNPROTECTED))
296 return -EINVAL;
297
298 buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);
299 if (!buffer)
300 return ERR_PTR(-ENOMEM);
301
302 INIT_LIST_HEAD(&buffer->attachments);
303 mutex_init(&buffer->lock);
304 buffer->len = size;
305
306 if (align > CONFIG_CMA_ALIGNMENT)
307 align = CONFIG_CMA_ALIGNMENT;
308
309 cma_pages = cma_alloc(cma_heap->cma, pagecount, align, false);
310 if (!cma_pages)
311 goto free_buffer;
312
313 /* Clear the cma pages */
314 if (PageHighMem(cma_pages)) {
315 unsigned long nr_clear_pages = pagecount;
316 struct page *page = cma_pages;
317
318 while (nr_clear_pages > 0) {
319 void *vaddr = kmap_atomic(page);
320
321 memset(vaddr, 0, PAGE_SIZE);
322 kunmap_atomic(vaddr);
323 /*
324 * Avoid wasting time zeroing memory if the process
325 * has been killed by by SIGKILL
326 */
327 if (fatal_signal_pending(current))
328 goto free_cma;
329 page++;
330 nr_clear_pages--;
331 }
332 } else {
333 memset(page_address(cma_pages), 0, size);
334 }
335
336 buffer->pages = kmalloc_array(pagecount, sizeof(*buffer->pages), GFP_KERNEL);
337 if (!buffer->pages) {
338 ret = -ENOMEM;
339 goto free_cma;
340 }
341
342 for (pg = 0; pg < pagecount; pg++)
343 buffer->pages[pg] = &cma_pages[pg];
344
345 buffer->cma_pages = cma_pages;
346 buffer->heap = cma_heap;
347 buffer->pagecount = pagecount;
348
349 /* create the dmabuf */
350 exp_info.exp_name = dma_heap_get_name(heap);
351 exp_info.ops = &cma_heap_buf_ops;
352 exp_info.size = buffer->len;
353 exp_info.flags = fd_flags;
354 exp_info.priv = buffer;
355 dmabuf = dma_buf_export(&exp_info);
356 if (IS_ERR(dmabuf)) {
357 ret = PTR_ERR(dmabuf);
358 goto free_pages;
359 }
360 return dmabuf;
361
362 free_pages:
363 kfree(buffer->pages);
364 free_cma:
365 cma_release(cma_heap->cma, cma_pages, pagecount);
366 free_buffer:
367 kfree(buffer);
368
369 return ERR_PTR(ret);
370 }
371
372 static const struct dma_heap_ops cma_heap_ops = {
373 .allocate = cma_heap_allocate,
374 };
375
376 static int __add_cma_heap(struct cma *cma, void *data)
377 {
378 struct cma_heap *cma_heap;
379 struct dma_heap_export_info exp_info;
380
381 cma_heap = kzalloc(sizeof(*cma_heap), GFP_KERNEL);
382 if (!cma_heap)
383 return -ENOMEM;
384 cma_heap->cma = cma;
385
> 386 if (of_memory_get_ecc_correction_bits() > 0)
387 cma_heap->ecc_enabled = true;
388
389 exp_info.name = cma_get_name(cma);
390 exp_info.ops = &cma_heap_ops;
391 exp_info.priv = cma_heap;
392
393 cma_heap->heap = dma_heap_add(&exp_info);
394 if (IS_ERR(cma_heap->heap)) {
395 int ret = PTR_ERR(cma_heap->heap);
396
397 kfree(cma_heap);
398 return ret;
399 }
400
401 return 0;
402 }
403
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-05-16 12:49 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-15 13:56 [PATCH 0/8] dma-buf: heaps: Support carved-out heaps and ECC related-flags Maxime Ripard
2024-05-15 13:56 ` [PATCH 1/8] dma-buf: heaps: Introduce a new heap for reserved memory Maxime Ripard
2024-05-15 13:56 ` [PATCH 2/8] of: Add helper to retrieve ECC memory bits Maxime Ripard
2024-05-15 13:56 ` [PATCH 3/8] dma-buf: heaps: Import uAPI header Maxime Ripard
2024-05-16 8:14 ` Christian König
2024-05-15 13:56 ` [PATCH 4/8] dma-buf: heaps: Add ECC protection flags Maxime Ripard
2024-05-15 13:57 ` [PATCH 5/8] dma-buf: heaps: system: Remove global variable Maxime Ripard
2024-05-15 13:57 ` [PATCH 6/8] dma-buf: heaps: system: Handle ECC flags Maxime Ripard
2024-05-15 13:57 ` [PATCH 7/8] dma-buf: heaps: cma: " Maxime Ripard
2024-05-16 5:55 ` kernel test robot
2024-05-16 12:48 ` kernel test robot [this message]
2024-05-15 13:57 ` [PATCH 8/8] dma-buf: heaps: carveout: " Maxime Ripard
2024-05-15 18:42 ` [PATCH 0/8] dma-buf: heaps: Support carved-out heaps and ECC related-flags John Stultz
2024-05-16 10:56 ` Daniel Vetter
2024-05-16 12:41 ` Maxime Ripard
2024-05-16 16:51 ` John Stultz
2024-05-21 12:06 ` Daniel Vetter
2024-05-22 13:18 ` Maxime Ripard
2024-05-23 9:45 ` Daniel Vetter
2024-06-28 11:29 ` Thierry Reding
2024-06-28 13:08 ` Maxime Ripard
2024-06-28 14:42 ` Thierry Reding
2024-07-04 12:24 ` Maxime Ripard
2024-07-05 14:31 ` Thierry Reding
2024-07-05 15:35 ` Daniel Vetter
2024-07-08 7:14 ` [Linaro-mm-sig] " Christian König
2024-07-11 12:44 ` Thierry Reding
2024-07-10 12:10 ` Maxime Ripard
2024-07-11 12:43 ` Thierry Reding
2024-07-12 10:37 ` Thierry Reding
2024-05-16 12:21 ` Maxime Ripard
2024-05-16 17:09 ` John Stultz
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=202405162048.CExrV8yy-lkp@intel.com \
--to=lkp@intel.com \
--cc=Brian.Starkey@arm.com \
--cc=benjamin.gaignard@collabora.com \
--cc=christian.koenig@amd.com \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jstultz@google.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mkorpershoek@baylibre.com \
--cc=mripard@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=robh@kernel.org \
--cc=saravanak@google.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 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.