The phrase has been used to mean confused haste since the 1500s, but there is no known origin. In the sense of a fairground ride, it has been around since the early 1900s.
It resembles other sound-duplications such as higgledy-piggledy, harum-scarum etc, most of which have a suggestion of chaos/confusion attached.