NetBSD Problem Report #25829

Received: (qmail 8003 invoked by uid 605); 5 Jun 2004 18:13:10 -0000
Message-Id: <200406051813.i55ID0Yi001631@netbsd0.msu.montana.edu>
Date: Sat, 5 Jun 2004 12:13:00 -0600 (MDT)
From: mhitch@NetBSD.org
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: mhitch@NetBSD.org
To: gnats-bugs@gnats.netbsd.org
Subject: Mylex (DAC960) raid drives not recognized as boot devices
X-Send-Pr-Version: 3.95

>Number:         25829
>Category:       port-alpha
>Synopsis:       Logical drives on Mylex (DAC960) raid controller not found as boot device
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    mhitch
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 05 18:14:00 +0000 2004
>Closed-Date:    Wed Sep 16 20:34:55 +0000 2009
>Last-Modified:  Sat Sep 26 18:45:01 +0000 2009
>Originator:     Michael L. Hitch
>Release:        NetBSD 2.0E, NetBSD 2.0_BETA, and earlier
>Organization:

>Environment:


System: NetBSD 2.0_BETA (GENERIC.MP) #3: Fri Jun  4 11:07:29 MDT 2004
        mhitch@neverland.msu.montana.edu:/usr/home/mhitch/NetBSD-2-0/OBJ/alpha/sys/arch/al
	pha/compile.alpha/GENERIC.MP
Architecture: alpha
Machine: alpha
>Description:
	The Mylex (DAC960) raid controller card is a common raid controller
	provided by Digital/Compaq/HP on many alpha systems.  There is no
	support for detecting a raid boot device in the alpha port where the
	SRM identifies the boot device as using the "RAID" protocol (as
	opposed to "SCSI" or "IDE").
>How-To-Repeat:
	Install NetBSD on a logical raid drive and boot from that drive.  The
	kernel will complain about not being able to find a device matching
	the boot string provided by SRM.

NetBSD 2.0_BETA (GENERIC.MP) #3: Fri Jun  4 11:07:29 MDT 2004
	mhitch@neverland.msu.montana.edu:/usr/home/mhitch/NetBSD-2-0/OBJ/alpha/sys/arch/alpha/compile.alpha/GENERIC.MP
AlphaServer 4X00 5/466 4MB, 467MHz, s/n GA12000000
8192 byte page size, 2 processors.
total memory = 512 MB
(2064 KB reserved for PROM, 509 MB used by NetBSD)
avail memory = 493 MB
...
mlx0 at pci1 dev 3 function 0: Mylex RAID (v2 interface)
mlx0: interrupting at kn300 irq 12
mlx0: DAC960P/PD, 1 channel, firmware 2.42-0-00, 4MB RAM
ld0 at mlx0 unit 0: JBOD, online
ld0: 8678 MB, 4407 cyl, 64 head, 63 sec, 512 bytes/sect x 17772544 sectors
mlx1 at pci1 dev 4 function 0: Mylex RAID (v2 interface)
mlx1: interrupting at kn300 irq 16
mlx1: DAC960P/PD, 1 channel, firmware 2.42-0-00, 4MB RAM
ld1 at mlx1 unit 0: RAID0, online
ld1: 31997 MB, 8126 cyl, 128 head, 63 sec, 512 bytes/sect x 65529856 sectors
ld2 at mlx1 unit 1: RAID0, online
ld2: 28749 MB, 7301 cyl, 128 head, 63 sec, 512 bytes/sect x 58877952 sectors
...
scsibus0: waiting 2 seconds for devices to settle...
cd0 at scsibus0 target 5 lun 0: <DEC, RRD45   (C) DEC, 0436> cdrom removable
cd0: async, 8-bit transfers
WARNING: can't figure what device matches "RAID 0 3 0 0 0 6000 11069"
root device: ld0a
dump device (default ld0b): 
file system (default generic): ffs
root on ld0a dumps on ld0b
>Fix:
	Add code to recognize the "RAID" type in the SRM boot information,
	and to match against logical drives ("ld").

	Duplicating the matching code for "SCSI" and matching "ld" devices
	would be one way.  This would duplicate quite a bit of code though.
	Since a raid logical drive is treated essentially the same as a
	SCSI drive, it can easily be combined with the SCSI matching code.
	The major difference is that a SCSI drive is attached to a scsibus
	which is attached to the PCI HBA, while a raid logical drive is
	attached directly to the PCI raid controller.

	I seem to recall that there are also EISA controllers as well, but
	I could be mistaken.  I'm also not sure of which alpha models support
	the Mylex raid controller, so I don't know all the model-specific
	files that need to be changed.

	An example on an AlphaServer 4x00 would be as follows:

