2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-25 21:54:06 +08:00
linux-next/arch/powerpc/platforms/powernv
Paul Mackerras d6a4f70909 powerpc/powernv: Don't call generic code on offline cpus
On PowerNV platforms, when a CPU is offline, we put it into nap mode.
It's possible that the CPU wakes up from nap mode while it is still
offline due to a stray IPI.  A misdirected device interrupt could also
potentially cause it to wake up.  In that circumstance, we need to clear
the interrupt so that the CPU can go back to nap mode.

In the past the clearing of the interrupt was accomplished by briefly
enabling interrupts and allowing the normal interrupt handling code
(do_IRQ() etc.) to handle the interrupt.  This has the problem that
this code calls irq_enter() and irq_exit(), which call functions such
as account_system_vtime() which use RCU internally.  Use of RCU is not
permitted on offline CPUs and will trigger errors if RCU checking is
enabled.

To avoid calling into any generic code which might use RCU, we adopt
a different method of clearing interrupts on offline CPUs.  Since we
are on the PowerNV platform, we know that the system interrupt
controller is a XICS being driven directly (i.e. not via hcalls) by
the kernel.  Hence this adds a new icp_native_flush_interrupt()
function to the native-mode XICS driver and arranges to call that
when an offline CPU is woken from nap.  This new function reads the
interrupt from the XICS.  If it is an IPI, it clears the IPI; if it
is a device interrupt, it prints a warning and disables the source.
Then it does the end-of-interrupt processing for the interrupt.

The other thing that briefly enabling interrupts did was to check and
clear the irq_happened flag in this CPU's PACA.  Therefore, after
flushing the interrupt from the XICS, we also clear all bits except
the PACA_IRQ_HARD_DIS (interrupts are hard disabled) bit from the
irq_happened flag.  The PACA_IRQ_HARD_DIS flag is set by power7_nap()
and is left set to indicate that interrupts are hard disabled.  This
means we then have to ignore that flag in power7_nap(), which is
reasonable since it doesn't indicate that any interrupt event needs
servicing.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2014-09-25 23:14:50 +10:00
..
eeh-ioda.c powerpc: Make a bunch of things static 2014-09-25 23:14:41 +10:00
eeh-powernv.c powerpc/eeh: Aux PE data for error log 2014-08-05 15:41:43 +10:00
Kconfig powerpc/powernv: Enable POWER8 doorbell IPIs 2014-06-11 17:05:12 +10:00
Makefile powerpc/powernv: Invoke opal call to handle hmi. 2014-08-05 16:33:52 +10:00
opal-async.c powerpc/powernv: Switch powernv drivers to use machine_xxx_initcall() 2014-07-28 14:11:26 +10:00
opal-dump.c powerpc/powernv: Check OPAL dump calls exist before using 2014-09-25 23:14:36 +10:00
opal-elog.c powerpc/powernv: Check OPAL elog calls exist before using 2014-09-25 23:14:36 +10:00
opal-flash.c powerpc/powernv: Pass buffer size to OPAL validate flash call 2014-06-05 14:54:04 +10:00
opal-hmi.c powerpc: use machine_subsys_initcall() for opal_hmi_handler_init() 2014-09-09 19:02:46 +10:00
opal-lpc.c powerpc/powernv: Switch powernv drivers to use machine_xxx_initcall() 2014-07-28 14:11:26 +10:00
opal-memory-errors.c powerpc/powernv: Switch powernv drivers to use machine_xxx_initcall() 2014-07-28 14:11:26 +10:00
opal-msglog.c powerpc/powernv: Fix reading of OPAL msglog 2014-06-11 17:03:36 +10:00
opal-nvram.c powerpc/powernv: Make OPAL NVRAM device tree accesses endian safe 2013-10-11 16:48:47 +11:00
opal-rtc.c powerpc/powernv: Check OPAL RTC calls exists before using 2014-09-25 23:14:35 +10:00
opal-sensor.c powerpc/powernv: Fix endian issues with sensor code 2014-04-09 12:52:49 +10:00
opal-sysparam.c powernv: Fix permissions on sysparam sysfs entries 2014-06-11 17:03:15 +10:00
opal-tracepoints.c powerpc/jump_label: use HAVE_JUMP_LABEL? 2014-09-25 23:14:45 +10:00
opal-wrappers.S powerpc/powernv: Add OPAL check token call 2014-09-25 23:14:35 +10:00
opal-xscom.c powerpc/powernv: Switch powernv drivers to use machine_xxx_initcall() 2014-07-28 14:11:26 +10:00
opal.c powerpc/powernv: Interface to register/unregister opal dump region 2014-08-13 15:13:45 +10:00
pci-ioda.c powerpc: Make a bunch of things static 2014-09-25 23:14:41 +10:00
pci-p5ioc2.c powerpc/powernv: Add a page size parameter to pnv_pci_setup_iommu_table() 2014-07-11 16:05:53 +10:00
pci.c powerpc/powernv: Handle compound PE in config accessors 2014-08-05 16:33:39 +10:00
pci.h powerpc/powernv: Handle compound PE 2014-08-05 16:33:30 +10:00
powernv.h powerpc/powernv: Add support for POWER8 split core on powernv 2014-05-28 13:35:37 +10:00
rng.c powerpc/powernv: Switch powernv drivers to use machine_xxx_initcall() 2014-07-28 14:11:26 +10:00
setup.c powerpc: Make a bunch of things static 2014-09-25 23:14:41 +10:00
smp.c powerpc/powernv: Don't call generic code on offline cpus 2014-09-25 23:14:50 +10:00
subcore-asm.S powerpc/powernv: Add support for POWER8 split core on powernv 2014-05-28 13:35:37 +10:00
subcore.c powerpc: Ensure global functions include their prototype 2014-09-25 23:14:42 +10:00
subcore.h powerpc/powernv: Add support for POWER8 split core on powernv 2014-05-28 13:35:37 +10:00