summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2020-08-13 10:37:28 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2020-08-13 10:37:28 +0000
commit6e2b3bb17fd24dcdbf8b2011a9668299a05dd9a1 (patch)
treed8291da2c24c39229259a2e4fb8359e2641b3b9f /sys
parent302d9630bda2ea8c7a00c3caccc8773396feb346 (diff)
qlw_xs_bus() must return 0 while bus 0 is being probed.
Found the hard way by martijn@ on his alpha.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/qlw.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/ic/qlw.c b/sys/dev/ic/qlw.c
index eacbe402c13..88f6ec51180 100644
--- a/sys/dev/ic/qlw.c
+++ b/sys/dev/ic/qlw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qlw.c,v 1.45 2020/07/24 12:43:31 krw Exp $ */
+/* $OpenBSD: qlw.c,v 1.46 2020/08/13 10:37:27 krw Exp $ */
/*
* Copyright (c) 2011 David Gwynne <dlg@openbsd.org>
@@ -131,7 +131,17 @@ void qlw_dump_iocb_segs(struct qlw_softc *, void *, int);
static inline int
qlw_xs_bus(struct qlw_softc *sc, struct scsi_xfer *xs)
{
- return ((xs->sc_link->bus == sc->sc_scsibus[0]) ? 0 : 1);
+ /*
+ * sc_scsibus[0] == NULL -> bus 0 probing during config_found().
+ * sc_scsibus[0] == xs->sc_link->bus -> bus 0 normal operation.
+ * sc_scsibus[1] == NULL -> bus 1 probing during config_found().
+ * sc_scsibus[1] == xs->sc_link->bus -> bus 1 normal operation.
+ */
+ if ((sc->sc_scsibus[0] == NULL) ||
+ (xs->sc_link->bus == sc->sc_scsibus[0]))
+ return 0;
+ else
+ return 1;
}
static inline u_int16_t