[meghadey-crypto:d_msix 1/1] kernel/irq/msi.c:730: error: expected '(' at end of input

From: kernel test robot
Date: Sun Aug 29 2021 - 18:28:12 EST


tree: https://github.com/meghadey/crypto d_msix
head: 37b5937a105abc8efe975c67fe4444e47da17c60
commit: 37b5937a105abc8efe975c67fe4444e47da17c60 [1/1] PCI/MSI: Dynamic allocation of MSI-X vectors
config: sparc64-randconfig-r002-20210829 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 11.2.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/meghadey/crypto/commit/37b5937a105abc8efe975c67fe4444e47da17c60
git remote add meghadey-crypto https://github.com/meghadey/crypto
git fetch --no-tags meghadey-crypto d_msix
git checkout 37b5937a105abc8efe975c67fe4444e47da17c60
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sparc64 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

In file included from <command-line>:
kernel/irq/msi.c: In function '__msi_domain_alloc_irqs':
>> include/linux/compiler_types.h:328:68: error: unterminated argument list invoking macro "if"
328 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:119:18: note: in expansion of macro 'READ_ONCE'
119 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~
include/asm-generic/percpu.h:138:25: note: in expansion of macro '__this_cpu_generic_read_nopreempt'
138 | __ret = __this_cpu_generic_read_nopreempt(pcp); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:329:41: note: in expansion of macro 'this_cpu_generic_read'
329 | #define this_cpu_read_8(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:324:30: note: in expansion of macro 'this_cpu_read_8'
324 | case 8: pscr_ret__ = stem##8(variable); break; \
| ^~~~
include/linux/percpu-defs.h:507:41: note: in expansion of macro '__pcpu_size_call_return'
507 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
include/linux/interrupt.h:561:16: note: in expansion of macro 'this_cpu_read'
561 | return this_cpu_read(ksoftirqd);
| ^~~~~~~~~~~~~
>> kernel/irq/msi.c:730: error: expected '(' at end of input
kernel/irq/msi.c:576:9: note: '-Wmisleading-indentation' is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
576 | if (ret
| ^~
kernel/irq/msi.c:576:9: note: adding '-flarge-source-files' will allow for more column-tracking support, at the expense of compilation time and memory
>> kernel/irq/msi.c:576:9: error: expected declaration or statement at end of input
kernel/irq/msi.c:573:14: warning: unused variable 'can_reserve' [-Wunused-variable]
573 | bool can_reserve;
| ^~~~~~~~~~~
kernel/irq/msi.c:572:21: warning: unused variable 'virq' [-Wunused-variable]
572 | int i, ret, virq;
| ^~~~
kernel/irq/msi.c:572:16: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
572 | int i, ret, virq;
| ^~~
kernel/irq/msi.c:572:13: warning: unused variable 'i' [-Wunused-variable]
572 | int i, ret, virq;
| ^
kernel/irq/msi.c:570:26: warning: unused variable 'desc' [-Wunused-variable]
570 | struct msi_desc *desc;
| ^~~~
kernel/irq/msi.c:569:26: warning: unused variable 'irq_data' [-Wunused-variable]
569 | struct irq_data *irq_data;
| ^~~~~~~~
kernel/irq/msi.c:568:32: warning: unused variable 'ops' [-Wunused-variable]
568 | struct msi_domain_ops *ops = info->ops;
| ^~~
kernel/irq/msi.c:730: error: control reaches end of non-void function [-Werror=return-type]
At top level:
kernel/irq/msi.c:536:13: warning: 'msi_check_reservation_mode' defined but not used [-Wunused-function]
536 | static bool msi_check_reservation_mode(struct irq_domain *domain,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors


vim +730 kernel/irq/msi.c

da5dd9e854d2ed Thomas Gleixner 2017-12-29 563
43e9e705dd57c4 Thomas Gleixner 2020-08-26 564 int __msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
d9109698be6e74 Jiang Liu 2014-11-15 565 int nvec)
d9109698be6e74 Jiang Liu 2014-11-15 566 {
d9109698be6e74 Jiang Liu 2014-11-15 567 struct msi_domain_info *info = domain->host_data;
d9109698be6e74 Jiang Liu 2014-11-15 568 struct msi_domain_ops *ops = info->ops;
da5dd9e854d2ed Thomas Gleixner 2017-12-29 569 struct irq_data *irq_data;
d9109698be6e74 Jiang Liu 2014-11-15 570 struct msi_desc *desc;
06fde695ee7642 Zenghui Yu 2020-12-18 571 msi_alloc_info_t arg = { };
b6140914fd079e Thomas Gleixner 2016-07-04 572 int i, ret, virq;
da5dd9e854d2ed Thomas Gleixner 2017-12-29 573 bool can_reserve;
d9109698be6e74 Jiang Liu 2014-11-15 574
b2eba39bcab9d6 Marc Zyngier 2015-11-23 575 ret = msi_domain_prepare_irqs(domain, dev, nvec, &arg);
37b5937a105abc Megha Dey 2021-08-26 @576 if (ret
d9109698be6e74 Jiang Liu 2014-11-15 577 return ret;
d9109698be6e74 Jiang Liu 2014-11-15 578
37b5937a105abc Megha Dey 2021-08-26 579 for_each_msi_entry_from(desc, dev) {
d9109698be6e74 Jiang Liu 2014-11-15 580 ops->set_desc(&arg, desc);
d9109698be6e74 Jiang Liu 2014-11-15 581
b6140914fd079e Thomas Gleixner 2016-07-04 582 virq = __irq_domain_alloc_irqs(domain, -1, desc->nvec_used,
06ee6d571f0e35 Thomas Gleixner 2016-07-04 583 dev_to_node(dev), &arg, false,
0972fa57f53525 Thomas Gleixner 2016-07-04 584 desc->affinity);
d9109698be6e74 Jiang Liu 2014-11-15 585 if (virq < 0) {
d9109698be6e74 Jiang Liu 2014-11-15 586 ret = -ENOSPC;
d9109698be6e74 Jiang Liu 2014-11-15 587 if (ops->handle_error)
d9109698be6e74 Jiang Liu 2014-11-15 588 ret = ops->handle_error(domain, desc, ret);
d9109698be6e74 Jiang Liu 2014-11-15 589 if (ops->msi_finish)
d9109698be6e74 Jiang Liu 2014-11-15 590 ops->msi_finish(&arg, ret);
d9109698be6e74 Jiang Liu 2014-11-15 591 return ret;
d9109698be6e74 Jiang Liu 2014-11-15 592 }
d9109698be6e74 Jiang Liu 2014-11-15 593
07557ccb8c83f3 Thomas Gleixner 2017-09-13 594 for (i = 0; i < desc->nvec_used; i++) {
d9109698be6e74 Jiang Liu 2014-11-15 595 irq_set_msi_desc_off(virq, i, desc);
07557ccb8c83f3 Thomas Gleixner 2017-09-13 596 irq_debugfs_copy_devname(virq + i, dev);
07557ccb8c83f3 Thomas Gleixner 2017-09-13 597 }
d9109698be6e74 Jiang Liu 2014-11-15 598 }
d9109698be6e74 Jiang Liu 2014-11-15 599
d9109698be6e74 Jiang Liu 2014-11-15 600 if (ops->msi_finish)
d9109698be6e74 Jiang Liu 2014-11-15 601 ops->msi_finish(&arg, 0);
d9109698be6e74 Jiang Liu 2014-11-15 602
bc976233a872c0 Thomas Gleixner 2017-12-29 603 can_reserve = msi_check_reservation_mode(domain, info, dev);
da5dd9e854d2ed Thomas Gleixner 2017-12-29 604
f3b0946d629c8b Marc Zyngier 2016-07-13 605 /*
f3b0946d629c8b Marc Zyngier 2016-07-13 606 * This flag is set by the PCI layer as we need to activate
f3b0946d629c8b Marc Zyngier 2016-07-13 607 * the MSI entries before the PCI layer enables MSI in the
f3b0946d629c8b Marc Zyngier 2016-07-13 608 * card. Otherwise the card latches a random msi message.
f3b0946d629c8b Marc Zyngier 2016-07-13 609 */
da5dd9e854d2ed Thomas Gleixner 2017-12-29 610 if (!(info->flags & MSI_FLAG_ACTIVATE_EARLY))
4c457e8cb75eda Marc Zyngier 2021-01-23 611 goto skip_activate;
f3b0946d629c8b Marc Zyngier 2016-07-13 612
37b5937a105abc Megha Dey 2021-08-26 613 for_each_msi_vector_from(desc, i, dev) {
4c457e8cb75eda Marc Zyngier 2021-01-23 614 if (desc->irq == i) {
4c457e8cb75eda Marc Zyngier 2021-01-23 615 virq = desc->irq;
4c457e8cb75eda Marc Zyngier 2021-01-23 616 dev_dbg(dev, "irq [%d-%d] for MSI\n",
4c457e8cb75eda Marc Zyngier 2021-01-23 617 virq, virq + desc->nvec_used - 1);
4c457e8cb75eda Marc Zyngier 2021-01-23 618 }
4c457e8cb75eda Marc Zyngier 2021-01-23 619 irq_data = irq_domain_get_irq_data(domain, i);
6f1a4891a5928a Thomas Gleixner 2020-01-31 620 if (!can_reserve) {
bc976233a872c0 Thomas Gleixner 2017-12-29 621 irqd_clr_can_reserve(irq_data);
6f1a4891a5928a Thomas Gleixner 2020-01-31 622 if (domain->flags & IRQ_DOMAIN_MSI_NOMASK_QUIRK)
6f1a4891a5928a Thomas Gleixner 2020-01-31 623 irqd_set_msi_nomask_quirk(irq_data);
6f1a4891a5928a Thomas Gleixner 2020-01-31 624 }
bc976233a872c0 Thomas Gleixner 2017-12-29 625 ret = irq_domain_activate_irq(irq_data, can_reserve);
bb9b428a5c832d Thomas Gleixner 2017-09-13 626 if (ret)
bb9b428a5c832d Thomas Gleixner 2017-09-13 627 goto cleanup;
da5dd9e854d2ed Thomas Gleixner 2017-12-29 628 }
da5dd9e854d2ed Thomas Gleixner 2017-12-29 629
4c457e8cb75eda Marc Zyngier 2021-01-23 630 skip_activate:
da5dd9e854d2ed Thomas Gleixner 2017-12-29 631 /*
da5dd9e854d2ed Thomas Gleixner 2017-12-29 632 * If these interrupts use reservation mode, clear the activated bit
da5dd9e854d2ed Thomas Gleixner 2017-12-29 633 * so request_irq() will assign the final vector.
da5dd9e854d2ed Thomas Gleixner 2017-12-29 634 */
da5dd9e854d2ed Thomas Gleixner 2017-12-29 635 if (can_reserve) {
37b5937a105abc Megha Dey 2021-08-26 636 for_each_msi_vector_from(desc, i, dev) {
4c457e8cb75eda Marc Zyngier 2021-01-23 637 irq_data = irq_domain_get_irq_data(domain, i);
22d0b12f3560d3 Thomas Gleixner 2017-09-13 638 irqd_clr_activated(irq_data);
f3b0946d629c8b Marc Zyngier 2016-07-13 639 }
d9109698be6e74 Jiang Liu 2014-11-15 640 }
d9109698be6e74 Jiang Liu 2014-11-15 641 return 0;
bb9b428a5c832d Thomas Gleixner 2017-09-13 642
bb9b428a5c832d Thomas Gleixner 2017-09-13 643 cleanup:
bb9b428a5c832d Thomas Gleixner 2017-09-13 644 msi_domain_free_irqs(domain, dev);
bb9b428a5c832d Thomas Gleixner 2017-09-13 645 return ret;
d9109698be6e74 Jiang Liu 2014-11-15 646 }
d9109698be6e74 Jiang Liu 2014-11-15 647
d9109698be6e74 Jiang Liu 2014-11-15 648 /**
43e9e705dd57c4 Thomas Gleixner 2020-08-26 649 * msi_domain_alloc_irqs - Allocate interrupts from a MSI interrupt domain
43e9e705dd57c4 Thomas Gleixner 2020-08-26 650 * @domain: The domain to allocate from
d9109698be6e74 Jiang Liu 2014-11-15 651 * @dev: Pointer to device struct of the device for which the interrupts
43e9e705dd57c4 Thomas Gleixner 2020-08-26 652 * are allocated
43e9e705dd57c4 Thomas Gleixner 2020-08-26 653 * @nvec: The number of interrupts to allocate
43e9e705dd57c4 Thomas Gleixner 2020-08-26 654 *
3b35e7e6daef5a Randy Dunlap 2021-08-10 655 * Return: %0 on success or an error code.
d9109698be6e74 Jiang Liu 2014-11-15 656 */
43e9e705dd57c4 Thomas Gleixner 2020-08-26 657 int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
43e9e705dd57c4 Thomas Gleixner 2020-08-26 658 int nvec)
43e9e705dd57c4 Thomas Gleixner 2020-08-26 659 {
43e9e705dd57c4 Thomas Gleixner 2020-08-26 660 struct msi_domain_info *info = domain->host_data;
43e9e705dd57c4 Thomas Gleixner 2020-08-26 661 struct msi_domain_ops *ops = info->ops;
43e9e705dd57c4 Thomas Gleixner 2020-08-26 662
43e9e705dd57c4 Thomas Gleixner 2020-08-26 663 return ops->domain_alloc_irqs(domain, dev, nvec);
43e9e705dd57c4 Thomas Gleixner 2020-08-26 664 }
43e9e705dd57c4 Thomas Gleixner 2020-08-26 665
43e9e705dd57c4 Thomas Gleixner 2020-08-26 666 void __msi_domain_free_irqs(struct irq_domain *domain, struct device *dev)
d9109698be6e74 Jiang Liu 2014-11-15 667 {
dbbc93576e03fb Bixuan Cui 2021-05-18 668 struct irq_data *irq_data;
d9109698be6e74 Jiang Liu 2014-11-15 669 struct msi_desc *desc;
dbbc93576e03fb Bixuan Cui 2021-05-18 670 int i;
dbbc93576e03fb Bixuan Cui 2021-05-18 671
dbbc93576e03fb Bixuan Cui 2021-05-18 672 for_each_msi_vector(desc, i, dev) {
dbbc93576e03fb Bixuan Cui 2021-05-18 673 irq_data = irq_domain_get_irq_data(domain, i);
dbbc93576e03fb Bixuan Cui 2021-05-18 674 if (irqd_is_activated(irq_data))
dbbc93576e03fb Bixuan Cui 2021-05-18 675 irq_domain_deactivate_irq(irq_data);
dbbc93576e03fb Bixuan Cui 2021-05-18 676 }
d9109698be6e74 Jiang Liu 2014-11-15 677
d9109698be6e74 Jiang Liu 2014-11-15 678 for_each_msi_entry(desc, dev) {
fe0c52fc003bc0 Marc Zyngier 2015-01-26 679 /*
fe0c52fc003bc0 Marc Zyngier 2015-01-26 680 * We might have failed to allocate an MSI early
fe0c52fc003bc0 Marc Zyngier 2015-01-26 681 * enough that there is no IRQ associated to this
fe0c52fc003bc0 Marc Zyngier 2015-01-26 682 * entry. If that's the case, don't do anything.
fe0c52fc003bc0 Marc Zyngier 2015-01-26 683 */
fe0c52fc003bc0 Marc Zyngier 2015-01-26 684 if (desc->irq) {
d9109698be6e74 Jiang Liu 2014-11-15 685 irq_domain_free_irqs(desc->irq, desc->nvec_used);
d9109698be6e74 Jiang Liu 2014-11-15 686 desc->irq = 0;
d9109698be6e74 Jiang Liu 2014-11-15 687 }
d9109698be6e74 Jiang Liu 2014-11-15 688 }
fe0c52fc003bc0 Marc Zyngier 2015-01-26 689 }
d9109698be6e74 Jiang Liu 2014-11-15 690
43e9e705dd57c4 Thomas Gleixner 2020-08-26 691 /**
3b35e7e6daef5a Randy Dunlap 2021-08-10 692 * msi_domain_free_irqs - Free interrupts from a MSI interrupt @domain associated to @dev
43e9e705dd57c4 Thomas Gleixner 2020-08-26 693 * @domain: The domain to managing the interrupts
43e9e705dd57c4 Thomas Gleixner 2020-08-26 694 * @dev: Pointer to device struct of the device for which the interrupts
43e9e705dd57c4 Thomas Gleixner 2020-08-26 695 * are free
43e9e705dd57c4 Thomas Gleixner 2020-08-26 696 */
43e9e705dd57c4 Thomas Gleixner 2020-08-26 697 void msi_domain_free_irqs(struct irq_domain *domain, struct device *dev)
43e9e705dd57c4 Thomas Gleixner 2020-08-26 698 {
43e9e705dd57c4 Thomas Gleixner 2020-08-26 699 struct msi_domain_info *info = domain->host_data;
43e9e705dd57c4 Thomas Gleixner 2020-08-26 700 struct msi_domain_ops *ops = info->ops;
43e9e705dd57c4 Thomas Gleixner 2020-08-26 701
43e9e705dd57c4 Thomas Gleixner 2020-08-26 702 return ops->domain_free_irqs(domain, dev);
43e9e705dd57c4 Thomas Gleixner 2020-08-26 703 }
43e9e705dd57c4 Thomas Gleixner 2020-08-26 704
37b5937a105abc Megha Dey 2021-08-26 705 void msi_domain_free_irq(struct irq_domain *domain, struct device *dev, unsigned int irq)
37b5937a105abc Megha Dey 2021-08-26 706 {
37b5937a105abc Megha Dey 2021-08-26 707 struct msi_desc *desc = irq_get_msi_desc(irq);
37b5937a105abc Megha Dey 2021-08-26 708 struct irq_data *irq_data;
37b5937a105abc Megha Dey 2021-08-26 709
37b5937a105abc Megha Dey 2021-08-26 710 irq_data = irq_domain_get_irq_data(domain, irq);
37b5937a105abc Megha Dey 2021-08-26 711 if (irqd_is_activated(irq_data))
37b5937a105abc Megha Dey 2021-08-26 712 irq_domain_deactivate_irq(irq_data);
37b5937a105abc Megha Dey 2021-08-26 713
37b5937a105abc Megha Dey 2021-08-26 714 irq_domain_free_irqs(desc->irq, 1);
37b5937a105abc Megha Dey 2021-08-26 715 desc->irq = 0;
37b5937a105abc Megha Dey 2021-08-26 716 }
37b5937a105abc Megha Dey 2021-08-26 717
f3cf8bb0d6c3c1 Jiang Liu 2014-11-12 718 /**
f3cf8bb0d6c3c1 Jiang Liu 2014-11-12 719 * msi_get_domain_info - Get the MSI interrupt domain info for @domain
f3cf8bb0d6c3c1 Jiang Liu 2014-11-12 720 * @domain: The interrupt domain to retrieve data from
f3cf8bb0d6c3c1 Jiang Liu 2014-11-12 721 *
3b35e7e6daef5a Randy Dunlap 2021-08-10 722 * Return: the pointer to the msi_domain_info stored in @domain->host_data.
f3cf8bb0d6c3c1 Jiang Liu 2014-11-12 723 */
f3cf8bb0d6c3c1 Jiang Liu 2014-11-12 724 struct msi_domain_info *msi_get_domain_info(struct irq_domain *domain)
f3cf8bb0d6c3c1 Jiang Liu 2014-11-12 725 {
f3cf8bb0d6c3c1 Jiang Liu 2014-11-12 726 return (struct msi_domain_info *)domain->host_data;
f3cf8bb0d6c3c1 Jiang Liu 2014-11-12 727 }
f3cf8bb0d6c3c1 Jiang Liu 2014-11-12 728
f3cf8bb0d6c3c1 Jiang Liu 2014-11-12 729 #endif /* CONFIG_GENERIC_MSI_IRQ_DOMAIN */

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip