My accelerometer is also having problems. It works perfectly until the iPhone sleeps for 30 seconds or more - when it wakes the screen no longer rotates (in photos, safari, calculator, etc).
Accelerometer based games behave as if the top of the phone is pointing down to the ground (other motions still have an effect in these games though, so it seems to be just one of the 3 accelerometer axes that is reporting the wrong value).
Also, the camera app thinks I'm holding the phone upside down, so the photos are stored upside down!
A reset always fixes the problem. If I set "Auto-Lock" to never and don't press the sleep/wake button then the accelerometer works perfectly! Of course this isn't exactly practical..
Interestingly, if I sleep the phone for less than 30 seconds it comes back working fine (it must not quite have entered the actual sleep state yet).
If anyone else has similar problems then I'm hopeful a firmware/software update could fix the problem, otherwise I guess I'll have to get it replaced.