Yes, the patch fixes the immediate lockup. But it seems your analysis on why it fails isn't correct as I can now see your printks toggling between AC and DC when plugging in/out external power.