Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8d0d5dc authored by Santosh Sivaraj's avatar Santosh Sivaraj Committed by Michael Ellerman
Browse files

powerpc/smp: Do not BUG_ON if invalid CPU during kick



During secondary start, we do not need to BUG_ON if an invalid CPU number
is passed. We already print an error if secondary cannot be started, so
just return an error instead.

Signed-off-by: default avatarSantosh Sivaraj <santosh@fossix.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent adeb8667
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -112,7 +112,8 @@ int smp_generic_cpu_bootable(unsigned int nr)
#ifdef CONFIG_PPC64
#ifdef CONFIG_PPC64
int smp_generic_kick_cpu(int nr)
int smp_generic_kick_cpu(int nr)
{
{
	BUG_ON(nr < 0 || nr >= NR_CPUS);
	if (nr < 0 || nr >= NR_CPUS)
		return -EINVAL;


	/*
	/*
	 * The processor is currently spinning, waiting for the
	 * The processor is currently spinning, waiting for the
+2 −1
Original line number Original line Diff line number Diff line
@@ -115,7 +115,8 @@ static void smp_cell_setup_cpu(int cpu)


static int smp_cell_kick_cpu(int nr)
static int smp_cell_kick_cpu(int nr)
{
{
	BUG_ON(nr < 0 || nr >= NR_CPUS);
	if (nr < 0 || nr >= NR_CPUS)
		return -EINVAL;


	if (!smp_startup_cpu(nr))
	if (!smp_startup_cpu(nr))
		return -ENOENT;
		return -ENOENT;
+2 −1
Original line number Original line Diff line number Diff line
@@ -63,7 +63,8 @@ static int pnv_smp_kick_cpu(int nr)
	long rc;
	long rc;
	uint8_t status;
	uint8_t status;


	BUG_ON(nr < 0 || nr >= NR_CPUS);
	if (nr < 0 || nr >= NR_CPUS)
		return -EINVAL;


	/*
	/*
	 * If we already started or OPAL is not supported, we just
	 * If we already started or OPAL is not supported, we just
+2 −1
Original line number Original line Diff line number Diff line
@@ -151,7 +151,8 @@ static void smp_setup_cpu(int cpu)


static int smp_pSeries_kick_cpu(int nr)
static int smp_pSeries_kick_cpu(int nr)
{
{
	BUG_ON(nr < 0 || nr >= NR_CPUS);
	if (nr < 0 || nr >= NR_CPUS)
		return -EINVAL;


	if (!smp_startup_cpu(nr))
	if (!smp_startup_cpu(nr))
		return -ENOENT;
		return -ENOENT;