mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
	alan@lxorguk.ukuu.org.uk, Geoff Levand <geoff@infradead.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: [22/26] powerpc/ps3: Fix lost SMP IPIs
Date: Fri, 18 Nov 2011 16:02:58 -0800	[thread overview]
Message-ID: <20111119000329.862001060@clark.kroah.org> (raw)
In-Reply-To: <20111119000336.GA8452@kroah.com>

3.1-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Geoff Levand <geoff@infradead.org>

commit 72f3bea075287785ed32b777b6dd2636aa7002e8 upstream.

Fixes the PS3 bootup hang introduced in 3.0-rc1 by:

  commit 317f394160e9beb97d19a84c39b7e5eb3d7815a
  sched: Move the second half of ttwu() to the remote cpu

Move the PS3's LV1 EOI call lv1_end_of_interrupt_ext() from ps3_chip_eoi()
to ps3_get_irq() for IPI messages.

If lv1_send_event_locally() is called between a previous call to
lv1_send_event_locally() and the coresponding call to
lv1_end_of_interrupt_ext() the second event will not be delivered to the
target cpu.

The PS3's SMP IPIs are implemented using lv1_send_event_locally(), so if two
IPI messages of the same type are sent to the same target in a relatively
short period of time the second IPI event can become lost when
lv1_end_of_interrupt_ext() is called from ps3_chip_eoi().

Signed-off-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/platforms/ps3/interrupt.c |   23 ++++++++++++++++++++++-
 arch/powerpc/platforms/ps3/platform.h  |    1 +
 arch/powerpc/platforms/ps3/smp.c       |    2 ++
 3 files changed, 25 insertions(+), 1 deletion(-)

--- a/arch/powerpc/platforms/ps3/interrupt.c
+++ b/arch/powerpc/platforms/ps3/interrupt.c
@@ -88,6 +88,7 @@ struct ps3_private {
 	struct ps3_bmp bmp __attribute__ ((aligned (PS3_BMP_MINALIGN)));
 	u64 ppe_id;
 	u64 thread_id;
+	unsigned long ipi_mask;
 };
 
 static DEFINE_PER_CPU(struct ps3_private, ps3_private);
@@ -144,7 +145,11 @@ static void ps3_chip_unmask(struct irq_d
 static void ps3_chip_eoi(struct irq_data *d)
 {
 	const struct ps3_private *pd = irq_data_get_irq_chip_data(d);
-	lv1_end_of_interrupt_ext(pd->ppe_id, pd->thread_id, d->irq);
+
+	/* non-IPIs are EOIed here. */
+
+	if (!test_bit(63 - d->irq, &pd->ipi_mask))
+		lv1_end_of_interrupt_ext(pd->ppe_id, pd->thread_id, d->irq);
 }
 
 /**
@@ -691,6 +696,16 @@ void __init ps3_register_ipi_debug_brk(u
 		cpu, virq, pd->bmp.ipi_debug_brk_mask);
 }
 
+void __init ps3_register_ipi_irq(unsigned int cpu, unsigned int virq)
+{
+	struct ps3_private *pd = &per_cpu(ps3_private, cpu);
+
+	set_bit(63 - virq, &pd->ipi_mask);
+
+	DBG("%s:%d: cpu %u, virq %u, ipi_mask %lxh\n", __func__, __LINE__,
+		cpu, virq, pd->ipi_mask);
+}
+
 static unsigned int ps3_get_irq(void)
 {
 	struct ps3_private *pd = &__get_cpu_var(ps3_private);
@@ -720,6 +735,12 @@ static unsigned int ps3_get_irq(void)
 		BUG();
 	}
 #endif
+
+	/* IPIs are EOIed here. */
+
+	if (test_bit(63 - plug, &pd->ipi_mask))
+		lv1_end_of_interrupt_ext(pd->ppe_id, pd->thread_id, plug);
+
 	return plug;
 }
 
--- a/arch/powerpc/platforms/ps3/platform.h
+++ b/arch/powerpc/platforms/ps3/platform.h
@@ -43,6 +43,7 @@ void ps3_mm_shutdown(void);
 void ps3_init_IRQ(void);
 void ps3_shutdown_IRQ(int cpu);
 void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq);
