From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [kbuild] [ti:ti-rt-linux-5.4.y 4426/6821] drivers/misc/sram-dma-heap.c:157: undefined reference to `.dma_heap_get_drvdata'
Date: Tue, 12 May 2020 20:39:24 +0800 [thread overview]
Message-ID: <20200512123924.GA23005@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 8093 bytes --]
Hi Andrew,
FYI, the error/warning still remains.
tree: git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-rt-linux-5.4.y
head: 0b80a9e05fcfe5b40af3002e8464aede98fe2571
commit: 481b3c3bfdc83b10aedb9819d7c9f1dbc122a5da [4426/6821] misc: sram: Add dma-heap-export reserved SRAM area type
config: powerpc64-randconfig-r004-20200512 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 481b3c3bfdc83b10aedb9819d7c9f1dbc122a5da
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
powerpc64-linux-ld: warning: orphan section `.gnu.hash' from `linker stubs' being placed in section `.gnu.hash'
powerpc64-linux-ld: drivers/misc/sram-dma-heap.o: in function `sram_dma_heap_allocate':
>> drivers/misc/sram-dma-heap.c:157: undefined reference to `.dma_heap_get_drvdata'
powerpc64-linux-ld: drivers/misc/sram-dma-heap.o: in function `sram_dma_heap_export':
>> drivers/misc/sram-dma-heap.c:234: undefined reference to `.dma_heap_add'
git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git remote update ti
git checkout 481b3c3bfdc83b10aedb9819d7c9f1dbc122a5da
vim +157 drivers/misc/sram-dma-heap.c
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 151
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 152 static int sram_dma_heap_allocate(struct dma_heap *heap,
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 153 unsigned long len,
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 154 unsigned long fd_flags,
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 155 unsigned long heap_flags)
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 156 {
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 @157 struct sram_dma_heap *sram_dma_heap = dma_heap_get_drvdata(heap);
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 158 struct sram_dma_heap_buffer *buffer;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 159
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 160 DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 161 struct dma_buf *dmabuf;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 162 int ret;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 163
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 164 buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 165 if (!buffer)
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 166 return -ENOMEM;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 167 buffer->pool = sram_dma_heap->pool;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 168 INIT_LIST_HEAD(&buffer->attachments);
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 169 mutex_init(&buffer->attachments_lock);
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 170 buffer->len = len;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 171
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 172 buffer->vaddr = (void *)gen_pool_alloc(buffer->pool, buffer->len);
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 173 if (!buffer->vaddr) {
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 174 ret = -ENOMEM;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 175 goto free_buffer;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 176 }
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 177
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 178 buffer->paddr = gen_pool_virt_to_phys(buffer->pool, (unsigned long)buffer->vaddr);
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 179 if (buffer->paddr == -1) {
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 180 ret = -ENOMEM;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 181 goto free_pool;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 182 }
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 183
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 184 /* create the dmabuf */
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 185 exp_info.ops = &sram_dma_heap_buf_ops;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 186 exp_info.size = buffer->len;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 187 exp_info.flags = fd_flags;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 188 exp_info.priv = buffer;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 189 dmabuf = dma_buf_export(&exp_info);
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 190 if (IS_ERR(dmabuf)) {
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 191 ret = PTR_ERR(dmabuf);
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 192 goto free_pool;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 193 }
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 194
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 195 ret = dma_buf_fd(dmabuf, fd_flags);
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 196 if (ret < 0) {
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 197 dma_buf_put(dmabuf);
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 198 /* just return, as put will call release and that will free */
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 199 return ret;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 200 }
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 201
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 202 return ret;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 203
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 204 free_pool:
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 205 gen_pool_free(buffer->pool, (unsigned long)buffer->vaddr, buffer->len);
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 206 free_buffer:
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 207 kfree(buffer);
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 208
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 209 return ret;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 210 }
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 211
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 212 static struct dma_heap_ops sram_dma_heap_ops = {
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 213 .allocate = sram_dma_heap_allocate,
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 214 };
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 215
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 216 int sram_dma_heap_export(struct sram_dev *sram,
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 217 struct sram_reserve *block,
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 218 phys_addr_t start,
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 219 struct sram_partition *part)
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 220 {
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 221 struct sram_dma_heap *sram_dma_heap;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 222 struct dma_heap_export_info exp_info;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 223
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 224 dev_info(sram->dev, "Exporting SRAM pool '%s'\n", block->label);
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 225
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 226 sram_dma_heap = kzalloc(sizeof(*sram_dma_heap), GFP_KERNEL);
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 227 if (!sram_dma_heap)
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 228 return -ENOMEM;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 229 sram_dma_heap->pool = part->pool;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 230
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 231 exp_info.name = block->label;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 232 exp_info.ops = &sram_dma_heap_ops;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 233 exp_info.priv = sram_dma_heap;
481b3c3bfdc83b1 Andrew F. Davis 2020-02-19 @234 sram_dma_heap->heap = dma_heap_add(&exp_info);
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 24003 bytes --]
reply other threads:[~2020-05-12 12:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200512123924.GA23005@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.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 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.