linux-stable/arch/powerpc/sysdev
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
..
ge powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
qe_lib powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
xics powerpc/powernv: Don't call generic code on offline cpus 2014-09-25 23:14:50 +10:00
6xx-suspend.S
axonram.c powerpc: make of_device_ids const 2014-09-25 23:14:46 +10:00
cpm1.c
cpm2.c
cpm2_pic.c powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
cpm2_pic.h
cpm_common.c powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
dart.h
dart_iommu.c powerpc/kmemleak: Do not scan the DART table 2014-06-24 14:29:46 +10:00
dcr-low.S
dcr.c powerpc: Export dcr_ind_lock to fix build error 2014-09-25 23:14:45 +10:00
ehv_pic.c powerpc:eVh_pic: Kill irq_desc abuse 2014-03-04 17:37:51 +01:00
fsl_85xx_cache_ctlr.h
fsl_85xx_cache_sram.c
fsl_85xx_l2ctlr.c powerpc: make of_device_ids const 2014-09-25 23:14:46 +10:00
fsl_gtm.c Merge remote-tracking branch 'grant/devicetree/next' into for-next 2013-11-07 10:34:46 -06:00
fsl_lbc.c powerpc/85xx: handle the eLBC error interrupt if it exists in dts 2014-01-10 17:19:27 -06:00
fsl_mpic_err.c
fsl_mpic_timer_wakeup.c powerpc/fsl: add MPIC timer wakeup support 2013-07-01 18:38:42 -05:00
fsl_msi.c powerpc/fsl_msi: add MSIIR1 support for MPIC v4.3 2013-08-07 18:38:05 -05:00
fsl_msi.h powerpc/fsl_msi: add MSIIR1 support for MPIC v4.3 2013-08-07 18:38:05 -05:00
fsl_pci.c powerpc/fsl-pci: Correct use of ! and & 2014-07-29 19:26:31 -05:00
fsl_pci.h fsl/pci: The new pci suspend/resume implementation 2014-03-19 22:37:44 -05:00
fsl_pmc.c powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
fsl_rio.c powerpc/fsl-rio: Fix fsl_rio_setup error paths and use-after-unmap 2014-05-09 15:49:05 -05:00
fsl_rio.h
fsl_rmu.c powerpc/rmu: Fix the error memory free parameters 2014-05-22 18:08:13 -05:00
fsl_soc.c powerpc/fsl: fsl_soc: remove 'fixed-link' parsing code 2014-05-22 15:16:44 -04:00
fsl_soc.h powerpc/mpc512x: remove unnecessary #if 2013-10-30 22:56:10 +01:00
grackle.c
i8259.c powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
indirect_pci.c powerpc/sysdev: Fix a pci section mismatch for Book E 2014-01-07 19:23:31 -06:00
ipic.c
ipic.h
Kconfig powerpc: Added PCI MSI support using the HSTA module 2014-05-01 08:26:30 +10:00
Makefile powerpc: Added PCI MSI support using the HSTA module 2014-05-01 08:26:30 +10:00
micropatch.c powerpc/8xx: Remove empty asm/mpc8xx.h 2014-06-25 18:49:40 -05:00
mmio_nvram.c
mpc5xxx_clocks.c
mpc8xx_pic.c powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
mpc8xx_pic.h
mpic.c powerpc: Make a bunch of things static 2014-09-25 23:14:41 +10:00
mpic.h
mpic_msgr.c powerpc/mpic_msgr: Use kcalloc and correct the argument to sizeof 2014-07-29 19:26:31 -05:00
mpic_msi.c of/irq: Replace of_irq with of_phandle_args 2013-10-24 11:42:51 +01:00
mpic_pasemi_msi.c
mpic_timer.c powerpc/mpic_timer: fix convert ticks to time subtraction overflow 2014-01-09 17:52:14 -06:00
mpic_u3msi.c
msi_bitmap.c powerpc: Make a bunch of things static 2014-09-25 23:14:41 +10:00
mv64x60.h
mv64x60_dev.c powerpc: make of_device_ids const 2014-09-25 23:14:46 +10:00
mv64x60_pci.c
mv64x60_pic.c
mv64x60_udbg.c dt/bindings: Remove device_type "serial" from marvell,mv64360-mpsc 2014-01-16 16:31:31 +00:00
of_rtc.c powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
pmi.c powerpc: make of_device_ids const 2014-09-25 23:14:46 +10:00
ppc4xx_cpm.c
ppc4xx_gpio.c
ppc4xx_hsta_msi.c powerpc: Added PCI MSI support using the HSTA module 2014-05-01 08:26:30 +10:00
ppc4xx_msi.c
ppc4xx_ocm.c powerpc/44x: Fix ocm_block allocation 2013-12-10 11:25:04 +11:00
ppc4xx_pci.c powerpc: Added PCI MSI support using the HSTA module 2014-05-01 08:26:30 +10:00
ppc4xx_pci.h
ppc4xx_soc.c powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
rtc_cmos_setup.c PTR_RET is now PTR_ERR_OR_ZERO(): Replace most. 2013-07-15 11:25:01 +09:30
scom.c powerpc/scom: Improve debugfs interface 2013-11-06 14:13:50 +11:00
simple_gpio.c
simple_gpio.h
tsi108_dev.c
tsi108_pci.c
udbg_memcons.c powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
uic.c
xilinx_intc.c powerpc: make of_device_ids const 2014-09-25 23:14:46 +10:00
xilinx_pci.c powerpc: make of_device_ids const 2014-09-25 23:14:46 +10:00