From ed3e57119ab18aaca46e5d67b6426299fa5d16b5 Mon Sep 17 00:00:00 2001 From: krw Date: Wed, 6 Apr 2022 13:23:58 +0000 Subject: [PATCH] Recognize LUN 0 device if SID_QUAL_LU_OFFLINE and T_NODEVICE are true. This enables the discovery and probing of other LUNs the target has to offer. Add uk* to amd64 RAMDISK_CD so such devices are configured. Allows bsd.rd as well as bsd[.mp] to boot on Oracle Cloud amd64 instances. Issue reported by Ryan Kavanagh and Scott Nicholas via bugs@. Original diff and much subsequent testing by Scott. Thanks! ok dlg@ jmatthew@ --- sys/arch/amd64/conf/RAMDISK_CD | 3 ++- sys/scsi/scsiconf.c | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/arch/amd64/conf/RAMDISK_CD b/sys/arch/amd64/conf/RAMDISK_CD index 187a707cb34..bf95a62aef9 100644 --- a/sys/arch/amd64/conf/RAMDISK_CD +++ b/sys/arch/amd64/conf/RAMDISK_CD @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISK_CD,v 1.199 2022/03/08 15:08:01 hastings Exp $ +# $OpenBSD: RAMDISK_CD,v 1.200 2022/04/06 13:23:58 krw Exp $ machine amd64 maxusers 4 @@ -190,6 +190,7 @@ scsibus* at scsi? sd* at scsibus? # SCSI disk drives st* at scsibus? # SCSI tape drives cd* at scsibus? # SCSI CD-ROM drives +uk* at scsibus? # Unknown SCSI devices pciide* at pci? flags 0x0000 wdc0 at isa? disable port 0x1f0 irq 14 flags 0x00 diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index 98a9b14d007..48648fc8ffa 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.c,v 1.251 2022/04/02 17:25:10 krw Exp $ */ +/* $OpenBSD: scsiconf.c,v 1.252 2022/04/06 13:23:58 krw Exp $ */ /* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */ /* @@ -598,17 +598,18 @@ scsi_probe_link(struct scsibus_softc *sb, int target, int lun, int dumbscan) switch (inqbuf->device & SID_QUAL) { case SID_QUAL_RSVD: case SID_QUAL_BAD_LU: + goto bad; case SID_QUAL_LU_OFFLINE: + if (lun == 0 && (inqbuf->device & SID_TYPE) == T_NODEVICE) + break; goto bad; case SID_QUAL_LU_OK: - break; default: + if ((inqbuf->device & SID_TYPE) == T_NODEVICE) + goto bad; break; } - if ((inqbuf->device & SID_TYPE) == T_NODEVICE) - goto bad; - scsi_devid(link); link0 = scsi_get_link(sb, target, 0); -- 2.20.1