kern/170501: modular kernel fails to reattach usb-mass storage and shutdown of usb controller

David Naylor naylor.b.david at
Thu Aug 9 12:10:04 UTC 2012

>Number:         170501
>Category:       kern
>Synopsis:       modular kernel fails to reattach usb-mass storage and shutdown of usb controller
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 09 12:10:03 UTC 2012
>Originator:     David Naylor
>Release:        FreeBSD 9.1
FreeBSD dragon.dg 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #1: Wed Aug  8 11:26:29 SAST 2012     root at dragon.dg:/tmp/home/freebsd9/src/sys/MODULAR  amd64
When using a kernel with minimal compiled in modules (i.e. only the bare minimum) and loading cam(4) and usb(4) during the boot time then:

If a usb-mass storage device (da0) is inserted:
 - on shutdown (`shutdown -p now`) the usb controllers fail to shutdown and the computer is not powered off
 - if the usb-device is removed the kernel spams the console with:
xptioctl: pass driver is not in the kernel
xptioctl: put "device pass" in your kernel config file
    even though cam(4) is still loaded by the kernel and the pass device was locatable on first connection
 - thereafter no usb-mass storage devices are recognised by the computer
Compile computer with attached kernel config, load the appropriate drivers from loader.conf and rc.conf:
<file name="loader.conf">
<file name=rc.conf">
kld_list="random pty firmware agp ehci xhci usb"

the insert usb-mass storage device (flash), and remove.  Observe above conditions.
device scbus
device da
device pass
to MODULAR kernel config file

Patch attached with submission follows:

# MODULAR -- Modular kernel configuration file for FreeBSD/amd64

ident		MODULAR

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

options 	SCHED_ULE		# ULE scheduler
options 	PREEMPTION		# Enable kernel thread preemption
options 	INET			# InterNETworking
options 	INET6			# IPv6 communications protocols
options 	SCTP			# Stream Control Transmission Protocol
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 	UFS_GJOURNAL		# Enable gjournal-based UFS journaling
options 	MD_ROOT			# MD is a potential root device
options 	PROCFS			# Process filesystem (requires PSEUDOFS)
options 	PSEUDOFS		# Pseudo-filesystem framework
options 	GEOM_PART_GPT		# GUID Partition Tables.
options 	GEOM_LABEL		# Provides labelization
options 	COMPAT_FREEBSD32	# Compatible with i386 binaries
options 	SCSI_DELAY=5000		# Delay (in ms) before probing SCSI
options 	KTRACE			# ktrace(1) support
options 	STACK			# stack(9) 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 	PRINTF_BUFR_SIZE=128	# Prevent printf output being interspersed.
options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
options 	HWPMC_HOOKS		# Necessary kernel hooks for hwpmc(4)
options 	AUDIT			# Security event auditing
options 	MAC			# TrustedBSD MAC Framework
#options 	KDTRACE_FRAME		# Ensure frames are compiled in
#options 	KDTRACE_HOOKS		# Kernel DTrace hooks
options 	INCLUDE_CONFIG_FILE     # Include this file in kernel

# Make an SMP-capable kernel by default
options 	SMP			# Symmetric MultiProcessor Kernel

# CPU frequency control
device		cpufreq

# Bus support.
device		acpi
device		pci

# ATA controllers
options 	ATA_CAM		# Handle legacy controllers with CAM
options 	ATA_STATIC_ID	# Static device numbering

# 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		kbdmux		# keyboard multiplexer

device		vga		# VGA video card driver
options 	VESA		# Add VESA BIOS support to the driver
options 	X86BIOS		# x86 real mode BIOS emulator

device		splash		# Splash screen and screen saver support

# syscons is the default console driver, resembling an SCO console
device		sc
options 	SC_PIXEL_MODE	# add support for the raster text mode

# Wireless NIC cards
options 	IEEE80211_DEBUG	# enable debug msgs
options 	IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
options 	IEEE80211_SUPPORT_MESH	# enable 802.11s draft support
options 	AH_SUPPORT_AR5416	# enable AR5416 tx/rx descriptors

# Pseudo devices.
device		loop		# Network loopback
device		ether		# Ethernet support
device		vlan		# 802.1Q VLAN support
device		tun		# Packet tunnel.
device		md		# Memory "disks"
device		gif		# IPv6 and IPv4 tunneling
device		faith		# IPv6-to-IPv4 relaying (translation)

# The `bpf' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
# Note that 'bpf' is required for DHCP.
device		bpf		# Berkeley packet filter

# USB support
options 	USB_DEBUG	# enable debug msgs


More information about the freebsd-bugs mailing list