A simple record: today, when debugging the dormant code, we encountered a very strange problem. During the wake-up process, we encountered a problem that we did not see oops. It seems that the operation is illegal, and the CPU enters the abnormal state. Bad mode in prefetch abort handler Detected
Internal error: Oops-bad mode: 0 [#1]
Modules linked in:
CPU: 0
PC is at serial_pxa_resume + 0x38/0x58
LR is at uart_resume_port + 0x1d8/0x1e4
PC: [<c01186ec>] LR: [<c01_aec>] not tainted
SP: c78c1df0 IP: c78c1de0 FP: c78c1e4c
R10: c79fb7a0 R9: c78c1f78 R8: 00000008.
R7: c01ea010 R6: c0218580 R5: c0218658 R4: c023f0a8
R3: 00000000 R2: 00000001 r1: 00000000 R0: 00000000
Flags: nzcv irqs off fiqs on mode uk8_32 segment user, the code is normal, and there is no rare operation, so there should be no such strange error, the reason is that local_irq_save and local_irq_restore are not paired on a branch path, making the parameter passed to local_irq_restore incorrect. This error occurs because the value of the processor mode bit in CPSR is incorrect.