Index: dec_kn300.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/alpha/dec_kn300.c,v
retrieving revision 1.28
diff -u -b -r1.28 dec_kn300.c
--- dec_kn300.c	14 Jun 2003 17:01:08 -0000	1.28
+++ dec_kn300.c	5 Jun 2004 17:32:40 -0000
@@ -233,7 +233,8 @@
 		return;

 	if (!initted) {
-		scsiboot = (strcmp(b->protocol, "SCSI") == 0);
+		scsiboot = (strcmp(b->protocol, "SCSI") == 0) |
+		    (strcmp(b->protocol, "RAID") == 0);
 		netboot = (strcmp(b->protocol, "BOOTP") == 0) ||
 		    (strcmp(b->protocol, "MOP") == 0);
 #ifdef BDEBUG
@@ -319,6 +320,22 @@
 		found = 1;
 	}

+	if (scsiboot && !strcmp(name, "ld")) {
+		struct scsipibus_attach_args *sa = aux;
+
+		if (parent != scsidev)
+			return;
+
+		if (b->unit / 100 != sa->sa_periph->periph_target)
+			return;
+
+		/* XXX LUN! */
+
+		/* we've found it! */
+		booted_device = dev;
+		found = 1;
+	}
+
 	if (netboot) {
 		if (parent != pcidev)
 			return;

That can be done in an alternate way that doesn't duplicate as much code
by combining the drive attachment check:


Index: dec_kn300.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/alpha/dec_kn300.c,v
retrieving revision 1.23
diff -u -b -r1.23 dec_kn300.c
--- dec_kn300.c	20 Aug 2001 12:20:04 -0000	1.23
+++ dec_kn300.c	5 Jun 2004 17:29:30 -0000
@@ -232,7 +232,8 @@
 		return;

 	if (!initted) {
-		scsiboot = (strcmp(b->protocol, "SCSI") == 0);
+		scsiboot = (strcmp(b->protocol, "SCSI") == 0) |
+		    (strcmp(b->protocol, "RAID") == 0);
 		netboot = (strcmp(b->protocol, "BOOTP") == 0) ||
 		    (strcmp(b->protocol, "MOP") == 0);
 #ifdef BDEBUG
@@ -289,11 +290,13 @@

 	if (scsiboot &&
 	    (!strcmp(cd->cd_name, "sd") ||
+	     !strcmp(cd->cd_name, "ld") ||
 	     !strcmp(cd->cd_name, "st") ||
 	     !strcmp(cd->cd_name, "cd"))) {
 		struct scsipibus_attach_args *sa = aux;

-		if (parent->dv_parent != scsidev)
+		if (parent->dv_parent != scsidev &&
+		    parent != scsidev)		/* XXX ld device -> mlx */
 			return;

 		if (b->unit / 100 != sa->sa_periph->periph_target)
@@ -306,6 +309,7 @@
 		 * XXX: Only support SD booting for now.
 		 */
 		if (strcmp(cd->cd_name, "sd") &&
+		    strcmp(cd->cd_name, "ld") &&
 		    strcmp(cd->cd_name, "cd") &&
 		    strcmp(cd->cd_name, "st"))
 			return;
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: port-alpha-maintainer->mycroft 
Responsible-Changed-By: mycroft 
Responsible-Changed-When: Mon Jun 28 03:16:23 UTC 2004 
Responsible-Changed-Why:  
. 
Responsible-Changed-From-To: mycroft->port-alpha-maintainer
Responsible-Changed-By: wiz@netbsd.org
Responsible-Changed-When: Sun, 03 Sep 2006 01:18:31 +0000
Responsible-Changed-Why:
Back to role account, mycroft doesn't have commit access any longer.


Responsible-Changed-From-To: port-alpha-maintainer->mhitch
Responsible-Changed-By: mhitch@netbsd.org
Responsible-Changed-When: Mon, 29 Jan 2007 18:37:03 +0000
Responsible-Changed-Why:
I may as well take this one as well.


From: "Michael L. Hitch" <mhitch@NetBSD.org>
To: gnats-bugs@gnats.netbsd.org
Cc: 
Subject: Re: port-alpha/25829: Mylex (DAC960) raid drives not recognized as
 boot devices
Date: Fri, 23 Jan 2009 16:06:23 -0700 (MST)

    The patch I had originally suggested was quite wrong.  The ld unit 
 numbers are in an attach_args structure that differs significantly between 
 raid adapter drivers.  I found this out on an ES40 with a Mylex adapter 
 when I tried to use a drive other than ld0.  I've now adapted my patch 
 for several different alpha models that I have available, and also have 
 the dec_6600 supporting the integrated I2O adapter in the ES40 and ES45.
 These changes will be committed soon, after I at least verified the latest 
 changes on a 2100 I currently am testing on.


 --
 Michael L. Hitch			mhitch@NetBSD.org

From: "Michael L. Hitch" <mhitch@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/25829 CVS commit: src/sys/arch/alpha/alpha
Date: Mon, 14 Sep 2009 02:46:29 +0000

 Module Name:	src
 Committed By:	mhitch
 Date:		Mon Sep 14 02:46:29 UTC 2009

 Modified Files:
 	src/sys/arch/alpha/alpha: dec_1000a.c dec_2100_a500.c dec_6600.c
 	    dec_kn300.c

 Log Message:
 Add support for booting off a couple of common RAID adapters found on
 several models of alpha systems: mlx [Mylex DAC060] and iop [I2O].
 Addresses PR #25829.


 To generate a diff of this commit:
 cvs rdiff -u -r1.28 -r1.29 src/sys/arch/alpha/alpha/dec_1000a.c \
     src/sys/arch/alpha/alpha/dec_6600.c
 cvs rdiff -u -r1.18 -r1.19 src/sys/arch/alpha/alpha/dec_2100_a500.c
 cvs rdiff -u -r1.36 -r1.37 src/sys/arch/alpha/alpha/dec_kn300.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: mhitch@NetBSD.org
State-Changed-When: Wed, 16 Sep 2009 20:34:55 +0000
State-Changed-Why:
Fixes committed and pulled up to the netbsd-5 branches that work on several
different hardware models I've been able to test on over the years.


From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/25829 CVS commit: [netbsd-5] src/sys/arch/alpha/alpha
Date: Sat, 26 Sep 2009 18:41:42 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Sat Sep 26 18:41:42 UTC 2009

 Modified Files:
 	src/sys/arch/alpha/alpha [netbsd-5]: dec_1000a.c dec_2100_a500.c
 	    dec_6600.c dec_kn300.c

 Log Message:
 Pull up following revision(s) (requested by mhitch in ticket #1010):
 	sys/arch/alpha/alpha/dec_1000a.c: revision 1.29
 	sys/arch/alpha/alpha/dec_2100_a500.c: revision 1.19
 	sys/arch/alpha/alpha/dec_6600.c: revision 1.29
 	sys/arch/alpha/alpha/dec_kn300.c: revision 1.37
 Add support for booting off a couple of common RAID adapters found on
 several models of alpha systems: mlx [Mylex DAC060] and iop [I2O].
 Addresses PR #25829.


 To generate a diff of this commit:
 cvs rdiff -u -r1.26 -r1.26.10.1 src/sys/arch/alpha/alpha/dec_1000a.c
 cvs rdiff -u -r1.18 -r1.18.10.1 src/sys/arch/alpha/alpha/dec_2100_a500.c
 cvs rdiff -u -r1.26 -r1.26.54.1 src/sys/arch/alpha/alpha/dec_6600.c
 cvs rdiff -u -r1.34 -r1.34.54.1 src/sys/arch/alpha/alpha/dec_kn300.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.