Commit ad084f3
omap: Avoid crashes in the case of hwmod misconfiguration
omap hwmod is really sensitive to hwmod misconfiguration.
Getting a minor clock wrong always ended up in a crash.
Attempt to be more resilient by not assigning variables with
error codes and then attempting to use them.
Without this patch, missing a clock ends up with something like this:
omap_hwmod: ehrpwm0: cannot clk_get opt_clk ehrpwm0_tbclk!
Unable to handle kernel NULL pointer dereference at virtual address 0000002a!
pgd = c0004000!
[0000002a] *pgd=00000000!
Internal error: Oops: 5 [#1] SMP ARM!
Modules linked in:!
CPU: 0 Not tainted (3.8.0-rc2-12157-g76c7825-dirty torvalds#291)!
PC is at __clk_prepare+0x10/0x70!
LR is at clk_prepare+0x1c/0x34!
pc : [<c03e37f0>] lr : [<c03e386c>] psr: a0000113!
sp : cf04fef8 ip : 22222222 fp : 00000000!
r10: ffffffea r9 : 00000000 r8 : 00000000!
r7 : fffffffe r6 : 00000001 r5 : fffffffe r4 : fffffffe!
r3 : cf041ac0 r2 : cf04ff00 r1 : 22222222 r0 : fffffffe!
Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel!
Control: 10c5387d Table: 80004019 DAC: 00000015!
Process swapper/0 (pid: 1, stack limit = 0xcf04e240)!
Stack: (0xcf04fef8 to 0xcf050000)!
fee0: cf041ac0 c07749f4!
ff00: fffffffe c03e386c c07499cc c073c070 c073d2fc c06d4e4c c073c070 c071cc18!
ff20: c06d4c4c 00000000 00000000 c0708284 c06c91bc c0025e28 c073a030 00000001!
ff40: c06f5f60 c06f5f40 c06d5324 c06d533c cf04e000 c0008870 c06d5324 c060abe8!
ff60: c07082e8 00000002 00000001 c06f5f60 c06f5f40 c077d70 00000099 c04a43d4!
ff80: 00000001 00000001 c06c91bc 00000000 00000000 c04a42dc 00000000 00000000!
ffa0: 00000000 00000000 00000000 c000d678 00000000 00000000 00000000 00000000!
ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000!
ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 9e7befee f7bbaaab!
[<c03e37f0>] (__clk_prepare+0x10/0x70) from [<c03e386c>] (clk_prepare+0x1c/0x34)!
[<c03e386c>] (clk_prepare+0x1c/0x34) from [<c06d4e4c>] (_init+0x200/0x288)!
[<c06d4e4c>] (_init+0x200/0x288) from [<c0025e28>] (omap_hwmod_for_each+0x28/0x58)!
[<c0025e28>] (omap_hwmod_for_each+0x28/0x58) from [<c06d533c>] (omap_hwmod_setup_all+0x18/0x34)!
[<c06d533c>] (omap_hwmod_setup_all+0x18/0x34) from [<c0008870>] (do_one_initcall+0x90/0x160)!
[<c0008870>] (do_one_initcall+0x90/0x160) from [<c04a43d4>] (kernel_init+0xf8/0x290)!
[<c04a43d4>] (kernel_init+0xf8/0x290) from [<c000d678>] (ret_from_fork+0x14/0x3c)!
Code: e92d4038 e2504000 01a05004 0a000015 (e594302c) !
---[ end trace 1b75b31a2719ed1c ]---!
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b!
Signed-off-by: Pantelis Antoniou <[email protected]>1 parent 56088ba commit ad084f3
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
783 | 783 | | |
784 | 784 | | |
785 | 785 | | |
786 | | - | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
787 | 789 | | |
788 | 790 | | |
789 | 791 | | |
| |||
819 | 821 | | |
820 | 822 | | |
821 | 823 | | |
822 | | - | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
823 | 827 | | |
824 | 828 | | |
825 | 829 | | |
| |||
0 commit comments