mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
1f4cd884c1
commit 1c2cb594441d02815d304cccec9742ff5c707495 upstream.
The EPOW interrupt handler uses rtas_get_sensor(), which in turn
uses rtas_busy_delay() to wait for RTAS becoming ready in case it
is necessary. But rtas_busy_delay() is annotated with might_sleep()
and thus may not be used by interrupts handlers like the EPOW handler!
This leads to the following BUG when CONFIG_DEBUG_ATOMIC_SLEEP is
enabled:
BUG: sleeping function called from invalid context at arch/powerpc/kernel/rtas.c:496
in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: swapper/1
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.2.0-rc2-thuth #6
Call Trace:
[c00000007ffe7b90] [c000000000807670] dump_stack+0xa0/0xdc (unreliable)
[c00000007ffe7bc0] [c0000000000e1f14] ___might_sleep+0x134/0x180
[c00000007ffe7c20] [c00000000002aec0] rtas_busy_delay+0x30/0xd0
[c00000007ffe7c50] [c00000000002bde4] rtas_get_sensor+0x74/0xe0
[c00000007ffe7ce0] [c000000000083264] ras_epow_interrupt+0x44/0x450
[c00000007ffe7d90] [c000000000120260] handle_irq_event_percpu+0xa0/0x300
[c00000007ffe7e70] [c000000000120524] handle_irq_event+0x64/0xc0
[c00000007ffe7eb0] [c000000000124dbc] handle_fasteoi_irq+0xec/0x260
[c00000007ffe7ef0] [c00000000011f4f0] generic_handle_irq+0x50/0x80
[c00000007ffe7f20] [c000000000010f3c] __do_irq+0x8c/0x200
[c00000007ffe7f90] [c0000000000236cc] call_do_irq+0x14/0x24
[c00000007e6f39e0] [c000000000011144] do_IRQ+0x94/0x110
[c00000007e6f3a30] [c000000000002594] hardware_interrupt_common+0x114/0x180
Fix this issue by introducing a new rtas_get_sensor_fast() function
that does not use rtas_busy_delay() - and thus can only be used for
sensors that do not cause a BUSY condition - known as "fast" sensors.
The EPOW sensor is defined to be "fast" in sPAPR - mpe.
Fixes:
|
||
---|---|---|
.. | ||
8xx_immap.h | ||
abs_addr.h | ||
agp.h | ||
asm-compat.h | ||
asm-offsets.h | ||
async_tx.h | ||
atomic.h | ||
auxvec.h | ||
backlight.h | ||
barrier.h | ||
bitops.h | ||
bitsperlong.h | ||
bootx.h | ||
btext.h | ||
bug.h | ||
bugs.h | ||
byteorder.h | ||
cache.h | ||
cacheflush.h | ||
cell-pmu.h | ||
cell-regs.h | ||
checksum.h | ||
clk_interface.h | ||
cmpxchg.h | ||
code-patching.h | ||
compat.h | ||
cpm.h | ||
cpm1.h | ||
cpm2.h | ||
cputable.h | ||
cputhreads.h | ||
cputime.h | ||
current.h | ||
dbdma.h | ||
dbell.h | ||
dcr-generic.h | ||
dcr-mmio.h | ||
dcr-native.h | ||
dcr-regs.h | ||
dcr.h | ||
debug.h | ||
delay.h | ||
device.h | ||
disassemble.h | ||
div64.h | ||
dma-mapping.h | ||
dma.h | ||
edac.h | ||
eeh.h | ||
eeh_event.h | ||
ehv_pic.h | ||
elf.h | ||
emergency-restart.h | ||
emulated_ops.h | ||
epapr_hcalls.h | ||
errno.h | ||
exception-64e.h | ||
exception-64s.h | ||
exec.h | ||
fadump.h | ||
fb.h | ||
fcntl.h | ||
feature-fixups.h | ||
firmware.h | ||
fixmap.h | ||
floppy.h | ||
fs_pd.h | ||
fsl_85xx_cache_sram.h | ||
fsl_gtm.h | ||
fsl_guts.h | ||
fsl_hcalls.h | ||
fsl_ifc.h | ||
fsl_lbc.h | ||
ftrace.h | ||
futex.h | ||
gpio.h | ||
grackle.h | ||
hardirq.h | ||
heathrow.h | ||
highmem.h | ||
hugetlb.h | ||
hvcall.h | ||
hvconsole.h | ||
hvcserver.h | ||
hvsi.h | ||
hw_breakpoint.h | ||
hw_irq.h | ||
hydra.h | ||
i8259.h | ||
ibmebus.h | ||
ide.h | ||
immap_cpm2.h | ||
immap_qe.h | ||
io-defs.h | ||
io-workarounds.h | ||
io.h | ||
io_event_irq.h | ||
ioctl.h | ||
ioctls.h | ||
iommu.h | ||
ipcbuf.h | ||
ipic.h | ||
irq.h | ||
irq_regs.h | ||
irqflags.h | ||
jump_label.h | ||
Kbuild | ||
kdebug.h | ||
kdump.h | ||
kexec.h | ||
keylargo.h | ||
kgdb.h | ||
kmap_types.h | ||
kprobes.h | ||
kvm.h | ||
kvm_44x.h | ||
kvm_asm.h | ||
kvm_book3s.h | ||
kvm_book3s_32.h | ||
kvm_book3s_64.h | ||
kvm_book3s_asm.h | ||
kvm_booke.h | ||
kvm_e500.h | ||
kvm_fpu.h | ||
kvm_host.h | ||
kvm_para.h | ||
kvm_ppc.h | ||
libata-portmap.h | ||
linkage.h | ||
local.h | ||
local64.h | ||
lppaca.h | ||
lv1call.h | ||
machdep.h | ||
macio.h | ||
mc146818rtc.h | ||
mediabay.h | ||
mman.h | ||
mmu-8xx.h | ||
mmu-40x.h | ||
mmu-44x.h | ||
mmu-book3e.h | ||
mmu-hash32.h | ||
mmu-hash64.h | ||
mmu.h | ||
mmu_context.h | ||
mmzone.h | ||
module.h | ||
mpc5xxx.h | ||
mpc6xx.h | ||
mpc8xx.h | ||
mpc52xx.h | ||
mpc52xx_psc.h | ||
mpc5121.h | ||
mpc8260.h | ||
mpic.h | ||
mpic_msgr.h | ||
msgbuf.h | ||
msi_bitmap.h | ||
mutex.h | ||
nvram.h | ||
ohare.h | ||
opal.h | ||
oprofile_impl.h | ||
paca.h | ||
page.h | ||
page_32.h | ||
page_64.h | ||
param.h | ||
parport.h | ||
pasemi_dma.h | ||
pci-bridge.h | ||
pci.h | ||
percpu.h | ||
perf_event.h | ||
perf_event_fsl_emb.h | ||
perf_event_server.h | ||
pgalloc-32.h | ||
pgalloc-64.h | ||
pgalloc.h | ||
pgtable-ppc32.h | ||
pgtable-ppc64-4k.h | ||
pgtable-ppc64-64k.h | ||
pgtable-ppc64.h | ||
pgtable.h | ||
pmac_feature.h | ||
pmac_low_i2c.h | ||
pmac_pfunc.h | ||
pmc.h | ||
pmi.h | ||
poll.h | ||
posix_types.h | ||
ppc-opcode.h | ||
ppc-pci.h | ||
ppc4xx.h | ||
ppc_asm.h | ||
processor.h | ||
prom.h | ||
ps3.h | ||
ps3av.h | ||
ps3fb.h | ||
ps3gpu.h | ||
ps3stor.h | ||
pSeries_reconfig.h | ||
pte-8xx.h | ||
pte-40x.h | ||
pte-44x.h | ||
pte-book3e.h | ||
pte-common.h | ||
pte-fsl-booke.h | ||
pte-hash32.h | ||
pte-hash64-4k.h | ||
pte-hash64-64k.h | ||
pte-hash64.h | ||
ptrace.h | ||
qe.h | ||
qe_ic.h | ||
reg.h | ||
reg_8xx.h | ||
reg_a2.h | ||
reg_booke.h | ||
reg_fsl_emb.h | ||
resource.h | ||
rheap.h | ||
rio.h | ||
rtas.h | ||
rtc.h | ||
runlatch.h | ||
scatterlist.h | ||
scom.h | ||
seccomp.h | ||
sections.h | ||
sembuf.h | ||
serial.h | ||
setjmp.h | ||
setup.h | ||
sfp-machine.h | ||
shmbuf.h | ||
shmparam.h | ||
sigcontext.h | ||
siginfo.h | ||
signal.h | ||
smp.h | ||
smu.h | ||
socket.h | ||
sockios.h | ||
sparsemem.h | ||
spinlock.h | ||
spinlock_types.h | ||
spu.h | ||
spu_csa.h | ||
spu_info.h | ||
spu_priv1.h | ||
sstep.h | ||
stat.h | ||
statfs.h | ||
string.h | ||
swab.h | ||
swiotlb.h | ||
switch_to.h | ||
synch.h | ||
syscall.h | ||
syscalls.h | ||
systbl.h | ||
tce.h | ||
termbits.h | ||
termios.h | ||
thread_info.h | ||
time.h | ||
timex.h | ||
tlb.h | ||
tlbflush.h | ||
topology.h | ||
trace.h | ||
tsi108.h | ||
tsi108_irq.h | ||
tsi108_pci.h | ||
types.h | ||
uaccess.h | ||
ucc.h | ||
ucc_fast.h | ||
ucc_slow.h | ||
ucontext.h | ||
udbg.h | ||
uic.h | ||
unaligned.h | ||
uninorth.h | ||
unistd.h | ||
user.h | ||
vdso.h | ||
vdso_datapage.h | ||
vga.h | ||
vio.h | ||
wsp.h | ||
xics.h | ||
xilinx_intc.h | ||
xilinx_pci.h | ||
xmon.h | ||
xor.h |