I got my new Mi5 today and I flash 6.6.30 and compass, light sensor, gyroscope and auto rotation doesn’t work everything else working fine. I am so worry if the the phone have a hardware problem. If you find a solution Please report it.
I've had the same problem, and this solution worked for...