It looks like we can get rid of the DELAY() hack in the firmware
loader for 8000 family devices.
I don't see any problems with this diff on my 8260 device.
I suppose the underlying problem was fixed in if_iwm.c r1.146.
Add some additional error checking while here.
OK?
Index: if_iwm.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_iwm.c,v
retrieving revision 1.181
diff -u -p -r1.181 if_iwm.c
--- if_iwm.c 8 May 2017 14:27:28 -0000 1.181
+++ if_iwm.c 17 May 2017 16:01:21 -0000
@@ -2963,11 +2963,11 @@ iwm_load_cpu_sections_8000(struct iwm_so
IWM_WRITE(sc, IWM_FH_UCODE_LOAD_STATUS, val);
sec_num = (sec_num << 1) | 0x1;
iwm_nic_unlock(sc);
-
- /*
- * The firmware won't load correctly without this delay.
- */
- DELAY(8000);
+ } else {
+ err = EBUSY;
+ printf("%s: could not load firmware chunk %d "
+ "(error %d)\n", DEVNAME(sc), i, err);
+ return err;
}
}
@@ -2979,6 +2979,11 @@ iwm_load_cpu_sections_8000(struct iwm_so
else
IWM_WRITE(sc, IWM_FH_UCODE_LOAD_STATUS, 0xFFFFFFFF);
iwm_nic_unlock(sc);
+ } else {
+ err = EBUSY;
+ printf("%s: could not finalize firmware loading (error %d)\n",
+ DEVNAME(sc), err);
+ return err;
}
return 0;