+void __init ps3_register_ipi_irq(unsigned int cpu, unsigned int virq);
 
 /* smp */
 
--- a/arch/powerpc/platforms/ps3/smp.c
+++ b/arch/powerpc/platforms/ps3/smp.c
@@ -94,6 +94,8 @@ static void __init ps3_smp_setup_cpu(int
 
 		if (result)
 			virqs[i] = NO_IRQ;
+		else
+			ps3_register_ipi_irq(cpu, virqs[i]);
 	}
 
 	ps3_register_ipi_debug_brk(cpu, virqs[PPC_MSG_DEBUGGER_BREAK]);



  parent reply	other threads:[~2011-11-19  0:10 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-19  0:03 [00/26] 3.1.2-stable review Greg KH
2011-11-19  0:02 ` [01/26] ALSA: hda - fix internal mic on Dell Vostro 3500 laptop Greg KH
2011-11-19  0:02 ` [02/26] ALSA: hda - Dont add elements of other codecs to vmaster slave Greg KH
2011-11-19  0:02 ` [03/26] virtio-pci: fix use after free Greg KH
2011-11-19  0:02 ` [04/26] ARM: at91: Fix USBA gadget registration Greg KH
2011-11-19  0:02 ` [05/26] ASoC: Dont use wm8994->control_data in wm8994_readable_register() Greg KH
2011-11-19  0:02 ` [06/26] sh: Fix cached/uncaced address calculation in 29bit mode Greg KH
2011-11-19  0:02 ` [07/26] drm/i915: Fix object refcount leak on mmappable size limit error path Greg KH
2011-11-19  0:02 ` [08/26] drm/nouveau: initialize chan->fence.lock before use Greg KH
2011-11-19  0:02 ` [09/26] drm/radeon/kms: make an aux failure debug only Greg KH
2011-11-19  0:02 ` [10/26] ALSA: usb-audio - Check the dB-range validity in the later read, too Greg KH
2011-11-19  0:02 ` [11/26] ALSA: usb-audio - Fix the missing volume quirks at delayed init Greg KH
2011-11-19  0:02 ` [12/26] KEYS: Fix a NULL pointer deref in the user-defined key type Greg KH
2011-11-19  0:02 ` [13/26] hfs: add sanity check for file name length Greg KH
2011-11-19  0:02 ` [14/26] Revert "leds: save the delay values after a successful call to blink_set()" Greg KH
2011-11-19  0:02 ` [15/26] drm/radeon: add some missing FireMV pci ids Greg KH
2011-11-19  0:02 ` [16/26] staging: brcm80211: fill in proper rx rate in mac80211 rx status Greg KH
2011-11-19  0:02 ` [17/26] b43: refuse to load unsupported firmware Greg KH
2011-11-19 17:22   ` Ben Hutchings
2011-11-19 19:05     ` Greg KH
2011-11-19 19:49       ` Ben Hutchings
2011-11-19  0:02 ` [18/26] mfd: Fix twl4030 dependencies for audio codec Greg KH
2011-11-19  0:02 ` [19/26] xen:pvhvm: enable PVHVM VCPU placement when using more than 32 CPUs Greg KH
2011-11-19  0:02 ` [20/26] xen-gntalloc: integer overflow in gntalloc_ioctl_alloc() Greg KH
2011-11-19  0:02 ` [21/26] xen-gntalloc: signedness bug in add_grefs() Greg KH
2011-11-19  0:02 ` Greg KH [this message]
2011-11-19  0:02 ` [23/26] powerpc: Add hvcall.h include to book3s_hv.c Greg KH
2011-11-19  0:03 ` [24/26] powerpc: Copy down exception vectors after feature fixups Greg KH
2011-11-19  0:03 ` [25/26] backing-dev: ensure wakeup_timer is deleted Greg KH
2011-11-19  0:03 ` [26/26] block: Always check length of all iov entries in blk_rq_map_user_iov() Greg KH
2011-11-19 19:57 ` [00/26] 3.1.2-stable review Woody Suwalski
2011-11-20  0:43   ` Greg KH

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=20111119000329.862001060@clark.kroah.org \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=benh@kernel.crashing.org \
    --cc=geoff@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®