From: kernel test robot <lkp@intel.com>
To: Sven Peter <sven@svenpeter.dev>, Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Joerg Roedel <joro@8bytes.org>, Rob Herring <robh+dt@kernel.org>
Cc: kbuild-all@lists.01.org, Sven Peter <sven@svenpeter.dev>,
Arnd Bergmann <arnd@kernel.org>,
devicetree@vger.kernel.org, Hector Martin <marcan@marcan.st>,
linux-kernel@vger.kernel.org, Marc Zyngier <maz@kernel.org>
Subject: Re: [PATCH v2 3/3] iommu: dart: Add DART iommu driver
Date: Sun, 28 Mar 2021 17:34:56 +0800 [thread overview]
Message-ID: <202103281719.Xb7Kqjb4-lkp@intel.com> (raw)
In-Reply-To: <20210328074009.95932-4-sven@svenpeter.dev>
[-- Attachment #1: Type: text/plain, Size: 8391 bytes --]
Hi Sven,
I love your patch! Yet something to improve:
[auto build test ERROR on arm-perf/for-next/perf]
[also build test ERROR on linus/master v5.12-rc4]
[cannot apply to iommu/next next-20210326]
[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]
url: https://github.com/0day-ci/linux/commits/Sven-Peter/Apple-M1-DART-IOMMU-driver/20210328-154437
base: https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git for-next/perf
config: sparc-allmodconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.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/0day-ci/linux/commit/ecad602f1731c2ad5ba1579d56da519e38f57b2b
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sven-Peter/Apple-M1-DART-IOMMU-driver/20210328-154437
git checkout ecad602f1731c2ad5ba1579d56da519e38f57b2b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sparc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
drivers/iommu/apple-dart-iommu.c: In function 'apple_dart_finalize_domain':
>> drivers/iommu/apple-dart-iommu.c:427:34: error: implicit declaration of function 'DMA_BIT_MASK'; did you mean 'BIT_MASK'? [-Werror=implicit-function-declaration]
427 | domain->geometry.aperture_end = DMA_BIT_MASK(32);
| ^~~~~~~~~~~~
| BIT_MASK
drivers/iommu/apple-dart-iommu.c: In function 'apple_dart_attach_stream':
>> drivers/iommu/apple-dart-iommu.c:456:11: error: implicit declaration of function 'kzalloc'; did you mean 'kvzalloc'? [-Werror=implicit-function-declaration]
456 | stream = kzalloc(sizeof(*stream), GFP_KERNEL);
| ^~~~~~~
| kvzalloc
>> drivers/iommu/apple-dart-iommu.c:456:9: warning: assignment to 'struct apple_dart_stream *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
456 | stream = kzalloc(sizeof(*stream), GFP_KERNEL);
| ^
drivers/iommu/apple-dart-iommu.c: In function 'apple_dart_detach_stream':
>> drivers/iommu/apple-dart-iommu.c:523:5: error: implicit declaration of function 'kfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
523 | kfree(stream);
| ^~~~~
| kvfree
drivers/iommu/apple-dart-iommu.c: In function 'apple_dart_domain_alloc':
>> drivers/iommu/apple-dart-iommu.c:627:14: warning: assignment to 'struct apple_dart_domain *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
627 | dart_domain = kzalloc(sizeof(*dart_domain), GFP_KERNEL);
| ^
drivers/iommu/apple-dart-iommu.c: In function 'apple_dart_of_xlate':
>> drivers/iommu/apple-dart-iommu.c:659:7: warning: assignment to 'struct apple_dart_master_cfg *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
659 | cfg = kzalloc(struct_size(cfg, streams, 1), GFP_KERNEL);
| ^
>> drivers/iommu/apple-dart-iommu.c:663:13: error: implicit declaration of function 'krealloc'; did you mean 'kvcalloc'? [-Werror=implicit-function-declaration]
663 | cfg_new = krealloc(
| ^~~~~~~~
| kvcalloc
drivers/iommu/apple-dart-iommu.c:663:11: warning: assignment to 'struct apple_dart_master_cfg *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
663 | cfg_new = krealloc(
| ^
cc1: some warnings being treated as errors
vim +427 drivers/iommu/apple-dart-iommu.c
397
398 /* must be called with held dart_domain->lock */
399 static int apple_dart_finalize_domain(struct iommu_domain *domain)
400 {
401 struct apple_dart_domain *dart_domain = to_dart_domain(domain);
402 struct apple_dart *dart = dart_domain->dart;
403 struct io_pgtable_cfg pgtbl_cfg;
404
405 if (dart_domain->pgtbl_ops)
406 return 0;
407 if (dart_domain->type != IOMMU_DOMAIN_DMA &&
408 dart_domain->type != IOMMU_DOMAIN_UNMANAGED)
409 return 0;
410
411 pgtbl_cfg = (struct io_pgtable_cfg){
412 .pgsize_bitmap = SZ_16K,
413 .ias = 32,
414 .oas = 36,
415 .coherent_walk = 1,
416 .tlb = &apple_dart_tlb_ops,
417 .iommu_dev = dart->dev,
418 };
419
420 dart_domain->pgtbl_ops =
421 alloc_io_pgtable_ops(ARM_APPLE_DART, &pgtbl_cfg, domain);
422 if (!dart_domain->pgtbl_ops)
423 return -ENOMEM;
424
425 domain->pgsize_bitmap = pgtbl_cfg.pgsize_bitmap;
426 domain->geometry.aperture_start = 0;
> 427 domain->geometry.aperture_end = DMA_BIT_MASK(32);
428 domain->geometry.force_aperture = true;
429
430 return 0;
431 }
432
433 /* must be called with held domain->lock */
434 static int apple_dart_attach_stream(struct apple_dart_domain *domain,
435 struct apple_dart *dart, u32 sid)
436 {
437 unsigned long flags;
438 struct apple_dart_stream *stream;
439 struct io_pgtable_cfg *pgtbl_cfg;
440 int ret;
441
442 list_for_each_entry(stream, &domain->streams, stream_head) {
443 if (stream->dart == dart && stream->sid == sid) {
444 stream->num_devices++;
445 return 0;
446 }
447 }
448
449 spin_lock_irqsave(&dart->lock, flags);
450
451 if (WARN_ON(dart->used_sids & BIT(sid))) {
452 ret = -EINVAL;
453 goto error;
454 }
455
> 456 stream = kzalloc(sizeof(*stream), GFP_KERNEL);
457 if (!stream) {
458 ret = -ENOMEM;
459 goto error;
460 }
461
462 stream->dart = dart;
463 stream->sid = sid;
464 stream->num_devices = 1;
465 list_add(&stream->stream_head, &domain->streams);
466
467 dart->used_sids |= BIT(sid);
468 spin_unlock_irqrestore(&dart->lock, flags);
469
470 apple_dart_hw_clear_all_ttbrs(stream->dart, stream->sid);
471
472 switch (domain->type) {
473 case IOMMU_DOMAIN_IDENTITY:
474 apple_dart_hw_enable_bypass(stream->dart, stream->sid);
475 break;
476 case IOMMU_DOMAIN_BLOCKED:
477 apple_dart_hw_enable_isolation(stream->dart, stream->sid);
478 break;
479 case IOMMU_DOMAIN_UNMANAGED:
480 case IOMMU_DOMAIN_DMA:
481 pgtbl_cfg = &io_pgtable_ops_to_pgtable(domain->pgtbl_ops)->cfg;
482 apple_dart_hw_set_ttbr(stream->dart, stream->sid, 0,
483 pgtbl_cfg->apple_dart_cfg.ttbr);
484
485 apple_dart_hw_enable_translation(stream->dart, stream->sid);
486 apple_dart_hw_invalidate_tlb_stream(stream->dart, stream->sid);
487 break;
488 }
489
490 return 0;
491
492 error:
493 spin_unlock_irqrestore(&dart->lock, flags);
494 return ret;
495 }
496
497 static void apple_dart_disable_stream(struct apple_dart *dart, u32 sid)
498 {
499 unsigned long flags;
500
501 apple_dart_hw_enable_isolation(dart, sid);
502 apple_dart_hw_clear_all_ttbrs(dart, sid);
503 apple_dart_hw_invalidate_tlb_stream(dart, sid);
504
505 spin_lock_irqsave(&dart->lock, flags);
506 dart->used_sids &= ~BIT(sid);
507 spin_unlock_irqrestore(&dart->lock, flags);
508 }
509
510 /* must be called with held domain->lock */
511 static void apple_dart_detach_stream(struct apple_dart_domain *domain,
512 struct apple_dart *dart, u32 sid)
513 {
514 struct apple_dart_stream *stream;
515
516 list_for_each_entry(stream, &domain->streams, stream_head) {
517 if (stream->dart == dart && stream->sid == sid) {
518 stream->num_devices--;
519
520 if (stream->num_devices == 0) {
521 apple_dart_disable_stream(dart, sid);
522 list_del(&stream->stream_head);
> 523 kfree(stream);
524 }
525 return;
526 }
527 }
528 }
529
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 68801 bytes --]
next prev parent reply other threads:[~2021-03-28 9:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-28 7:40 [PATCH v2 0/3] Apple M1 DART IOMMU driver Sven Peter
2021-03-28 7:40 ` [PATCH v2 1/3] iommu: io-pgtable: add DART pagetable format Sven Peter
2021-03-28 9:42 ` kernel test robot
2021-03-28 10:13 ` Sven Peter
2021-03-28 10:04 ` kernel test robot
2021-04-07 10:44 ` Will Deacon
2021-04-09 16:55 ` Sven Peter
2021-04-09 19:38 ` Arnd Bergmann
2021-04-19 16:31 ` Will Deacon
2021-03-28 7:40 ` [PATCH v2 2/3] dt-bindings: iommu: add DART iommu bindings Sven Peter
2021-03-28 8:16 ` Arnd Bergmann
2021-03-28 9:22 ` Sven Peter
2021-03-28 7:40 ` [PATCH v2 3/3] iommu: dart: Add DART iommu driver Sven Peter
2021-03-28 9:34 ` kernel test robot [this message]
2021-03-28 10:11 ` Sven Peter
2021-04-07 10:42 ` Will Deacon
2021-04-09 16:50 ` Sven Peter
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=202103281719.Xb7Kqjb4-lkp@intel.com \
--to=lkp@intel.com \
--cc=arnd@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=joro@8bytes.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcan@marcan.st \
--cc=maz@kernel.org \
--cc=robh+dt@kernel.org \
--cc=robin.murphy@arm.com \
--cc=sven@svenpeter.dev \
--cc=will@kernel.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;
as well as URLs for NNTP newsgroup(s).