I see there are various threads for Galaxy S3 having this problem, but my phone is Sony Xperia S.
My phone used to connect to PCs fine, but today when I tried connecting to my laptop it wouldn't recognize it. This happens on Windows and on Ubuntu, with the original USB cable, and with a generic one. The same cables and computers used to work fine with my phone.
Also, the phone does not give any notification that a PC has been connected, i.e. the phone itself doesn't recognize that a PC has been connected. It starts charging, though.
I tried rebooting Android, I also tried enabling USB debugging, but none of it helped.