All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gavin Shan <gshan@redhat.com>
To: kernel test robot <lkp@intel.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: oe-kbuild-all@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	Catalin Marinas <catalin.marinas@arm.com>
Subject: Re: [arm64:for-next/vcpu-hotplug 17/19] arch/arm64/kernel/smp.c:563:2: error: call to undeclared function 'unregister_cpu'; ISO C99 and later do not support implicit function declarations
Date: Sun, 30 Jun 2024 10:41:46 +1000	[thread overview]
Message-ID: <b028f291-e4e2-4060-ba41-810b9d718d99@redhat.com> (raw)
In-Reply-To: <202406300437.XnuW0n34-lkp@intel.com>

On 6/30/24 7:14 AM, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/vcpu-hotplug
> head:   4e1a7df4548003fc081360b0f4edce3f7a991bfc
> commit: 9d0873892f4d4bf62a351897e91e5169b4c6f4aa [17/19] arm64: Kconfig: Enable hotplug CPU on arm64 if ACPI_PROCESSOR is enabled.
> config: arm64-randconfig-r063-20240629
> compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 326ba38a991250a8587a399a260b0f7af2c9166a)
> reproduce (this is a W=1 build):
> 
> 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/202406300437.XnuW0n34-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>     In file included from arch/arm64/kernel/smp.c:9:
>     In file included from include/linux/acpi.h:39:
>     In file included from include/acpi/acpi_io.h:7:
>     In file included from arch/arm64/include/asm/acpi.h:14:
>     In file included from include/linux/memblock.h:12:
>     In file included from include/linux/mm.h:2253:
>     include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
>       514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
>           |                               ~~~~~~~~~~~ ^ ~~~
>>> arch/arm64/kernel/smp.c:563:2: error: call to undeclared function 'unregister_cpu'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>       563 |         unregister_cpu(c);
>           |         ^
>     arch/arm64/kernel/smp.c:563:2: note: did you mean 'register_cpu'?
>     include/linux/cpu.h:38:12: note: 'register_cpu' declared here
>        38 | extern int register_cpu(struct cpu *cpu, int num);
>           |            ^
>     1 warning and 1 error generated.
> 
> Kconfig warnings: (for reference only)
>     WARNING: unmet direct dependencies detected for ACPI_HOTPLUG_CPU
>     Depends on [n]: ACPI [=y] && ACPI_PROCESSOR [=y] && HOTPLUG_CPU [=n]
>     Selected by [y]:
>     - ARM64 [=y] && ACPI_PROCESSOR [=y]
> 
> 
> vim +/unregister_cpu +563 arch/arm64/kernel/smp.c
> 
> eba4675008a6e4 Jonathan Cameron 2024-05-29  539
> eba4675008a6e4 Jonathan Cameron 2024-05-29  540  #ifdef CONFIG_ACPI_HOTPLUG_CPU
> eba4675008a6e4 Jonathan Cameron 2024-05-29  541  void arch_unregister_cpu(int cpu)
> eba4675008a6e4 Jonathan Cameron 2024-05-29  542  {
> eba4675008a6e4 Jonathan Cameron 2024-05-29  543  	acpi_handle acpi_handle = acpi_get_processor_handle(cpu);
> eba4675008a6e4 Jonathan Cameron 2024-05-29  544  	struct cpu *c = &per_cpu(cpu_devices, cpu);
> eba4675008a6e4 Jonathan Cameron 2024-05-29  545  	acpi_status status;
> eba4675008a6e4 Jonathan Cameron 2024-05-29  546  	unsigned long long sta;
> eba4675008a6e4 Jonathan Cameron 2024-05-29  547
> eba4675008a6e4 Jonathan Cameron 2024-05-29  548  	if (!acpi_handle) {
> eba4675008a6e4 Jonathan Cameron 2024-05-29  549  		pr_err_once("Removing a CPU without associated ACPI handle\n");
> eba4675008a6e4 Jonathan Cameron 2024-05-29  550  		return;
> eba4675008a6e4 Jonathan Cameron 2024-05-29  551  	}
> eba4675008a6e4 Jonathan Cameron 2024-05-29  552
> eba4675008a6e4 Jonathan Cameron 2024-05-29  553  	status = acpi_evaluate_integer(acpi_handle, "_STA", NULL, &sta);
> eba4675008a6e4 Jonathan Cameron 2024-05-29  554  	if (ACPI_FAILURE(status))
> eba4675008a6e4 Jonathan Cameron 2024-05-29  555  		return;
> eba4675008a6e4 Jonathan Cameron 2024-05-29  556
> eba4675008a6e4 Jonathan Cameron 2024-05-29  557  	/* For now do not allow anything that looks like physical CPU HP */
> eba4675008a6e4 Jonathan Cameron 2024-05-29  558  	if (cpu_present(cpu) && !(sta & ACPI_STA_DEVICE_PRESENT)) {
> eba4675008a6e4 Jonathan Cameron 2024-05-29  559  		pr_err_once("Changing CPU present bit is not supported\n");
> eba4675008a6e4 Jonathan Cameron 2024-05-29  560  		return;
> eba4675008a6e4 Jonathan Cameron 2024-05-29  561  	}
> eba4675008a6e4 Jonathan Cameron 2024-05-29  562
> eba4675008a6e4 Jonathan Cameron 2024-05-29 @563  	unregister_cpu(c);
> eba4675008a6e4 Jonathan Cameron 2024-05-29  564  }
> eba4675008a6e4 Jonathan Cameron 2024-05-29  565  #endif /* CONFIG_ACPI_HOTPLUG_CPU */
> eba4675008a6e4 Jonathan Cameron 2024-05-29  566
> 

It's caused by the following patch in the series.

[PATCH v10 17/19] arm64: Kconfig: Enable hotplug CPU on arm64 if ACPI_PROCESSOR is enabled

I've replied to that specific patch where improvement is needed
in arch/arm64/Kconfig

     select ACPI_HOTPLUG_CPU if ACPI_PROCESSOR && HOTPLUG_CPU

Thanks,
Gavin

> :::::: The code at line 563 was first introduced by commit
> :::::: eba4675008a6e4cbff27b579a837bd29be2642de arm64: arch_register_cpu() variant to check if an ACPI handle is now available.
> 
> :::::: TO: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> :::::: CC: Catalin Marinas <catalin.marinas@arm.com>
> 


      reply	other threads:[~2024-06-30  0:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-29 21:14 [arm64:for-next/vcpu-hotplug 17/19] arch/arm64/kernel/smp.c:563:2: error: call to undeclared function 'unregister_cpu'; ISO C99 and later do not support implicit function declarations kernel test robot
2024-06-30  0:41 ` Gavin Shan [this message]

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=b028f291-e4e2-4060-ba41-810b9d718d99@redhat.com \
    --to=gshan@redhat.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.