Steps to Downgrade the iPhone iOS4 4.0.2 !
1. Download the Firmware version 4.0.1 from HERE.
2. Backup your iPhone through iTunes.
3. Put iPhone into DFU Mode :-
(1). First, Open up iTunes, plug in your iPod Touch/iPhone to the CPU's USB port. Turn on your CPU's speaker and make sure it is loud enough that you can hear it.
(2). Hold down the Home button (top left for iPod Touch and top right for the iPhone with the screen facing you) and the Power button (located on the front bottom of your iPod Touch/iPhone) simutaneously, until the screen goes black and the device turns off. (past the red slider/slide to power off screen)
(3). Now let go of the Power button, but continue to hold the Home button. Your iPod Touch/iPhone should have turned off and the screen should not be on.
(4). After around ~10-20 seconds, you will hear a noise (beep/ding) from your CPU as if it had just recognized a new hardware device, now iTunes should recognize it in DFU mode.
(5). After iTunes recognizes the iPod Touch/iPhone, let go of the Home button otherwise it will go into recovery mode and you will have to do the entire DFU process over again.
(6). You will know when you have put your iPod Touch/iPhone correctly into DFU mode when the display is blank and that you do not have anything on your device.
(2). Hold down the Home button (top left for iPod Touch and top right for the iPhone with the screen facing you) and the Power button (located on the front bottom of your iPod Touch/iPhone) simutaneously, until the screen goes black and the device turns off. (past the red slider/slide to power off screen)
(3). Now let go of the Power button, but continue to hold the Home button. Your iPod Touch/iPhone should have turned off and the screen should not be on.
(4). After around ~10-20 seconds, you will hear a noise (beep/ding) from your CPU as if it had just recognized a new hardware device, now iTunes should recognize it in DFU mode.
(5). After iTunes recognizes the iPod Touch/iPhone, let go of the Home button otherwise it will go into recovery mode and you will have to do the entire DFU process over again.
(6). You will know when you have put your iPod Touch/iPhone correctly into DFU mode when the display is blank and that you do not have anything on your device.
4. Press Shift+Restore and select the Firmware 4.0.1 and Downgrade your iPhone to Firmware 4.0.1 from 4.0.2.