csky: Optimize the trap processing flow