After searching and searching on google and a lot of other forums, I have found a solution for this issue, well at least for mine, and you can test to see if thats your case too. I have tried, resetting the phone, restoring the phone, reinstalling itunes, restarting computer etc but it was a hardware issue.
Disconnect flex cable #3 and restart your phone. If it boots normally then #3 cable(ear/proximity sensor) is defected.
Disconnect flex cable #3 and restart your phone. If it boots normally then #3 cable(ear/proximity sensor) is defected.