Commits
Grygorii Strashko committed 68b1d64a892
ARM: omap: wakeupgen: dra7: fix NULL pointer dereference during suspend The wakeupgen_ops is not initialized for DRA7x SoCs and, as result, kernel crashes during suspend in irq_save_context/irq_restore_context: PM: Calling cpu_pm_suspend+0x0/0x18 Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = ede14000 [00000000] *pgd=add61831, *pte=00000000, *ppte=00000000 Internal error: Oops: 17 [#1] PREEMPT SMP ARM Modules linked in: CPU: 0 PID: 89 Comm: sh Not tainted 4.1.2-rt1-00745-gd38bd2f-dirty #12 Hardware name: Generic DRA74X (Flattened Device Tree) task: edddd400 ti: ede44000 task.ti: ede44000 PC is at irq_notifier+0x98/0xb8 LR is at irq_notifier+0xa8/0xb8 pc : [<c0029b78>] lr : [<c0029b88>] psr: 60000093 sp : ede45dd0 ip : c07c2e94 fp : c069d6ec r10: 00000000 r9 : c082b632 r8 : ede45e14 r7 : 00000003 r6 : 00000000 r5 : fffffffe r4 : c0831660 r3 : 00000000 r2 : 00000000 r1 : 00000003 r0 : 00000000 Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user Control: 10c5387d Table: ade1406a DAC: 00000015 Process sh (pid: 89, stack limit = 0xede44218) Stack: (0xede45dd0 to 0xede46000) 5dc0: c080a8e0 c07c03a8 c07c1cbc c0053c78 5de0: c081b564 c0053c78 c07d58b4 c080a8e0 c07c03a8 c082bc7c c082e268 c00e0c94 5e00: ede45e14 c05779cc c07d58b4 c00e0d5c c07d58b4 c00e0d99 c07d58b4 c03a64d0 5e20: 00000003 00000000 c0833058 c083301c 00000000 c07bce84 c082bc7c c0079628 5e40: c082e1f8 c0833064 c069d710 00000000 c069d6ec c007d118 c069d6b4 ede45e7c 5e60: 00000000 00000003 00000000 c069d700 c082e1f8 c0833064 c069d710 00000000 5e80: c069d6ec c007a0b4 c069d6ec 0000000c edddd448 00000003 c069b370 00000003 5ea0: c0833068 00000004 ede5d780 00000000 00000000 c0078598 ede5d980 00000004 5ec0: ede5d780 001ff9b8 ede5d98c ede45f88 00000000 c01aa85c 00000000 00000000 5ee0: 001fd25c ede5e100 c01aa7a4 001ff9b8 ede45f88 c000f764 ede44000 00000000 5f00: 00000002 c0140c48 edcaac00 edcaad88 00000001 c07bdd50 ede44000 00000000 5f20: 00000002 c0142fb8 00000020 00000000 00000000 c0141200 0000000a 00000003 5f40: 00000000 be982814 ede5e100 00000004 ede5e100 00000004 001ff9b8 ede45f88 5f60: c000f764 c014146c 00000000 00000000 ede5e100 ede5e100 001ff9b8 00000004 5f80: c000f764 c0141c90 00000000 00000000 00000002 001fc4e0 00000004 001ff9b8 5fa0: 00000004 c000f5e0 001fc4e0 00000004 00000001 001ff9b8 00000004 001fbc18 5fc0: 001fc4e0 00000004 001ff9b8 00000004 001fd264 001fcfc8 00000000 00000002 5fe0: 00000001 be982628 0000c55c 0000921c 60000010 00000001 00000000 00000000 [<c0029b78>] (irq_notifier) from [<c0053c78>] (notifier_call_chain+0x44/0x84) [<c0053c78>] (notifier_call_chain) from [<c00e0c94>] (cpu_pm_notify+0x20/0x3c) [<c00e0c94>] (cpu_pm_notify) from [<c00e0d5c>] (cpu_cluster_pm_enter+0x20/0x54) [<c00e0d5c>] (cpu_cluster_pm_enter) from [<c03a64d0>] (syscore_suspend+0x78/0x298) [<c03a64d0>] (syscore_suspend) from [<c0079628>] (suspend_devices_and_enter+0x320/0x8d0) [<c0079628>] (suspend_devices_and_enter) from [<c007a0b4>] (pm_suspend+0x4dc/0x694) [<c007a0b4>] (pm_suspend) from [<c0078598>] (state_store+0x64/0xb8) [<c0078598>] (state_store) from [<c01aa85c>] (kernfs_fop_write+0xb8/0x19c) [<c01aa85c>] (kernfs_fop_write) from [<c0140c48>] (__vfs_write+0x20/0xd8) [<c0140c48>] (__vfs_write) from [<c014146c>] (vfs_write+0x90/0x164) [<c014146c>] (vfs_write) from [<c0141c90>] (SyS_write+0x44/0x9c) [<c0141c90>] (SyS_write) from [<c000f5e0>] (ret_fast_syscall+0x0/0x3c) Code: e5943388 e3530000 0a000003 e594338c (e5933000) Hence, add additional checks before accessing wakeupgen_ops. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>