diff mbox

powerpc/powernv: Ignore smt-enabled on Power8 and later

Message ID 1424762360-31359-1-git-send-email-mpe@ellerman.id.au
State New
Headers show

Commit Message

Michael Ellerman Feb. 24, 2015, 7:19 a.m. UTC
From: Greg Kurz <gkurz@linux.vnet.ibm.com>

Commit d70a54e2d08510a99b1f10eceeae6f2f7086e226 upstream.

Starting with POWER8, the subcore logic relies on all threads of a core
being booted so that they can participate in split mode switches. So on
those machines we ignore the smt_enabled_at_boot setting (smt-enabled on
the kernel command line).

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
[mpe: Update comment and change log to be more precise]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/platforms/powernv/smp.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)


Hi Ubuntu kernel folks,

This patch isn't quite upstream stable material, but might still be nice to
have. It prevents smt-enabled=off on the kernel command line causing a hung
system at boot.

cheers

Comments

Andy Whitcroft Feb. 24, 2015, 10:31 a.m. UTC | #1
On Tue, Feb 24, 2015 at 06:19:20PM +1100, Michael Ellerman wrote:

> Hi Ubuntu kernel folks,
> 
> This patch isn't quite upstream stable material, but might still be nice to
> have. It prevents smt-enabled=off on the kernel command line causing a hung
> system at boot.
> 
> cheers

Michael, could you confirm this is needed for utopic and vivid ?  I have
filed a bug for this which will be needed for any SRU, LP#1425004.

-apw

