linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@gmail.com>
To: Randy Dunlap <rdunlap@infradead.org>, linux-kernel@vger.kernel.org
Cc: Dengcheng Zhu <dzhu@wavecomp.com>,
	Paul Burton <paulburton@kernel.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	linux-mips@vger.kernel.org
Subject: Re: [RFC PATCH] MIPS: SMP-CPS: fix build error when HOTPLUG_CPU not set
Date: Fri, 17 Feb 2023 11:43:03 +0300	[thread overview]
Message-ID: <5e36b62c-9326-dc8b-3d7e-dfa79b75472b@gmail.com> (raw)
In-Reply-To: <20230217063858.28311-1-rdunlap@infradead.org>

On 2/17/23 9:38 AM, Randy Dunlap wrote:

> When MIPS_CPS=y, MIPS_CPS_PM is not set, HOTPLUG_CPU is not set, and
> KEXEC=y, cps_shutdown_this_cpu() attempts to call cps_pm_enter_state(),
> which is not built when MIPS_CPS_PM is not set.
> Conditionally execute the else branch based on CONFIG_HOTPLUG_CPU
> to remove the build error.
> This build failure is from a randconfig file.
> 
> mips-linux-ld: arch/mips/kernel/smp-cps.o: in function `$L162':
> smp-cps.c:(.text.cps_kexec_nonboot_cpu+0x31c): undefined reference to `cps_pm_enter_state'
> 
> Fixes: 1447864bee4c ("MIPS: kexec: CPS systems to halt nonboot CPUs")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Dengcheng Zhu <dzhu@wavecomp.com>
> Cc: Paul Burton <paulburton@kernel.org>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: linux-mips@vger.kernel.org
> ---
>  arch/mips/kernel/smp-cps.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff -- a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
> --- a/arch/mips/kernel/smp-cps.c
> +++ b/arch/mips/kernel/smp-cps.c
> @@ -424,9 +424,11 @@ static void cps_shutdown_this_cpu(enum c
>  			wmb();
>  		}
>  	} else {
> +#ifdef CONFIG_HOTPLUG_CPU

   Perhaps, instead of #ifdef'ery, ude the following:

	} else if (IS_ENABLED(CONFIG_HOTPLUG_CPU)) {

>  		pr_debug("Gating power to core %d\n", core);
>  		/* Power down the core */
>  		cps_pm_enter_state(CPS_PM_POWER_GATED);
> +#endif /* CONFIG_HOTPLUG_CPU */
>  	}
>  }
>  

MBR, Sergey

      reply	other threads:[~2023-02-17  8:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17  6:38 [RFC PATCH] MIPS: SMP-CPS: fix build error when HOTPLUG_CPU not set Randy Dunlap
2023-02-17  8:43 ` Sergei Shtylyov [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=5e36b62c-9326-dc8b-3d7e-dfa79b75472b@gmail.com \
    --to=sergei.shtylyov@gmail.com \
    --cc=dzhu@wavecomp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=paulburton@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=tsbogend@alpha.franken.de \
    /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).