From: Andrew Davis <afd@ti.com>
To: "kernel test robot" <lkp@intel.com>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Benjamin Gaignard" <benjamin.gaignard@collabora.com>,
"Liam Mark" <lmark@codeaurora.org>,
"Laura Abbott" <labbott@redhat.com>,
"Brian Starkey" <Brian.Starkey@arm.com>,
"John Stultz" <jstultz@google.com>,
"Christian König" <christian.koenig@amd.com>,
dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
linux-kernel@vger.kernel.org
Cc: <kbuild-all@lists.01.org>
Subject: Re: [PATCH] dma-buf: cma_heap: Check for device max segment size when attaching
Date: Tue, 23 Aug 2022 09:23:07 -0500 [thread overview]
Message-ID: <bf3dbf22-e41c-c15f-942c-834bbefbdc66@ti.com> (raw)
In-Reply-To: <202208230840.npLcmvVn-lkp@intel.com>
On 8/22/22 7:45 PM, kernel test robot wrote:
> Hi Andrew,
>
> Thank you for the patch! Perhaps something to improve:
>
> [auto build test WARNING on drm-misc/drm-misc-next]
> [also build test WARNING on linus/master v6.0-rc2 next-20220822]
> [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/Andrew-Davis/dma-buf-cma_heap-Check-for-device-max-segment-size-when-attaching/20220823-073240
> base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
> config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20220823/202208230840.npLcmvVn-lkp@intel.com/config)
> compiler: s390-linux-gcc (GCC) 12.1.0
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://github.com/intel-lab-lkp/linux/commit/f390cef50ba6681ea767283e413cb8e9f8f2b426
> git remote add linux-review https://github.com/intel-lab-lkp/linux
> git fetch --no-tags linux-review Andrew-Davis/dma-buf-cma_heap-Check-for-device-max-segment-size-when-attaching/20220823-073240
> git checkout f390cef50ba6681ea767283e413cb8e9f8f2b426
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash drivers/dma-buf/
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> drivers/dma-buf/heaps/cma_heap.c: In function 'cma_heap_attach':
>>> drivers/dma-buf/heaps/cma_heap.c:61:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
Hmm, thought someone removed this warning after we switched to C11, maybe it
is time again for some brave soul to re-poke that topic..
Not sure why I missed it when compiling though, will fix for v2.
Andrew
> 61 | size_t max_segment = dma_get_max_seg_size(attachment->dev);
> | ^~~~~~
>
>
> vim +61 drivers/dma-buf/heaps/cma_heap.c
>
> 49
> 50 static int cma_heap_attach(struct dma_buf *dmabuf,
> 51 struct dma_buf_attachment *attachment)
> 52 {
> 53 struct cma_heap_buffer *buffer = dmabuf->priv;
> 54 struct dma_heap_attachment *a;
> 55 int ret;
> 56
> 57 a = kzalloc(sizeof(*a), GFP_KERNEL);
> 58 if (!a)
> 59 return -ENOMEM;
> 60
> > 61 size_t max_segment = dma_get_max_seg_size(attachment->dev);
> 62 ret = sg_alloc_table_from_pages_segment(&a->table, buffer->pages,
> 63 buffer->pagecount, 0,
> 64 buffer->pagecount << PAGE_SHIFT,
> 65 max_segment, GFP_KERNEL);
> 66 if (ret) {
> 67 kfree(a);
> 68 return ret;
> 69 }
> 70
> 71 a->dev = attachment->dev;
> 72 INIT_LIST_HEAD(&a->list);
> 73 a->mapped = false;
> 74
> 75 attachment->priv = a;
> 76
> 77 mutex_lock(&buffer->lock);
> 78 list_add(&a->list, &buffer->attachments);
> 79 mutex_unlock(&buffer->lock);
> 80
> 81 return 0;
> 82 }
> 83
>
next prev parent reply other threads:[~2022-08-23 16:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-22 23:30 [PATCH] dma-buf: cma_heap: Check for device max segment size when attaching Andrew Davis
2022-08-23 0:45 ` kernel test robot
2022-08-23 14:23 ` Andrew Davis [this message]
2022-08-23 7:52 ` 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=bf3dbf22-e41c-c15f-942c-834bbefbdc66@ti.com \
--to=afd@ti.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=kbuild-all@lists.01.org \
--cc=labbott@redhat.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=lmark@codeaurora.org \
--cc=sumit.semwal@linaro.org \
/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