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

Commit f1072939 authored by Milton Miller's avatar Milton Miller Committed by Benjamin Herrenschmidt
Browse files

powerpc: Remove checks for MSG_ALL and MSG_ALL_BUT_SELF



Now that smp_ops->smp_message_pass is always called with an (online) cpu
number for the target remove the checks for MSG_ALL and MSG_ALL_BUT_SELF.

Signed-off-by: default avatarMilton Miller <miltonm@bga.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent e0476371
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ enum ppc_dbell {
	PPC_G_DBELL_MC = 4,	/* guest mcheck doorbell */
};

extern void doorbell_message_pass(int target, int msg);
extern void doorbell_message_pass(int cpu, int msg);
extern void doorbell_exception(struct pt_regs *regs);
extern void doorbell_check_self(void);
extern void doorbell_setup_this_cpu(void);
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ struct kimage;

#ifdef CONFIG_SMP
struct smp_ops_t {
	void  (*message_pass)(int target, int msg);
	void  (*message_pass)(int cpu, int msg);
	int   (*probe)(void);
	int   (*kick_cpu)(int nr);
	void  (*setup_cpu)(int nr);
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ struct icp_ops {
	void (*teardown_cpu)(void);
	void (*flush_ipi)(void);
#ifdef CONFIG_SMP
	void (*message_pass)(int target, int msg);
	void (*message_pass)(int cpu, int msg);
	irq_handler_t ipi_action;
#endif
};
+5 −24
Original line number Diff line number Diff line
@@ -34,33 +34,14 @@ void doorbell_setup_this_cpu(void)
	info->tag = mfspr(SPRN_PIR) & 0x3fff;
}

void doorbell_message_pass(int target, int msg)
void doorbell_message_pass(int cpu, int msg)
{
	struct doorbell_cpu_info *info;
	int i;

	if (target < NR_CPUS) {
		info = &per_cpu(doorbell_cpu_info, target);
	info = &per_cpu(doorbell_cpu_info, cpu);
	set_bit(msg, &info->messages);
	ppc_msgsnd(PPC_DBELL, 0, info->tag);
}
	else if (target == MSG_ALL_BUT_SELF) {
		for_each_online_cpu(i) {
			if (i == smp_processor_id())
				continue;
			info = &per_cpu(doorbell_cpu_info, i);
			set_bit(msg, &info->messages);
			ppc_msgsnd(PPC_DBELL, 0, info->tag);
		}
	}
	else { /* target == MSG_ALL */
		for_each_online_cpu(i) {
			info = &per_cpu(doorbell_cpu_info, i);
			set_bit(msg, &info->messages);
		}
		ppc_msgsnd(PPC_DBELL, PPC_DBELL_MSG_BRDCAST, 0);
	}
}

void doorbell_exception(struct pt_regs *regs)
{
+1 −17
Original line number Diff line number Diff line
@@ -67,22 +67,6 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu)
	return 0;
}

static void smp_beatic_message_pass(int target, int msg)
{
	unsigned int i;

	if (target < NR_CPUS) {
		beatic_cause_IPI(target, msg);
	} else {
		for_each_online_cpu(i) {
			if (target == MSG_ALL_BUT_SELF
			    && i == smp_processor_id())
				continue;
			beatic_cause_IPI(i, msg);
		}
	}
}

static int __init smp_beatic_probe(void)
{
	return cpumask_weight(cpu_possible_mask);
@@ -105,7 +89,7 @@ static int smp_celleb_cpu_bootable(unsigned int nr)
	return 1;
}
static struct smp_ops_t bpa_beatic_smp_ops = {
	.message_pass	= smp_beatic_message_pass,
	.message_pass	= beatic_cause_IPI,
	.probe		= smp_beatic_probe,
	.kick_cpu	= smp_celleb_kick_cpu,
	.setup_cpu	= smp_beatic_setup_cpu,
Loading