kern/61746: System locks up on boot if both apic option and sio device are enabled in the kernel

Pablo L. R. Santos & Mario Sergio Fujikawa Ferreira infax01 at hotmail.com
Thu Jan 22 11:43:01 PST 2004


>Number:         61746
>Category:       kern
>Synopsis:       System locks up on boot if both apic option and sio device are enabled in the kernel
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 22 11:40:05 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Pablo L. R. Santos & Mario Sergio Fujikawa Ferreira
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
FreeBSD regulus.linf.cic.unb.br 4.9-STABLE FreeBSD 4.9-STABLE #6: Thu Jan  8 08:35:19 BRST 2004     root at regulus.linf.cic.unb.br:/usr/src/sys/compile/REGULUS  i386 Running on an IBM xSeries 235 with 2 Xeon 2.9Ghz processors, LSI Logic 1030 SCSI Controller. Further details and the dmesg output are given below.      
>Description:
	System would lockup on boot and not even install unless
we used "safe mode" option on beastie menu. We were trying the
5.2-RELEASE cd set. After reading both the -CURRENT lists and the
5.2-RELEASE ERRATA (and due to "safe mode" working), we assumed our
trouble could be related to either apic or ACPI. Therefore, we
disabled both when we compiled our first kernel. This was not
satisfatory since disabling apic means no smp.

	I then compiled a stripped down kernel with the bare bones
required for running this system and enabled apic: no lockup.  I
was intrigued. It could be either a "false" positive (no problem
ONLY this time) or that an specific device giving trouble was
removed. I was considering the 2nd option several boots with no
problems later.

	We began with a GENERIC kernel and then disabled a device
at a time PER boot trying to pin point the said device. Several
hours later: we found the culprit. If both apic option and sio
device were enabled, the system would lockup at boot time right
after the SCSI 15 seconds delay.

	We had no ACPI yet but we got smp back. We then proceeded
to CVSup update the system to latest -CURRENT (2003-01-21). Same
behavior: locks up with apic+sio, does not lockup with apic without sio.

	Enabling ACPI only meant a lockup during boot so we
assumed it would not be used this time.

	Later, we needed to hardwire the device identification
for our SCSI drives. We wanted the 0:0:0 device to be da0, 0:1:0
to be da1 and so on. We wrote a kernel hints file for that.
Compiled kernel, installed it, rebooted the system. Worked like
a charm.

	For some reason, we enabled ACPI on one of the reboots.
Now, it worked. ;) We worked but ACPI was not working
"right". The system would not lockup but the power down button
would not power down the machine. If you pressed power down,
nothing would happend but ctrl-alt-del would power down the box.
Weird, huh? If you pressed ctrl-alt-del without previously trying
the power down button, the machine would reboot normally.

	Well, we decided to reinstall the system and try reproducing
our results with a fresh 5.2-RELEASE. Well, we reproduced them
exactly:

	1) apic would mean a system lockup
	2) apic would work after we disabled the sio device
	3) ACPI would work after we hardwired the SCSI disks
	4) power down button would "work" as aforementioned
	5) same symptons after CVSup update to -CURRENT

	We are supplying some system information below. Please,
ask if you need more. We are new to 5.x branch and we are
not aware of possible side effects of using a hints file. Therefore,
do not refrain yourselves from enlighten us even about the most basic
things.

	Finally we detected a last bug, possibly related to the
aforementioned problems; during system initialization, typing any
key before the keyboard is set up [1] causes a reboot when that stage is reached.

ps: For those of you having problems with scsi disks starting slow at
3.300 MB/s on mpt controllers, issuing a "camcontrol reset 0" will
make all of the disks go to their correct top speed.

	Regards,

[1] For the purpose of this PR, we consider the point at which keyboard is set up to be the moment the system presents the following lines at the console:
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0

--------------- /var/run/dmesg.boot -------------

Copyright (c) 1992-2004 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD 5.2-CURRENT #7: Wed Jan 21 16:32:33 GMT 2004
    root at rhea.linf.cic.unb.br:/usr/src/sys/i386/compile/RHEA
