autotest: Repair the firmware earlier

Firmware is easy to be corrupted when running FAFT. The current
execution sequence of the repair functions makes the repair job
take 1 hour to recover the corrupted firmware. We should run
the firmware repair function earlier. As the function is only
executed on the dedicated pool:faft-test, this change won't
affect other pools.

BUG=chromium:577924
TEST=None, trivial change.

Change-Id: I750bc5190c398a3d95a5ceee7eaac095806057e8
Reviewed-on: https://chromium-review.googlesource.com/322247
Commit-Ready: Wai-Hong Tam <waihong@chromium.org>
Tested-by: Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
diff --git a/server/hosts/cros_host.py b/server/hosts/cros_host.py
index 8b45e4f..0b4804a 100644
--- a/server/hosts/cros_host.py
+++ b/server/hosts/cros_host.py
@@ -1367,17 +1367,17 @@
             logging.info('Last provision failed, try powerwash first.')
             autotest_stats.Counter(
                     'repair_force_powerwash.TOTAL').increment()
-            repair_funcs = [self._install_repair_with_powerwash,
-                            self._servo_repair_reinstall,
-                            self._firmware_repair]
+            repair_funcs = [self._firmware_repair,
+                            self._install_repair_with_powerwash,
+                            self._servo_repair_reinstall]
         else:
             repair_funcs = [self._reboot_repair,
                             self._servo_repair_power,
+                            self._firmware_repair,
                             self._powercycle_to_repair,
                             self._install_repair,
                             self._install_repair_with_powerwash,
-                            self._servo_repair_reinstall,
-                            self._firmware_repair]
+                            self._servo_repair_reinstall]
         errors = []
         board = self._get_board_from_afe()
         for repair_func in repair_funcs: