On Petrenko's deviations and second order differential equations