Preloaded elf kernel "/boot/kernel/kernel" at 0xc0716000.
Preloaded elf module "/boot/kernel/acpi.ko" at 0xc07161f4.
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Xeon(TM) CPU 2.80GHz (2793.90-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0xf27  Stepping = 7
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Hyperthreading: 2 logical CPUs
real memory  = 2147385344 (2047 MB)
avail memory = 2100158464 (2002 MB)
ACPI APIC Table: <IBM    SERONYXP>
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
 cpu2 (AP): APIC ID:  6
 cpu3 (AP): APIC ID:  7
ioapic2 <Version 1.1> irqs 32-47 on motherboard
ioapic1 <Version 1.1> irqs 16-31 on motherboard
ioapic0 <Version 1.1> irqs 0-15 on motherboard
Pentium Pro MTRR support enabled
npx0: [FAST]
npx0: <math processor> on motherboard
npx0: INT 16 interface
acpi0: <IBM SERONYXP> on motherboard
pcibios: BIOS version 2.10
acpi0: Power Button (fixed)
Timecounter "ACPI-safe" frequency 3579545 Hz quality 1000
acpi_timer0: <32-bit timer at 3.579545MHz> port 0x488-0x48b on acpi0
acpi_cpu0: <CPU> on acpi0
acpi_cpu1: <CPU> on acpi0
acpi_cpu2: <CPU> on acpi0
acpi_cpu3: <CPU> on acpi0
pcib0: <ACPI Host-PCI bridge> on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib0: slot 15 INTA is routed to irq 3
pci0: <display, VGA> at device 9.0 (no driver attached)
atapci0: <ServerWorks CSB5 UDMA100 controller> port 0x700-0x70f,0x374-0x377,0x170-0x177,0x3f4-0x3f7,0x1f0-0x1f7 at device 15.1 on pci0
ata0: at 0x1f0 irq 14 on atapci0
ata0: [MPSAFE]
ata1: simplex device, DMA on primary only
ata1: at 0x170 irq 15 on atapci0
ata1: [MPSAFE]
pci0: <serial bus, USB> at device 15.2 (no driver attached)
isab0: <PCI-ISA bridge> at device 15.3 on pci0
isa0: <ISA bus> on isab0
pcib1: <ACPI Host-PCI bridge> on acpi0
pci2: <ACPI PCI bus> on pcib1
bge0: <Broadcom BCM5703 Gigabit Ethernet, ASIC rev. 0x1002> mem 0xfbff0000-0xfbffffff irq 29 at device 8.0 on pci2
bge0: Ethernet address: 00:09:6b:a5:75:6a
miibus0: <MII bus> on bge0
brgphy0: <BCM5703 10/100/1000baseTX PHY> on miibus0
brgphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX, 1000baseTX-FDX, auto
pcib2: <ACPI Host-PCI bridge> on acpi0
pci5: <ACPI PCI bus> on pcib2
mpt0: <LSILogic 1030 Ultra4 Adapter> port 0x2300-0x23ff mem 0xf9fe0000-0xf9feffff,0xf9ff0000-0xf9ffffff irq 27 at device 7.0 on pci5
mpt1: <LSILogic 1030 Ultra4 Adapter> port 0x2400-0x24ff mem 0xf9fc0000-0xf9fcffff,0xf9fd0000-0xf9fdffff irq 28 at device 7.1 on pci5
pcib3: <ACPI Host-PCI bridge> on acpi0
pci7: <ACPI PCI bus> on pcib3
pcib4: <ACPI Host-PCI bridge> on acpi0
pci9: <ACPI PCI bus> on pcib4
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
atkbd: unable to set the command byte.
kbd0 at atkbd0
psm0: unable to set the command byte.
fdc0: <Enhanced floppy controller (i82077, NE72065 or clone)> port 0x3f7,0x3f0-0x3f5 irq 6 drq 2 on acpi0
pmtimer0 on isa0
orm0: <Option ROMs> at iomem 0xc9800-0xcd7ff,0xc8000-0xc97ff,0xc0000-0xc7fff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
Timecounters tick every 10.000 msec
acd0: CDROM <SAMSUNG CD-ROM SC-148C> at ata0-master PIO4
Waiting 15 seconds for SCSI devices to settle
GEOM: create disk da0 dp=0xc7388050
GEOM: create disk da1 dp=0xc7138050
GEOM: create disk da2 dp=0xc7380450
GEOM: create disk da3 dp=0xc7375850
GEOM: create disk da4 dp=0xc7371c50
GEOM: create disk da5 dp=0xc7372050
sa0 at mpt1 bus 0 target 0 lun 0
sa0: <SONY SDT-10000 0200> Removable Sequential Access SCSI-2 device 
sa0: 40.000MB/s transfers (20.000MHz, offset 15, 16bit)
ses0 at mpt0 bus 0 target 8 lun 0
ses0: <IBM 02R0962a S320  1 1> Fixed Processor SCSI-2 device 
ses0: 3.300MB/s transfers
ses0: SAF-TE Compliant Device
da0 at mpt0 bus 0 target 0 lun 0
da0: <IBM-ESXS MAP3735NC     FN B109> Fixed Direct Access SCSI-3 device
da0: 320.000MB/s transfers (160.000MHz, offset 127, 16bit), Tagged Queueing Enabled
da0: 70006MB (143374000 512 byte sectors: 255H 63S/T 8924C)
da1 at mpt0 bus 0 target 1 lun 0
da1: <IBM-ESXS MAP3735NC     FN B109> Fixed Direct Access SCSI-3 device
da1: 320.000MB/s transfers (160.000MHz, offset 127, 16bit), Tagged Queueing Enabled
da1: 70006MB (143374000 512 byte sectors: 255H 63S/T 8924C)
da2 at mpt0 bus 0 target 2 lun 0
da2: <IBM-ESXS MAP3735NC     FN B109> Fixed Direct Access SCSI-3 device 
da2: 320.000MB/s transfers (160.000MHz, offset 127, 16bit), Tagged Queueing Enabled
da2: 70006MB (143374000 512 byte sectors: 255H 63S/T 8924C)
da3 at mpt0 bus 0 target 3 lun 0
da3: <IBM-ESXS MAP3735NC     FN B109> Fixed Direct Access SCSI-3 device 
da3: 320.000MB/s transfers (160.000MHz, offset 127, 16bit), Tagged Queueing Enabled
da3: 70006MB (143374000 512 byte sectors: 255H 63S/T 8924C)
da4 at mpt0 bus 0 target 4 lun 0
da4: <IBM-ESXS MAP3735NC     FN B109> Fixed Direct Access SCSI-3 device 
da4: 3.300MB/s transfers, Tagged Queueing Enabled
da4: 70006MB (143374000 512 byte sectors: 255H 63S/T 8924C)
da5 at mpt0 bus 0 target 5 lun 0
da5: <IBM-ESXS MAP3735NC     FN B109> Fixed Direct Access SCSI-3 device
da5: 3.300MB/s transfers, Tagged Queueing Enabled
da5: 70006MB (143374000 512 byte sectors: 255H 63S/T 8924C)
SMP: AP CPU #2 Launched!
SMP: AP CPU #1 Launched!
SMP: AP CPU #3 Launched!
Mounting root from ufs:/dev/da0s1a

--------------- /var/run/dmesg.boot -------------

--------------- # uname -a -------------

FreeBSD rhea.linf.cic.unb.br 5.2-CURRENT FreeBSD 5.2-CURRENT #7: Wed Jan 21 16:32:33 GMT 2004     root at rhea.linf.cic.unb.br:/usr/src/sys/i386/compile/RHEA  i386

--------------- # uname -a -------------

--------------- /sys/i386/conf/RHEA -------------

#
# GENERIC -- Generic kernel configuration file for FreeBSD/i386
#
# For more information on this file, please read the handbook section on
# Kernel Configuration Files:
#
#    http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
#
# The handbook is also available locally in /usr/share/doc/handbook
# if you've installed the doc distribution, otherwise always see the
# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
# latest information.
#
# An exhaustive list of options and more detailed explanations of the
# device lines is also present in the ../../conf/NOTES and NOTES files. 
# If you are in doubt as to the purpose or necessity of a line, check first 
# in NOTES.
#
# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.394.2.2 2003/12/07 23:52:53 scottl Exp $

machine		i386
cpu		I686_CPU
ident		RHEA

#To statically compile in device wiring instead of /boot/device.hints
#hints		"GENERIC.hints"		#Default places to look for devices.

#makeoptions	DEBUG=-g		#Build kernel with gdb(1) debug symbols

options 	SCHED_4BSD		#4BSD scheduler
options 	INET			#InterNETworking
options 	FFS			#Berkeley Fast Filesystem
options 	SOFTUPDATES		#Enable FFS soft updates support
options 	UFS_ACL			#Support for access control lists
options 	UFS_DIRHASH		#Improve performance on big directories
options 	PROCFS			#Process filesystem (requires PSEUDOFS)
options 	PSEUDOFS		#Pseudo-filesystem framework
options 	COMPAT_43		#Compatible with BSD 4.3 [KEEP THIS!]
options 	COMPAT_FREEBSD4		#Compatible with FreeBSD4
options 	SCSI_DELAY=15000	#Delay (in ms) before probing SCSI
#options 	KTRACE			#ktrace(1) support
options 	SYSVSHM			#SYSV-style shared memory
options 	SYSVMSG			#SYSV-style message queues
options 	SYSVSEM			#SYSV-style semaphores
options 	_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev

# Debugging for use in -current
#options 	DDB			#Enable the kernel debugger
#options 	INVARIANTS		#Enable calls of extra sanity checking
#options 	INVARIANT_SUPPORT	#Extra sanity checks of internal structures, required by INVARIANTS
#options 	WITNESS			#Enable checks to detect deadlocks and cycles
#options 	WITNESS_SKIPSPIN	#Don't run witness on spinlocks for speed

###
## ADDON AREA - BEGIN
###
hints		"RHEA.hints"		#Default places to look for devices.
###
## ADDON AREA - END
###

# To make an SMP kernel, the next two are needed
options 	SMP			# Symmetric MultiProcessor Kernel
device		apic			# I/O APIC

device		isa
device		pci

# Floppy drives
device		fdc

# ATA and ATAPI devices
device		ata
device		atapicd			# ATAPI CDROM drives
options 	ATA_STATIC_ID		#Static device numbering

# SCSI controllers
device		mpt		# LSI-Logic MPT-Fusion

# SCSI peripherals
device		scbus		# SCSI bus (required for SCSI)
device		da		# Direct Access (disks)
device		sa		# Sequential Access (tape etc)
device		pass		# Passthrough device (direct SCSI access)
device		ses		# SCSI Environmental Services (and SAF-TE)

# atkbdc0 controls both the keyboard and the PS/2 mouse
device		atkbdc		# AT keyboard controller
device		atkbd		# AT keyboard
device		psm		# PS/2 mouse

device		vga		# VGA video card driver

device		splash		# Splash screen and screen saver support

# syscons is the default console driver, resembling an SCO console
device		sc

# Floating point support - do not disable.
device		npx

# Power management support (see NOTES for more options)
#device		apm
# Add suspend/resume support for the i8254.
device		pmtimer

# Serial (COM) ports
#device		sio		# 8250, 16[45]50 based serial ports

# PCI Ethernet NICs that use the common MII bus controller code.
# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs!
device		miibus		# MII bus support
device		bge		# Broadcom BCM570xx Gigabit Ethernet

# Pseudo devices - the number indicates how many units to allocate.
device		random		# Entropy device
device		loop		# Network loopback
device		ether		# Ethernet support
device		pty		# Pseudo-ttys (telnet etc)

# The `bpf' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
device		bpf		# Berkeley packet filter

--------------- /sys/i386/conf/RHEA -------------

--------------- /sys/i386/conf/RHEA.hints -------------

# $FreeBSD: src/sys/i386/conf/GENERIC.hints,v 1.11 2002/12/05 22:49:47 jhb Exp $
##
# SCSI board wiring
##
hint.scbus.0.at="mpt0"
##
# SCSI disk wiring
##
hint.da.0.at="scbus0"
hint.da.0.target="0"
hint.da.0.unit="0"
#
hint.da.1.at="scbus0"
hint.da.1.target="1"
hint.da.1.unit="0"
#
hint.da.2.at="scbus0"
hint.da.2.target="2"
hint.da.2.unit="0"
#
hint.da.3.at="scbus0"
hint.da.3.target="3"
hint.da.3.unit="0"
#
hint.da.4.at="scbus0"
hint.da.4.target="4"
hint.da.4.unit="0"
#
hint.da.5.at="scbus0"
hint.da.5.target="5"
hint.da.5.unit="0"
#
hint.sc.0.at="isa"
hint.sc.0.flags="0x100"

--------------- /sys/i386/conf/RHEA.hints -------------      
>How-To-Repeat:
	This occurs automatically on this hardware unless "Safe Mode" is selected at the beastie menu. Also occurs on custom kernel unless either device sio or option apic is disabled.
>Fix:
      It seems that hard-wiring SCSI disks will allow for both device sio and option apic to be compiled into the kernel. This is at best a work-around and the reasons this action works are not well understood.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list