summaryrefslogtreecommitdiff
path: root/sys/dev/pci/ahc_pci.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-02-12 15:32:13 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-02-12 15:32:13 +0000
commit81bbc9304d93413707cb1c9b3f51aeb66eac779d (patch)
tree6dd11247b8211a04ecfd71acbed8c127f10077e5 /sys/dev/pci/ahc_pci.c
parentb54281255af4dd53234adc42eea75912558ce476 (diff)
Fix crashes during probe by ensuring that SCSI_IS_SCSIBUS_B() returns
false until scsi bus b is initialized. Set TWIN_CHNLB bit that is used elsewhere. Missed chunk from last code sync. Problem found and fixes tested on HP Proliant ML310 by Valov Oleg.
Diffstat (limited to 'sys/dev/pci/ahc_pci.c')
-rw-r--r--sys/dev/pci/ahc_pci.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/pci/ahc_pci.c b/sys/dev/pci/ahc_pci.c
index 28d20bd9e14..451b36813fa 100644
--- a/sys/dev/pci/ahc_pci.c
+++ b/sys/dev/pci/ahc_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ahc_pci.c,v 1.45 2004/08/13 23:38:54 krw Exp $ */
+/* $OpenBSD: ahc_pci.c,v 1.46 2005/02/12 15:32:11 krw Exp $ */
/*
* Product specific probe and attach routines for:
* 3940, 2940, aic7895, aic7890, aic7880,
@@ -40,7 +40,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: ahc_pci.c,v 1.45 2004/08/13 23:38:54 krw Exp $
+ * $Id: ahc_pci.c,v 1.46 2005/02/12 15:32:11 krw Exp $
*
* //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#57 $
*
@@ -740,6 +740,12 @@ ahc_pci_attach(parent, self, aux)
for (i = 0; i < AHC_NUM_TARGETS; i++)
TAILQ_INIT(&ahc->untagged_queues[i]);
+ /*
+ * SCSI_IS_SCSIBUS_B() must returns false until sc_channel_b
+ * has been properly initialized. XXX Breaks if >254 scsi buses.
+ */
+ ahc->sc_channel_b.scsibus = 0xff;
+
ahc->dev_softc = pa;
ahc_set_name(ahc, ahc->sc_dev.dv_xname);