From 81bbc9304d93413707cb1c9b3f51aeb66eac779d Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Sat, 12 Feb 2005 15:32:13 +0000 Subject: 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. --- sys/dev/pci/ahc_pci.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sys/dev/pci/ahc_pci.c') 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); -- cgit v1.2.3