[0] https://bugs.launchpad.net/bugs/1425004
Andy Whitcroft Feb. 24, 2015, 10:33 a.m. UTC | #2
On Tue, Feb 24, 2015 at 06:19:20PM +1100, Michael Ellerman wrote:
> From: Greg Kurz <gkurz@linux.vnet.ibm.com>
> 
> Commit d70a54e2d08510a99b1f10eceeae6f2f7086e226 upstream.
> 
> Starting with POWER8, the subcore logic relies on all threads of a core
> being booted so that they can participate in split mode switches. So on
> those machines we ignore the smt_enabled_at_boot setting (smt-enabled on
> the kernel command line).
> 
> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> [mpe: Update comment and change log to be more precise]
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
>  arch/powerpc/platforms/powernv/smp.c | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
> 
> 
> Hi Ubuntu kernel folks,
> 
> This patch isn't quite upstream stable material, but might still be nice to
> have. It prevents smt-enabled=off on the kernel command line causing a hung
> system at boot.
> 
> cheers
> 
> diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
> index 6c551a28e899..fc34025ef822 100644
> --- a/arch/powerpc/platforms/powernv/smp.c
> +++ b/arch/powerpc/platforms/powernv/smp.c
> @@ -209,13 +209,27 @@ static void pnv_smp_cpu_kill_self(void)
>  
>  #endif /* CONFIG_HOTPLUG_CPU */
>  
> +static int pnv_cpu_bootable(unsigned int nr)
> +{
> +	/*
> +	 * Starting with POWER8, the subcore logic relies on all threads of a
> +	 * core being booted so that they can participate in split mode
> +	 * switches. So on those machines we ignore the smt_enabled_at_boot
> +	 * setting (smt-enabled on the kernel command line).
> +	 */
> +	if (cpu_has_feature(CPU_FTR_ARCH_207S))
> +		return 1;
> +
> +	return smp_generic_cpu_bootable(nr);
> +}
> +
>  static struct smp_ops_t pnv_smp_ops = {
>  	.message_pass	= smp_muxed_ipi_message_pass,
>  	.cause_ipi	= NULL,	/* Filled at runtime by xics_smp_probe() */
>  	.probe		= xics_smp_probe,
>  	.kick_cpu	= pnv_smp_kick_cpu,
>  	.setup_cpu	= pnv_smp_setup_cpu,
> -	.cpu_bootable	= smp_generic_cpu_bootable,
> +	.cpu_bootable	= pnv_cpu_bootable,
>  #ifdef CONFIG_HOTPLUG_CPU
>  	.cpu_disable	= pnv_smp_cpu_disable,
>  	.cpu_die	= generic_cpu_die,
> -- 

Looks simple and to do what is claimed.

Acked-by: Andy Whitcroft <apw@canonical.com>

-apw
Michael Ellerman Feb. 25, 2015, 1:44 a.m. UTC | #3
On Tue, 2015-02-24 at 10:31 +0000, Andy Whitcroft wrote:
> On Tue, Feb 24, 2015 at 06:19:20PM +1100, Michael Ellerman wrote:
> 
> > Hi Ubuntu kernel folks,
> > 
> > This patch isn't quite upstream stable material, but might still be nice to
> > have. It prevents smt-enabled=off on the kernel command line causing a hung
> > system at boot.
> > 
> > cheers
> 
> Michael, could you confirm this is needed for utopic and vivid ?  I have
> filed a bug for this which will be needed for any SRU, LP#1425004.

Yeah, anything that runs on Power8, so I think that is Utopic & Vivid only.

cheers
Brad Figg Feb. 25, 2015, 8:36 p.m. UTC | #4
On Tue, Feb 24, 2015 at 10:31:42AM +0000, Andy Whitcroft wrote:
> On Tue, Feb 24, 2015 at 06:19:20PM +1100, Michael Ellerman wrote:
> 
> > Hi Ubuntu kernel folks,
> > 
> > This patch isn't quite upstream stable material, but might still be nice to
> > have. It prevents smt-enabled=off on the kernel command line causing a hung
> > system at boot.
> > 
> > cheers
> 
> Michael, could you confirm this is needed for utopic and vivid ?  I have
> filed a bug for this which will be needed for any SRU, LP#1425004.
> 
> -apw
> 
> [0] https://bugs.launchpad.net/bugs/1425004
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Utopic has carried this commit since 3.16.0-30.40

Brad
Michael Ellerman Feb. 26, 2015, 2:51 a.m. UTC | #5
On Wed, 2015-02-25 at 12:36 -0800, Brad Figg wrote:
> On Tue, Feb 24, 2015 at 10:31:42AM +0000, Andy Whitcroft wrote:
> > On Tue, Feb 24, 2015 at 06:19:20PM +1100, Michael Ellerman wrote:
> > 
> > > Hi Ubuntu kernel folks,
> > > 
> > > This patch isn't quite upstream stable material, but might still be nice to
> > > have. It prevents smt-enabled=off on the kernel command line causing a hung
> > > system at boot.
> > 
> > Michael, could you confirm this is needed for utopic and vivid ?  I have
> > filed a bug for this which will be needed for any SRU, LP#1425004.
> 
> Utopic has carried this commit since 3.16.0-30.40

Ah sorry, I didn't think to check.

cheers
Leann Ogasawara Feb. 26, 2015, 2:43 p.m. UTC | #6
On Tue, Feb 24, 2015 at 5:44 PM, Michael Ellerman <mpe@ellerman.id.au>
wrote:
>
> On Tue, 2015-02-24 at 10:31 +0000, Andy Whitcroft wrote:
> > On Tue, Feb 24, 2015 at 06:19:20PM +1100, Michael Ellerman wrote:
> >
> > > Hi Ubuntu kernel folks,
> > >
> > > This patch isn't quite upstream stable material, but might still be
nice to
> > > have. It prevents smt-enabled=off on the kernel command line causing
a hung
> > > system at boot.
> > >
> > > cheers
> >
> > Michael, could you confirm this is needed for utopic and vivid ?  I have
> > filed a bug for this which will be needed for any SRU, LP#1425004.
>
> Yeah, anything that runs on Power8, so I think that is Utopic & Vivid
only.

For completeness, this patch is in our v3.19 based unstable branch for
Vivid.  This should be getting copied to the master branch and uploaded
relatively soon (ie by EOW).

Thanks,
Leann
diff mbox

Patch

diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
index 6c551a28e899..fc34025ef822 100644
--- a/arch/powerpc/platforms/powernv/smp.c
+++ b/arch/powerpc/platforms/powernv/smp.c
@@ -209,13 +209,27 @@  static void pnv_smp_cpu_kill_self(void)
 
 #endif /* CONFIG_HOTPLUG_CPU */
 
+static int pnv_cpu_bootable(unsigned int nr)
+{
+	/*
+	 * Starting with POWER8, the subcore logic relies on all threads of a
+	 * core being booted so that they can participate in split mode
+	 * switches. So on those machines we ignore the smt_enabled_at_boot
+	 * setting (smt-enabled on the kernel command line).
+	 */
+	if (cpu_has_feature(CPU_FTR_ARCH_207S))
+		return 1;
+
+	return smp_generic_cpu_bootable(nr);
+}
+
 static struct smp_ops_t pnv_smp_ops = {
 	.message_pass	= smp_muxed_ipi_message_pass,
 	.cause_ipi	= NULL,	/* Filled at runtime by xics_smp_probe() */
 	.probe		= xics_smp_probe,
 	.kick_cpu	= pnv_smp_kick_cpu,
 	.setup_cpu	= pnv_smp_setup_cpu,
-	.cpu_bootable	= smp_generic_cpu_bootable,
+	.cpu_bootable	= pnv_cpu_bootable,
 #ifdef CONFIG_HOTPLUG_CPU
 	.cpu_disable	= pnv_smp_cpu_disable,
 	.cpu_die	= generic_cpu_die,