summaryrefslogtreecommitdiff
path: root/sys/dev/pci/qle.c
diff options
context:
space:
mode:
authorJonathan Matthew <jmatthew@cvs.openbsd.org>2018-07-30 07:30:55 +0000
committerJonathan Matthew <jmatthew@cvs.openbsd.org>2018-07-30 07:30:55 +0000
commit519929c8df71389c28e920643c7d05f253ea111c (patch)
tree5ee77db31661df4aa3177aba5aba612b630879b2 /sys/dev/pci/qle.c
parent74230e7ff996b932babfdcb15dd09ef719501c0d (diff)
extend the loop settle time to 200ms, and adjust the check so that we'll
actually break out once the loop has been up for that long.
Diffstat (limited to 'sys/dev/pci/qle.c')
-rw-r--r--sys/dev/pci/qle.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/dev/pci/qle.c b/sys/dev/pci/qle.c
index 46a561d8d47..c656164dc1b 100644
--- a/sys/dev/pci/qle.c
+++ b/sys/dev/pci/qle.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qle.c,v 1.43 2018/07/26 04:56:57 jmatthew Exp $ */
+/* $OpenBSD: qle.c,v 1.44 2018/07/30 07:30:54 jmatthew Exp $ */
/*
* Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org>
@@ -66,8 +66,8 @@ int qledebug = QLE_D_PORT;
#define QLE_DEFAULT_PORT_NAME 0x400000007F000003ULL /* from isp(4) */
-#define QLE_WAIT_FOR_LOOP 10
-#define QLE_LOOP_SETTLE 10
+#define QLE_WAIT_FOR_LOOP 10 /* seconds */
+#define QLE_LOOP_SETTLE 200 /* ms */
/* rounded up range of assignable handles */
#define QLE_MAX_TARGETS 2048
@@ -627,22 +627,22 @@ qle_attach(struct device *parent, struct device *self, void *aux)
task_set(&sc->sc_update_task, qle_do_update, sc);
/* wait a bit for link to come up so we can scan and attach devices */
- loop_up = 0;
- for (i = 0; i < QLE_WAIT_FOR_LOOP * 10000; i++) {
+ for (i = 0; i < QLE_WAIT_FOR_LOOP * 1000; i++) {
u_int16_t isr, info;
- delay(100);
+ if (sc->sc_loop_up) {
+ if (++loop_up == QLE_LOOP_SETTLE)
+ break;
+ } else
+ loop_up = 0;
+
+ delay(1000);
if (qle_read_isr(sc, &isr, &info) == 0)
continue;
qle_handle_intr(sc, isr, info);
- if (sc->sc_loop_up) {
- if (++loop_up == QLE_LOOP_SETTLE)
- break;
- } else
- loop_up = 0;
}
if (sc->sc_loop_up) {