NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
port-mvme68k/56991: mvme68k systems fail to mount root from SCSI targets other than zero
>Number: 56991
>Category: port-mvme68k
>Synopsis: mvme68k systems fail to mount root from SCSI targets other than zero
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: port-mvme68k-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Sep 03 03:55:01 +0000 2022
>Originator: Mike
>Release: netbsd-9-3-RELEASE
>Organization:
>Environment:
NetBSD netbsd_mvme68k 9.3 NetBSD 9.3 (GENERIC) #2: Thu Sep 1 19:17:13 PDT 2022 anon@netbsd_amd64:/home/anon/obj/sys/arch/mvme68k/compile/GENERIC mvme68
>Description:
The MVME ROM passes a "devlun" argument to bootloader, containing the SCSI target ID and LUN of the disk being booted from. This is subsequently passed to the kernel where it is recovered in locore, and then used in autoconf.c:device_register() to determine whether a device is the boot disk.
The passed-in value encodes the target ID and LUN in the low byte; high 4 bits containing the target ID, low 4 bits the LUN. Unfortunately, device_register() compares the passed-in value directly with a candidate 'sd' device's target ID. This works when the passed-in value is zero (target/LUN zero), but for any other value the comparison fails and the kernel falls back to prompting for the root device.
>How-To-Repeat:
Boot an MVME board from a SCSI disk with a target ID != 0.
>Fix:
Index: sys/arch/mvme68k/include/autoconf.h
===================================================================
RCS file: /cvsroot/src/sys/arch/mvme68k/include/autoconf.h,v
retrieving revision 1.8
diff -u -r1.8 autoconf.h
--- sys/arch/mvme68k/include/autoconf.h 1 Feb 2011 20:19:31 -0000 1.8
+++ sys/arch/mvme68k/include/autoconf.h 3 Sep 2022 03:47:16 -0000
@@ -37,4 +37,7 @@
extern int bootdevlun; /* dev_lun of boot device */
extern int bootpart; /* boot partition (disk) */
+#define MVME_BOOTDEV(_devlun) ((_devlun) >> 4)
+#define MVME_BOOTLUN(_devlun) ((_devlun) & 0xf)
+
#endif /* _MVME68K_AUTOCONF_H */
cvs diff: Diffing sys/arch/mvme68k/mvme68k
Index: sys/arch/mvme68k/mvme68k/autoconf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mvme68k/mvme68k/autoconf.c,v
retrieving revision 1.47
diff -u -r1.47 autoconf.c
--- sys/arch/mvme68k/mvme68k/autoconf.c 27 Oct 2012 17:18:04 -0000 1.47
+++ sys/arch/mvme68k/mvme68k/autoconf.c 3 Sep 2022 03:47:16 -0000
@@ -190,8 +190,10 @@
struct scsipibus_attach_args *sa = aux;
if (device_parent(parent) != controller ||
- bootdevlun != sa->sa_periph->periph_target)
+ MVME_BOOTDEV(bootdevlun) != sa->sa_periph->periph_target ||
+ MVME_BOOTLUN(bootdevlun) != sa->sa_periph->periph_lun) {
return;
+ }
booted_device = dev;
foundboot = 1;
Home |
Main Index |
Thread Index |
Old Index