summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2017-05-26 18:40:06 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2017-05-26 18:40:06 +0000
commit591261c78561825b9348201a64d4c7a2ebaa09af (patch)
tree23090d64a136b3b3ddfdf1ffa17a5abd0373bb67 /sys/dev
parent7fe1370923e547ed228b6ad68d6d1620d0d4b78a (diff)
Get rid of the DELAY() hack in the firmware loader for 8000 family
iwm(4) devices. I don't see any problems without this hack. I suppose the underlying problem was fixed in if_iwm.c r1.146. Add some additional error checking while here. Tested by me on 8260 and by claudio@ on 8265. ok claudio@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_iwm.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c
index d3231b88361..dd6479945f2 100644
--- a/sys/dev/pci/if_iwm.c
+++ b/sys/dev/pci/if_iwm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwm.c,v 1.181 2017/05/08 14:27:28 stsp Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.182 2017/05/26 18:40:05 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -2963,11 +2963,11 @@ iwm_load_cpu_sections_8000(struct iwm_softc *sc, struct iwm_fw_sects *fws,
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_softc *sc, struct iwm_fw_sects *fws,
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;