diff mbox series

[v6,02/16] cpu: Do not warn on arch_register_cpu() returning -EPROBE_DEFER

Message ID 20240417131909.7925-3-Jonathan.Cameron@huawei.com
State Superseded
Headers show
Series ACPI/arm64: add support for virtual cpu hotplug | expand

Commit Message

Jonathan Cameron April 17, 2024, 1:18 p.m. UTC
For arm64 the CPU registration cannot complete until the ACPI
interpreter us up and running so in those cases the arch specific
arch_register_cpu() will return -EPROBE_DEFER at this stage and the
registration will be attempted later.

Suggested-by: Rafael J. Wysocki <rafael@kernel.org>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

---
v6: tags
---
 drivers/base/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Russell King (Oracle) April 17, 2024, 2:01 p.m. UTC | #1
On Wed, Apr 17, 2024 at 02:18:55PM +0100, Jonathan Cameron wrote:
> For arm64 the CPU registration cannot complete until the ACPI
> interpreter us up and running so in those cases the arch specific
> arch_register_cpu() will return -EPROBE_DEFER at this stage and the
> registration will be attempted later.
> 
> Suggested-by: Rafael J. Wysocki <rafael@kernel.org>
> Acked-by: Rafael J. Wysocki <rafael@kernel.org>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> ---
> v6: tags
> ---
>  drivers/base/cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
> index 56fba44ba391..b9d0d14e5960 100644
> --- a/drivers/base/cpu.c
> +++ b/drivers/base/cpu.c
> @@ -558,7 +558,7 @@ static void __init cpu_dev_register_generic(void)
>  
>  	for_each_present_cpu(i) {
>  		ret = arch_register_cpu(i);
> -		if (ret)
> +		if (ret != -EPROBE_DEFER)
>  			pr_warn("register_cpu %d failed (%d)\n", i, ret);

This looks very broken to me.

		if (ret && ret != -EPROBE_DEFER)

surely, because we don't want to print a warning if arch_register_cpu()
was successful?
Jonathan Cameron April 17, 2024, 2:41 p.m. UTC | #2
On Wed, 17 Apr 2024 15:01:33 +0100
"Russell King (Oracle)" <linux@armlinux.org.uk> wrote:

> On Wed, Apr 17, 2024 at 02:18:55PM +0100, Jonathan Cameron wrote:
> > For arm64 the CPU registration cannot complete until the ACPI
> > interpreter us up and running so in those cases the arch specific
> > arch_register_cpu() will return -EPROBE_DEFER at this stage and the
> > registration will be attempted later.
> > 
> > Suggested-by: Rafael J. Wysocki <rafael@kernel.org>
> > Acked-by: Rafael J. Wysocki <rafael@kernel.org>
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > 
> > ---
> > v6: tags
> > ---
> >  drivers/base/cpu.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
> > index 56fba44ba391..b9d0d14e5960 100644
> > --- a/drivers/base/cpu.c
> > +++ b/drivers/base/cpu.c
> > @@ -558,7 +558,7 @@ static void __init cpu_dev_register_generic(void)
> >  
> >  	for_each_present_cpu(i) {
> >  		ret = arch_register_cpu(i);
> > -		if (ret)
> > +		if (ret != -EPROBE_DEFER)
> >  			pr_warn("register_cpu %d failed (%d)\n", i, ret);  
> 
> This looks very broken to me.
> 
> 		if (ret && ret != -EPROBE_DEFER)
> 
> surely, because we don't want to print a warning if arch_register_cpu()
> was successful?

Gah.  Excellent point.

thanks,

Jonathan

>
diff mbox series

Patch

diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 56fba44ba391..b9d0d14e5960 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -558,7 +558,7 @@  static void __init cpu_dev_register_generic(void)
 
 	for_each_present_cpu(i) {
 		ret = arch_register_cpu(i);
-		if (ret)
+		if (ret != -EPROBE_DEFER)
 			pr_warn("register_cpu %d failed (%d)\n", i, ret);
 	}
 }