I'm having the same problem with my iPhone 3G 16gb. It's willing to restore to 3.1.3 original firmware, but when the bar is 2/3 full it shows the swirley thing and then reboots in DFU.
iTunes prompts with the message 'iPhone can not be restored (error 6)'
I can restore over and over, tried 3.1.3, 3.1.2, 3.1, 3.1.3 custom and 3.1.2 custom several times, on three windows machines (XP, Vista and Win7). Think I will try it at the local Apple store in a few days..