From nobody@FreeBSD.org  Wed Aug 28 05:35:56 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 5768B443
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 28 Aug 2013 05:35:56 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 34B9E2B5E
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 28 Aug 2013 05:35:56 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r7S5ZuHF060148
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 28 Aug 2013 05:35:56 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r7S5Zudp060143;
	Wed, 28 Aug 2013 05:35:56 GMT
	(envelope-from nobody)
Message-Id: <201308280535.r7S5Zudp060143@oldred.freebsd.org>
Date: Wed, 28 Aug 2013 05:35:56 GMT
From: Martin Laabs <info@martinlaabs.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Sporadic failure of root mount on ARM/Raspberry
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         181601
>Category:       arm
>Synopsis:       Sporadic failure of root mount on ARM/Raspberry
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-arm
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 28 05:40:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Mon Apr 21 18:50:00 UTC 2014
>Originator:     Martin Laabs
>Release:        FreeBSD 10.0-CURRENT #0 r254955M
>Organization:
-
>Environment:
not available
>Description:
Sporadicly the raspberry pi failes to mount its root mmc card. After power off and power on again works most of the time. However there seem to be also configurations that fail permanently. Unfortunately I have no image of a sd card that fails on every boot. The full boot log output is attached to this bug report. 


Trying to mount root from ufs:/dev/mmcsd0s2a [rw,noatime]...
mountroot: waiting for device /dev/mmcsd0s2a ...
smsc0: chip 0xec00, rev. 0002
miibus0: <MII bus> on smsc0
ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ue0: <USB Ethernet> on smsc0
ue0: Ethernet address: b8:27:eb:1d:b7:5a
Mounting from ufs:/dev/mmcsd0s2a failed with error 19.

Loader variables:
  vfs.root.mountfrom=ufs:/dev/mmcsd0s2a
  vfs.root.mountfrom.options=rw,noatime

Manual root filesystem specification:
  <fstype>:<device> [options]
      Mount <device> using filesystem <fstype>
      and with the specified (optional) option list.

    eg. ufs:/dev/da0s1a
        zfs:tank
        cd9660:/dev/acd0 ro
          (which is equivalent to: mount -t cd9660 -o ro /dev/acd0 /)

  ?               List valid disk boot devices
  .               Yield 1 second (for background tasks)
  <empty line>    Abort manual input

mountroot> 

>How-To-Repeat:
Boot the Raspberry Pi several times and look if 
>Fix:


Patch attached with submission follows:



U-Boot 2013.01-rc1-g6709570-dirty (Aug 17 2013 - 23:35:05)

DRAM:  480 MiB
WARNING: Caches not enabled
MMC:   bcm2835_sdhci: 0
Using default environment

In:    serial
Out:   lcd
Err:   lcd
mbox: Timeout waiting for response
bcm2835: Could not set USB power state
Net:   Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot:  3  2  1  0 
reading uEnv.txt
89 bytes read in 9541 ms (0 Bytes/s)
Importing environment from mmc ...
reading ubldr
239540 bytes read in 54396 ms (3.9 KiB/s)
## Starting application at 0x02000054 ...
Consoles: U-Boot console  
Compatible API signature found @1db682a8
Number of U-Boot devices: 1

FreeBSD/armv6 U-Boot loader, Revision 1.2
(martin@pcbsd-7130, Wed Aug 28 01:32:51 CEST 2013)
DRAM:	 480MB

Device: disk
|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|Loading /boot/defaults/loader.conf 
/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\/boot/kernel/kernel data=0x47b5e4+0x17e19c |/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|syms=[0x4+0x7fcb0/-\|/-\|/-\|/-\|+0x4+0x4d613/-\|/-\|/-]

Hit [Enter] to boot immediately, or any other key for command prompt.
Booting [/boot/kernel/kernel]...               
\|/-\|/Using DTB provided by U-Boot.
Kernel entry at 0x100100...
Kernel args: (null)
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2013 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 is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.0-CURRENT #0 r254955M: Wed Aug 28 01:32:36 CEST 2013
    martin@pcbsd-7130:/usr/home/martin/Rasperry/crochet-freebsd/work/obj/arm.armv6/usr/home/martin/Rasperry/head/sys/RPI-B arm
FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
WARNING: WITNESS option enabled, expect reduced performance.
WARNING: DIAGNOSTIC option enabled, expect reduced performance.
CPU: ARM1176JZ-S rev 7 (ARM11J core)
 Supported features: ARM_ISA THUMB2 JAZELLE ARMv4 Security_Ext
 WB enabled LABT branch prediction enabled
  16KB/32B 4-way instruction cache
  16KB/32B 4-way write-back-locking-C data cache
real memory  = 536870912 (512 MB)
avail memory = 482902016 (460 MB)
random device not loaded; using insecure entropy
random: <Software, Yarrow> initialized
simplebus0: <Flattened device tree simple bus> mem 0x20000000-0x20ffffff on fdtbus0
intc0: <BCM2835 Interrupt Controller> mem 0x2000b200-0x2000b3ff on simplebus0
systimer0: <BCM2835 System Timer> mem 0x20003000-0x20003fff irq 8,9,10,11 on simplebus0
Event timer "BCM2835 Event Timer 3" frequency 1000000 Hz quality 1000
Timecounter "BCM2835 Timecounter" frequency 1000000 Hz quality 1000
bcmwd0: <BCM2708/2835 Watchdog> mem 0x2010001c-0x20100027 on simplebus0
gpio0: <BCM2708/2835 GPIO controller> mem 0x20200000-0x202000af irq 57,59,58,60 on simplebus0
gpio0: read-only pins: 46,47,48,49,50,51,52,53.
gpio0: reserved pins: 48,49,50,51,52,53.
gpioc0: <GPIO controller> on gpio0
gpiobus0: <GPIO bus> on gpio0
bcm_dma0: <BCM2835 DMA Controller> mem 0x20007000-0x20007fff,0x20e05000-0x20e05fff irq 24,25,26,27,28,29,30,31,32,33,34,35,36 on simplebus0
mbox0: <BCM2835 VideoCore Mailbox> mem 0x2000b880-0x2000b8bf irq 1 on simplebus0
sdhci_bcm0: <Broadcom 2708 SDHCI controller> mem 0x20300000-0x203000ff irq 70 on simplebus0
mmc0: <MMC/SD bus> on sdhci_bcm0
uart0: <PrimeCell UART (PL011)> mem 0x20201000-0x20201fff irq 65 on simplebus0
uart0: console (115200,n,8,1)
dwcotg0: <DWC OTG 2.0 integrated USB controller> mem 0x20980000-0x2099ffff irq 17 on simplebus0
usbus0 on dwcotg0
simplebus1: <Flattened device tree simple bus> on fdtbus0
Timecounters tick every 10.000 msec
lock order reversal:
 1st 0xc06f3c0c entropy harvest mutex (entropy harvest mutex) @ /usr/home/martin/Rasperry/head/sys/dev/random/randomdev_soft.c:242
 2nd 0xc25d7c20 uart_hwmtx (uart_hwmtx) @ /usr/home/martin/Rasperry/head/sys/dev/uart/uart_cpu.h:92
KDB: stack backtrace:
db_trace_self() at db_trace_self
	 pc = 0xc04652cc  lr = 0xc012e474 (db_trace_self_wrapper+0x30)
	 sp = 0xdc20c9c8  fp = 0xdc20cae0
	r10 = 0xc06f3c0c
db_trace_self_wrapper() at db_trace_self_wrapper+0x30
	 pc = 0xc012e474  lr = 0xc0268974 (kdb_backtrace+0x38)
	 sp = 0xdc20cae8  fp = 0xdc20caf0
	 r4 = 0xc05908a4  r5 = 0xc049fb59
	 r6 = 0xc04bd04d  r7 = 0xc049f1d4
kdb_backtrace() at kdb_backtrace+0x38
	 pc = 0xc0268974  lr = 0xc0282df8 (witness_checkorder+0xddc)
	 sp = 0xdc20caf8  fp = 0xdc20cb48
	 r4 = 0xc049fa8a
witness_checkorder() at witness_checkorder+0xddc
	 pc = 0xc0282df8  lr = 0xc022050c (__mtx_lock_spin_flags+0xc4)
	 sp = 0xdc20cb50  fp = 0xdc20cb70
	 r4 = 0x00000000  r5 = 0xc0580a84
	 r6 = 0xc25d7c20  r7 = 0xc25d7c30
	 r8 = 0x00000000  r9 = 0x0000005c
	r10 = 0xc049fb56
__mtx_lock_spin_flags() at __mtx_lock_spin_flags+0xc4
	 pc = 0xc022050c  lr = 0xc014e9a4 (uart_cnputc+0x44)
	 sp = 0xdc20cb78  fp = 0xdc20cb88
	 r4 = 0x0000006c  r5 = 0xc0580a84
	 r6 = 0xc05908a0  r7 = 0xc0581700
	 r8 = 0xc055d590  r9 = 0xc05816e0
	r10 = 0xdc20ccf0
uart_cnputc() at uart_cnputc+0x44
	 pc = 0xc014e9a4  lr = 0xc01eb6b0 (cnputc+0x80)
	 sp = 0xdc20cb90  fp = 0xdc20cba8
	 r4 = 0x0000006c  r5 = 0xc0551c30
	 r6 = 0xc05908a0
cnputc() at cnputc+0x80
	 pc = 0xc01eb6b0  lr = 0xc026e6ec (putchar+0x194)
	 sp = 0xdc20cbb0  fp = 0xdc20cc18
	 r4 = 0x00000005  r5 = 0xdc20ccf0
	 r6 = 0x0000006c  r7 = 0x00000000
	 r8 = 0xc06f52b4  r9 = 0xc026e558
putchar() at putchar+0x194
	 pc = 0xc026e6ec  lr = 0xc026d53c (kvprintf+0xb0)
	 sp = 0xdc20cc20  fp = 0xdc20ccd8
	 r4 = 0xc04bc4c4  r5 = 0x00000000
	 r6 = 0x00000000  r7 = 0x00000000
	 r8 = 0xc06f52b4  r9 = 0xc026e558
	r10 = 0xdc20ccf0
kvprintf() at kvprintf+0xb0
	 pc = 0xc026d53c  lr = 0xc026ec58 (printf+0x50)
	 sp = 0xdc20cce0  fp = 0xdc20cd10
	 r4 = 0xc2446da8  r5 = 0xc2446a68
	 r6 = 0x00000000  r7 = 0xc06c394c
	 r8 = 0xc06f52b4  r9 = 0x00000001
	r10 = 0xc06c395b
printf() at printf+0x50
	 pc = 0xc026ec58  lr = 0xc0282b58 (witness_checkorder+0xb3c)
	 sp = 0xdc20cd28  fp = 0xdc20cd78
witness_checkorder() at witness_checkorder+0xb3c
	 pc = 0xc0282b58  lr = 0xc022050c (__mtx_lock_spin_flags+0xc4)
	 sp = 0xdc20cd80  fp = 0xdc20cda0
	 r4 = 0x00000000  r5 = 0x00000000
	 r6 = 0xc059198c  r7 = 0xc059199c
	 r8 = 0x00000000  r9 = 0x000000f0
	r10 = 0xc04ba67a
__mtx_lock_spin_flags() at __mtx_lock_spin_flags+0xc4
	 pc = 0xc022050c  lr = 0xc02751a4 (sleepq_lock+0x34)
	 sp = 0xdc20cda8  fp = 0xdc20cda8
	 r4 = 0xc2582960  r5 = 0x00000000
	 r6 = 0xc0580394  r7 = 0x00000000
	 r8 = 0xc2584c80  r9 = 0x00000000
	r10 = 0xc0580390
sleepq_lock() at sleepq_lock+0x34
	 pc = 0xc02751a4  lr = 0xc023c4c0 (msleep_spin_sbt+0x80)
	 sp = 0xdc20cdb0  fp = 0xdc20cdf0
msleep_spin_sbt() at msleep_spin_sbt+0x80
	 pc = 0xc023c4c0  lr = 0xc0147458 (random_kthread+0x270)
	 sp = 0xdc20cdf8  fp = 0xdc20ce38
	 r4 = 0xc06f3c1c  r5 = 0x00000000
	 r6 = 0xc049f1d1  r7 = 0x00000000
	 r8 = 0x00000000  r9 = 0x00000000
	r10 = 0xc0580390
random_kthread() at random_kthread+0x270
	 pc = 0xc0147458  lr = 0xc02033f0 (fork_exit+0x88)
	 sp = 0xdc20ce40  fp = 0xdc20ce58
	 r4 = 0xc2584c80  r5 = 0xc2582960
	 r6 = 0xc01471e8  r7 = 0x00000000
	 r8 = 0xdc20ce60  r9 = 0x00000000
	r10 = 0x00000000
fork_exit() at fork_exit+0x88
	 pc = 0xc02033f0  lr = 0xc0475cec (fork_trampoline+0x14)
	 sp = 0xdc20ce60  fp = 0x00000000
	 r4 = 0xc01471e8  r5 = 0x00000000
	 r6 = 0xc0c0c0c0  r7 = 0xc0c0c0c0
	 r8 = 0x00000000
fork_trampoline() at fork_trampoline+0x14
	 pc = 0xc0475cec  lr = 0xc0475cec (fork_trampoline+0x14)
	 sp = 0xdc20ce60  fp = 0x00000000
Unable to unwind further
lock order reversal:
 1st 0xc06f3c0c entropy harvest mutex (entropy harvest mutex) @ /usr/home/martin/Rasperry/head/sys/dev/random/randomdev_soft.c:242
 2nd 0xc059198c sleepq chain (sleepq chain) @ /usr/home/martin/Rasperry/head/sys/kern/subr_sleepqueue.c:240
KDB: stack backtrace:
db_trace_self() at db_trace_self
	 pc = 0xc04652cc  lr = 0xc012e474 (db_trace_self_wrapper+0x30)
	 sp = 0xdc20cbf8  fp = 0xdc20cd10
	r10 = 0xc06f3c0c
db_trace_self_wrapper() at db_trace_self_wrapper+0x30
	 pc = 0xc012e474  lr = 0xc0268974 (kdb_backtrace+0x38)
	 sp = 0xdc20cd18  fp = 0xdc20cd20
	 r4 = 0xc05908a4  r5 = 0xc04ba67d
	 r6 = 0xc04bd04d  r7 = 0xc049f1d4
kdb_backtrace() at kdb_backtrace+0x38
	 pc = 0xc0268974  lr = 0xc0282df8 (witness_checkorder+0xddc)
	 sp = 0xdc20cd28  fp = 0xdc20cd78
	 r4 = 0xc04ba662
witness_checkorder() at witness_checkorder+0xddc
	 pc = 0xc0282df8  lr = 0xc022050c (__mtx_lock_spin_flags+0xc4)
	 sp = 0xdc20cd80  fp = 0xdc20cda0
	 r4 = 0x00000000  r5 = 0x00000000
	 r6 = 0xc059198c  r7 = 0xc059199c
	 r8 = 0x00000000  r9 = 0x000000f0
	r10 = 0xc04ba67a
__mtx_lock_spin_flags() at __mtx_lock_spin_flags+0xc4
	 pc = 0xc022050c  lr = 0xc02751a4 (sleepq_lock+0x34)
	 sp = 0xdc20cda8  fp = 0xdc20cda8
	 r4 = 0xc2582960  r5 = 0x00000000
	 r6 = 0xc0580394  r7 = 0x00000000
	 r8 = 0xc2584c80  r9 = 0x00000000
	r10 = 0xc0580390
sleepq_lock() at sleepq_lock+0x34
	 pc = 0xc02751a4  lr = 0xc023c4c0 (msleep_spin_sbt+0x80)
	 sp = 0xdc20cdb0  fp = 0xdc20cdf0
msleep_spin_sbt() at msleep_spin_sbt+0x80
	 pc = 0xc023c4c0  lr = 0xc0147458 (random_kthread+0x270)
	 sp = 0xdc20cdf8  fp = 0xdc20ce38
	 r4 = 0xc06f3c1c  r5 = 0x00000000
	 r6 = 0xc049f1d1  r7 = 0x00000000
	 r8 = 0x00000000  r9 = 0x00000000
	r10 = 0xc0580390
random_kthread() at random_kthread+0x270
	 pc = 0xc0147458  lr = 0xc02033f0 (fork_exit+0x88)
	 sp = 0xdc20ce40  fp = 0xdc20ce58
	 r4 = 0xc2584c80  r5 = 0xc2582960
	 r6 = 0xc01471e8  r7 = 0x00000000
	 r8 = 0xdc20ce60  r9 = 0x00000000
	r10 = 0x00000000
fork_exit() at fork_exit+0x88
	 pc = 0xc02033f0  lr = 0xc0475cec (fork_trampoline+0x14)
	 sp = 0xdc20ce60  fp = 0x00000000
	 r4 = 0xc01471e8  r5 = 0x00000000
	 r6 = 0xc0c0c0c0  r7 = 0xc0c0c0c0
	 r8 = 0x00000000
fork_trampoline() at fork_trampoline+0x14
	 pc = 0xc0475cec  lr = 0xc0475cec (fork_trampoline+0x14)
	 sp = 0xdc20ce60  fp = 0x00000000
Unable to unwind further
usbus0: 480Mbps High Speed USB v2.0
ugen0.1: <DWCOTG> at usbus0
uhub0: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
uhub0: 1 port with 1 removable, self powered
mmcsd0: 8GB <SDHC NCard 1.0 SN 1075839384 MFG 05/2013 by 130 JT> at mmc0 50.0MHz/4bit/65535-block
WARNING: WITNESS option enabled, expect reduced performance.
WARNING: DIAGNOSTIC option enabled, expect reduced performance.
mmcsd0: Error indicated: 1 Timeout
mmcsd0: Error indicated: 1 Timeout
Root mount waiting for: usbus0
ugen0.2: <vendor 0x0424> at usbus0
uhub1: <vendor 0x0424 product 0x9512, class 9/0, rev 2.00/2.00, addr 2> on usbus0
uhub1: MTT enabled
Root mount waiting for: usbus0
uhub1: 3 ports with 2 removable, self powered
Root mount waiting for: usbus0
ugen0.3: <vendor 0x0424> at usbus0
smsc0: <vendor 0x0424 product 0xec00, rev 2.00/2.00, addr 3> on usbus0
Trying to mount root from ufs:/dev/mmcsd0s2a [rw,noatime]...
mountroot: waiting for device /dev/mmcsd0s2a ...
smsc0: chip 0xec00, rev. 0002
miibus0: <MII bus> on smsc0
ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ue0: <USB Ethernet> on smsc0
ue0: Ethernet address: b8:27:eb:1d:b7:5a
Mounting from ufs:/dev/mmcsd0s2a failed with error 19.

Loader variables:
  vfs.root.mountfrom=ufs:/dev/mmcsd0s2a
  vfs.root.mountfrom.options=rw,noatime

Manual root filesystem specification:
  <fstype>:<device> [options]
      Mount <device> using filesystem <fstype>
      and with the specified (optional) option list.

    eg. ufs:/dev/da0s1a
        zfs:tank
        cd9660:/dev/acd0 ro
          (which is equivalent to: mount -t cd9660 -o ro /dev/acd0 /)

  ?               List valid disk boot devices
  .               Yield 1 second (for background tasks)
  <empty line>    Abort manual input

mountroot> 

>Release-Note:
>Audit-Trail:

From: Ian Lepore <ian@FreeBSD.org>
To: Martin Laabs <info@martinlaabs.de>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: arm/181601: Sporadic failure of root mount on ARM/Raspberry
Date: Wed, 28 Aug 2013 06:23:02 -0600

 On Wed, 2013-08-28 at 05:35 +0000, Martin Laabs wrote:
 > >Number:         181601
 > >Category:       arm
 > >Synopsis:       Sporadic failure of root mount on ARM/Raspberry
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       low
 > >Responsible:    freebsd-arm
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Wed Aug 28 05:40:00 UTC 2013
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Martin Laabs
 > >Release:        FreeBSD 10.0-CURRENT #0 r254955M
 > >Organization:
 > -
 > >Environment:
 > not available
 > >Description:
 > Sporadicly the raspberry pi failes to mount its root mmc card. After power off and power on again works most of the time. However there seem to be also configurations that fail permanently. Unfortunately I have no image of a sd card that fails on every boot. The full boot log output is attached to this bug report. 
 > 
 > 
 > Trying to mount root from ufs:/dev/mmcsd0s2a [rw,noatime]...
 > mountroot: waiting for device /dev/mmcsd0s2a ...
 > smsc0: chip 0xec00, rev. 0002
 > miibus0: <MII bus> on smsc0
 > ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
 > ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 > ue0: <USB Ethernet> on smsc0
 > ue0: Ethernet address: b8:27:eb:1d:b7:5a
 > Mounting from ufs:/dev/mmcsd0s2a failed with error 19.
 > 
 > Loader variables:
 >   vfs.root.mountfrom=ufs:/dev/mmcsd0s2a
 >   vfs.root.mountfrom.options=rw,noatime
 > 
 > Manual root filesystem specification:
 >   <fstype>:<device> [options]
 >       Mount <device> using filesystem <fstype>
 >       and with the specified (optional) option list.
 > 
 >     eg. ufs:/dev/da0s1a
 >         zfs:tank
 >         cd9660:/dev/acd0 ro
 >           (which is equivalent to: mount -t cd9660 -o ro /dev/acd0 /)
 > 
 >   ?               List valid disk boot devices
 >   .               Yield 1 second (for background tasks)
 >   <empty line>    Abort manual input
 > 
 > mountroot> 
 > 
 > >How-To-Repeat:
 > Boot the Raspberry Pi several times and look if 
 > >Fix:
 > 
 > 
 > Patch attached with submission follows:
 > 
 > 
 > 
 > U-Boot 2013.01-rc1-g6709570-dirty (Aug 17 2013 - 23:35:05)
 > 
 > DRAM:  480 MiB
 > WARNING: Caches not enabled
 > MMC:   bcm2835_sdhci: 0
 > Using default environment
 > 
 > In:    serial
 > Out:   lcd
 > Err:   lcd
 > mbox: Timeout waiting for response
 > bcm2835: Could not set USB power state
 > Net:   Net Initialization Skipped
 > No ethernet found.
 > Hit any key to stop autoboot:  3  2  1  0 
 > reading uEnv.txt
 > 89 bytes read in 9541 ms (0 Bytes/s)
 > Importing environment from mmc ...
 > reading ubldr
 > 239540 bytes read in 54396 ms (3.9 KiB/s)
 > ## Starting application at 0x02000054 ...
 > Consoles: U-Boot console  
 > Compatible API signature found @1db682a8
 > Number of U-Boot devices: 1
 > 
 > FreeBSD/armv6 U-Boot loader, Revision 1.2
 > (martin@pcbsd-7130, Wed Aug 28 01:32:51 CEST 2013)
 > DRAM:	 480MB
 > 
 > Device: disk
 > |/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|Loading /boot/defaults/loader.conf 
 > /-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\/boot/kernel/kernel data=0x47b5e4+0x17e19c |/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|syms=[0x4+0x7fcb0/-\|/-\|/-\|/-\|+0x4+0x4d 613/-\|/-\|/-]
 > 
 > Hit [Enter] to boot immediately, or any other key for command prompt.
 > Booting [/boot/kernel/kernel]...               
 > \|/-\|/Using DTB provided by U-Boot.
 > Kernel entry at 0x100100...
 > Kernel args: (null)
 > KDB: debugger backends: ddb
 > KDB: current backend: ddb
 > Copyright (c) 1992-2013 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 is a registered trademark of The FreeBSD Foundation.
 > FreeBSD 10.0-CURRENT #0 r254955M: Wed Aug 28 01:32:36 CEST 2013
 >     martin@pcbsd-7130:/usr/home/martin/Rasperry/crochet-freebsd/work/obj/arm.armv6/usr/home/martin/Rasperry/head/sys/RPI-B arm
 > FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
 > WARNING: WITNESS option enabled, expect reduced performance.
 > WARNING: DIAGNOSTIC option enabled, expect reduced performance.
 > CPU: ARM1176JZ-S rev 7 (ARM11J core)
 >  Supported features: ARM_ISA THUMB2 JAZELLE ARMv4 Security_Ext
 >  WB enabled LABT branch prediction enabled
 >   16KB/32B 4-way instruction cache
 >   16KB/32B 4-way write-back-locking-C data cache
 > real memory  = 536870912 (512 MB)
 > avail memory = 482902016 (460 MB)
 > random device not loaded; using insecure entropy
 > random: <Software, Yarrow> initialized
 > simplebus0: <Flattened device tree simple bus> mem 0x20000000-0x20ffffff on fdtbus0
 > intc0: <BCM2835 Interrupt Controller> mem 0x2000b200-0x2000b3ff on simplebus0
 > systimer0: <BCM2835 System Timer> mem 0x20003000-0x20003fff irq 8,9,10,11 on simplebus0
 > Event timer "BCM2835 Event Timer 3" frequency 1000000 Hz quality 1000
 > Timecounter "BCM2835 Timecounter" frequency 1000000 Hz quality 1000
 > bcmwd0: <BCM2708/2835 Watchdog> mem 0x2010001c-0x20100027 on simplebus0
 > gpio0: <BCM2708/2835 GPIO controller> mem 0x20200000-0x202000af irq 57,59,58,60 on simplebus0
 > gpio0: read-only pins: 46,47,48,49,50,51,52,53.
 > gpio0: reserved pins: 48,49,50,51,52,53.
 > gpioc0: <GPIO controller> on gpio0
 > gpiobus0: <GPIO bus> on gpio0
 > bcm_dma0: <BCM2835 DMA Controller> mem 0x20007000-0x20007fff,0x20e05000-0x20e05fff irq 24,25,26,27,28,29,30,31,32,33,34,35,36 on simplebus0
 > mbox0: <BCM2835 VideoCore Mailbox> mem 0x2000b880-0x2000b8bf irq 1 on simplebus0
 > sdhci_bcm0: <Broadcom 2708 SDHCI controller> mem 0x20300000-0x203000ff irq 70 on simplebus0
 > mmc0: <MMC/SD bus> on sdhci_bcm0
 > uart0: <PrimeCell UART (PL011)> mem 0x20201000-0x20201fff irq 65 on simplebus0
 > uart0: console (115200,n,8,1)
 > dwcotg0: <DWC OTG 2.0 integrated USB controller> mem 0x20980000-0x2099ffff irq 17 on simplebus0
 > usbus0 on dwcotg0
 > simplebus1: <Flattened device tree simple bus> on fdtbus0
 > Timecounters tick every 10.000 msec
 > lock order reversal:
 >  1st 0xc06f3c0c entropy harvest mutex (entropy harvest mutex) @ /usr/home/martin/Rasperry/head/sys/dev/random/randomdev_soft.c:242
 >  2nd 0xc25d7c20 uart_hwmtx (uart_hwmtx) @ /usr/home/martin/Rasperry/head/sys/dev/uart/uart_cpu.h:92
 > KDB: stack backtrace:
 > db_trace_self() at db_trace_self
 > 	 pc = 0xc04652cc  lr = 0xc012e474 (db_trace_self_wrapper+0x30)
 > 	 sp = 0xdc20c9c8  fp = 0xdc20cae0
 > 	r10 = 0xc06f3c0c
 > db_trace_self_wrapper() at db_trace_self_wrapper+0x30
 > 	 pc = 0xc012e474  lr = 0xc0268974 (kdb_backtrace+0x38)
 > 	 sp = 0xdc20cae8  fp = 0xdc20caf0
 > 	 r4 = 0xc05908a4  r5 = 0xc049fb59
 > 	 r6 = 0xc04bd04d  r7 = 0xc049f1d4
 > kdb_backtrace() at kdb_backtrace+0x38
 > 	 pc = 0xc0268974  lr = 0xc0282df8 (witness_checkorder+0xddc)
 > 	 sp = 0xdc20caf8  fp = 0xdc20cb48
 > 	 r4 = 0xc049fa8a
 > witness_checkorder() at witness_checkorder+0xddc
 > 	 pc = 0xc0282df8  lr = 0xc022050c (__mtx_lock_spin_flags+0xc4)
 > 	 sp = 0xdc20cb50  fp = 0xdc20cb70
 > 	 r4 = 0x00000000  r5 = 0xc0580a84
 > 	 r6 = 0xc25d7c20  r7 = 0xc25d7c30
 > 	 r8 = 0x00000000  r9 = 0x0000005c
 > 	r10 = 0xc049fb56
 > __mtx_lock_spin_flags() at __mtx_lock_spin_flags+0xc4
 > 	 pc = 0xc022050c  lr = 0xc014e9a4 (uart_cnputc+0x44)
 > 	 sp = 0xdc20cb78  fp = 0xdc20cb88
 > 	 r4 = 0x0000006c  r5 = 0xc0580a84
 > 	 r6 = 0xc05908a0  r7 = 0xc0581700
 > 	 r8 = 0xc055d590  r9 = 0xc05816e0
 > 	r10 = 0xdc20ccf0
 > uart_cnputc() at uart_cnputc+0x44
 > 	 pc = 0xc014e9a4  lr = 0xc01eb6b0 (cnputc+0x80)
 > 	 sp = 0xdc20cb90  fp = 0xdc20cba8
 > 	 r4 = 0x0000006c  r5 = 0xc0551c30
 > 	 r6 = 0xc05908a0
 > cnputc() at cnputc+0x80
 > 	 pc = 0xc01eb6b0  lr = 0xc026e6ec (putchar+0x194)
 > 	 sp = 0xdc20cbb0  fp = 0xdc20cc18
 > 	 r4 = 0x00000005  r5 = 0xdc20ccf0
 > 	 r6 = 0x0000006c  r7 = 0x00000000
 > 	 r8 = 0xc06f52b4  r9 = 0xc026e558
 > putchar() at putchar+0x194
 > 	 pc = 0xc026e6ec  lr = 0xc026d53c (kvprintf+0xb0)
 > 	 sp = 0xdc20cc20  fp = 0xdc20ccd8
 > 	 r4 = 0xc04bc4c4  r5 = 0x00000000
 > 	 r6 = 0x00000000  r7 = 0x00000000
 > 	 r8 = 0xc06f52b4  r9 = 0xc026e558
 > 	r10 = 0xdc20ccf0
 > kvprintf() at kvprintf+0xb0
 > 	 pc = 0xc026d53c  lr = 0xc026ec58 (printf+0x50)
 > 	 sp = 0xdc20cce0  fp = 0xdc20cd10
 > 	 r4 = 0xc2446da8  r5 = 0xc2446a68
 > 	 r6 = 0x00000000  r7 = 0xc06c394c
 > 	 r8 = 0xc06f52b4  r9 = 0x00000001
 > 	r10 = 0xc06c395b
 > printf() at printf+0x50
 > 	 pc = 0xc026ec58  lr = 0xc0282b58 (witness_checkorder+0xb3c)
 > 	 sp = 0xdc20cd28  fp = 0xdc20cd78
 > witness_checkorder() at witness_checkorder+0xb3c
 > 	 pc = 0xc0282b58  lr = 0xc022050c (__mtx_lock_spin_flags+0xc4)
 > 	 sp = 0xdc20cd80  fp = 0xdc20cda0
 > 	 r4 = 0x00000000  r5 = 0x00000000
 > 	 r6 = 0xc059198c  r7 = 0xc059199c
 > 	 r8 = 0x00000000  r9 = 0x000000f0
 > 	r10 = 0xc04ba67a
 > __mtx_lock_spin_flags() at __mtx_lock_spin_flags+0xc4
 > 	 pc = 0xc022050c  lr = 0xc02751a4 (sleepq_lock+0x34)
 > 	 sp = 0xdc20cda8  fp = 0xdc20cda8
 > 	 r4 = 0xc2582960  r5 = 0x00000000
 > 	 r6 = 0xc0580394  r7 = 0x00000000
 > 	 r8 = 0xc2584c80  r9 = 0x00000000
 > 	r10 = 0xc0580390
 > sleepq_lock() at sleepq_lock+0x34
 > 	 pc = 0xc02751a4  lr = 0xc023c4c0 (msleep_spin_sbt+0x80)
 > 	 sp = 0xdc20cdb0  fp = 0xdc20cdf0
 > msleep_spin_sbt() at msleep_spin_sbt+0x80
 > 	 pc = 0xc023c4c0  lr = 0xc0147458 (random_kthread+0x270)
 > 	 sp = 0xdc20cdf8  fp = 0xdc20ce38
 > 	 r4 = 0xc06f3c1c  r5 = 0x00000000
 > 	 r6 = 0xc049f1d1  r7 = 0x00000000
 > 	 r8 = 0x00000000  r9 = 0x00000000
 > 	r10 = 0xc0580390
 > random_kthread() at random_kthread+0x270
 > 	 pc = 0xc0147458  lr = 0xc02033f0 (fork_exit+0x88)
 > 	 sp = 0xdc20ce40  fp = 0xdc20ce58
 > 	 r4 = 0xc2584c80  r5 = 0xc2582960
 > 	 r6 = 0xc01471e8  r7 = 0x00000000
 > 	 r8 = 0xdc20ce60  r9 = 0x00000000
 > 	r10 = 0x00000000
 > fork_exit() at fork_exit+0x88
 > 	 pc = 0xc02033f0  lr = 0xc0475cec (fork_trampoline+0x14)
 > 	 sp = 0xdc20ce60  fp = 0x00000000
 > 	 r4 = 0xc01471e8  r5 = 0x00000000
 > 	 r6 = 0xc0c0c0c0  r7 = 0xc0c0c0c0
 > 	 r8 = 0x00000000
 > fork_trampoline() at fork_trampoline+0x14
 > 	 pc = 0xc0475cec  lr = 0xc0475cec (fork_trampoline+0x14)
 > 	 sp = 0xdc20ce60  fp = 0x00000000
 > Unable to unwind further
 > lock order reversal:
 >  1st 0xc06f3c0c entropy harvest mutex (entropy harvest mutex) @ /usr/home/martin/Rasperry/head/sys/dev/random/randomdev_soft.c:242
 >  2nd 0xc059198c sleepq chain (sleepq chain) @ /usr/home/martin/Rasperry/head/sys/kern/subr_sleepqueue.c:240
 > KDB: stack backtrace:
 > db_trace_self() at db_trace_self
 > 	 pc = 0xc04652cc  lr = 0xc012e474 (db_trace_self_wrapper+0x30)
 > 	 sp = 0xdc20cbf8  fp = 0xdc20cd10
 > 	r10 = 0xc06f3c0c
 > db_trace_self_wrapper() at db_trace_self_wrapper+0x30
 > 	 pc = 0xc012e474  lr = 0xc0268974 (kdb_backtrace+0x38)
 > 	 sp = 0xdc20cd18  fp = 0xdc20cd20
 > 	 r4 = 0xc05908a4  r5 = 0xc04ba67d
 > 	 r6 = 0xc04bd04d  r7 = 0xc049f1d4
 > kdb_backtrace() at kdb_backtrace+0x38
 > 	 pc = 0xc0268974  lr = 0xc0282df8 (witness_checkorder+0xddc)
 > 	 sp = 0xdc20cd28  fp = 0xdc20cd78
 > 	 r4 = 0xc04ba662
 > witness_checkorder() at witness_checkorder+0xddc
 > 	 pc = 0xc0282df8  lr = 0xc022050c (__mtx_lock_spin_flags+0xc4)
 > 	 sp = 0xdc20cd80  fp = 0xdc20cda0
 > 	 r4 = 0x00000000  r5 = 0x00000000
 > 	 r6 = 0xc059198c  r7 = 0xc059199c
 > 	 r8 = 0x00000000  r9 = 0x000000f0
 > 	r10 = 0xc04ba67a
 > __mtx_lock_spin_flags() at __mtx_lock_spin_flags+0xc4
 > 	 pc = 0xc022050c  lr = 0xc02751a4 (sleepq_lock+0x34)
 > 	 sp = 0xdc20cda8  fp = 0xdc20cda8
 > 	 r4 = 0xc2582960  r5 = 0x00000000
 > 	 r6 = 0xc0580394  r7 = 0x00000000
 > 	 r8 = 0xc2584c80  r9 = 0x00000000
 > 	r10 = 0xc0580390
 > sleepq_lock() at sleepq_lock+0x34
 > 	 pc = 0xc02751a4  lr = 0xc023c4c0 (msleep_spin_sbt+0x80)
 > 	 sp = 0xdc20cdb0  fp = 0xdc20cdf0
 > msleep_spin_sbt() at msleep_spin_sbt+0x80
 > 	 pc = 0xc023c4c0  lr = 0xc0147458 (random_kthread+0x270)
 > 	 sp = 0xdc20cdf8  fp = 0xdc20ce38
 > 	 r4 = 0xc06f3c1c  r5 = 0x00000000
 > 	 r6 = 0xc049f1d1  r7 = 0x00000000
 > 	 r8 = 0x00000000  r9 = 0x00000000
 > 	r10 = 0xc0580390
 > random_kthread() at random_kthread+0x270
 > 	 pc = 0xc0147458  lr = 0xc02033f0 (fork_exit+0x88)
 > 	 sp = 0xdc20ce40  fp = 0xdc20ce58
 > 	 r4 = 0xc2584c80  r5 = 0xc2582960
 > 	 r6 = 0xc01471e8  r7 = 0x00000000
 > 	 r8 = 0xdc20ce60  r9 = 0x00000000
 > 	r10 = 0x00000000
 > fork_exit() at fork_exit+0x88
 > 	 pc = 0xc02033f0  lr = 0xc0475cec (fork_trampoline+0x14)
 > 	 sp = 0xdc20ce60  fp = 0x00000000
 > 	 r4 = 0xc01471e8  r5 = 0x00000000
 > 	 r6 = 0xc0c0c0c0  r7 = 0xc0c0c0c0
 > 	 r8 = 0x00000000
 > fork_trampoline() at fork_trampoline+0x14
 > 	 pc = 0xc0475cec  lr = 0xc0475cec (fork_trampoline+0x14)
 > 	 sp = 0xdc20ce60  fp = 0x00000000
 > Unable to unwind further
 > usbus0: 480Mbps High Speed USB v2.0
 > ugen0.1: <DWCOTG> at usbus0
 > uhub0: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
 > uhub0: 1 port with 1 removable, self powered
 > mmcsd0: 8GB <SDHC NCard 1.0 SN 1075839384 MFG 05/2013 by 130 JT> at mmc0 50.0MHz/4bit/65535-block
 > WARNING: WITNESS option enabled, expect reduced performance.
 > WARNING: DIAGNOSTIC option enabled, expect reduced performance.
 > mmcsd0: Error indicated: 1 Timeout
 > mmcsd0: Error indicated: 1 Timeout
 > Root mount waiting for: usbus0
 > ugen0.2: <vendor 0x0424> at usbus0
 > uhub1: <vendor 0x0424 product 0x9512, class 9/0, rev 2.00/2.00, addr 2> on usbus0
 > uhub1: MTT enabled
 > Root mount waiting for: usbus0
 > uhub1: 3 ports with 2 removable, self powered
 > Root mount waiting for: usbus0
 > ugen0.3: <vendor 0x0424> at usbus0
 > smsc0: <vendor 0x0424 product 0xec00, rev 2.00/2.00, addr 3> on usbus0
 > Trying to mount root from ufs:/dev/mmcsd0s2a [rw,noatime]...
 > mountroot: waiting for device /dev/mmcsd0s2a ...
 > smsc0: chip 0xec00, rev. 0002
 > miibus0: <MII bus> on smsc0
 > ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
 > ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 > ue0: <USB Ethernet> on smsc0
 > ue0: Ethernet address: b8:27:eb:1d:b7:5a
 > Mounting from ufs:/dev/mmcsd0s2a failed with error 19.
 > 
 > Loader variables:
 >   vfs.root.mountfrom=ufs:/dev/mmcsd0s2a
 >   vfs.root.mountfrom.options=rw,noatime
 > 
 > Manual root filesystem specification:
 >   <fstype>:<device> [options]
 >       Mount <device> using filesystem <fstype>
 >       and with the specified (optional) option list.
 > 
 >     eg. ufs:/dev/da0s1a
 >         zfs:tank
 >         cd9660:/dev/acd0 ro
 >           (which is equivalent to: mount -t cd9660 -o ro /dev/acd0 /)
 > 
 >   ?               List valid disk boot devices
 >   .               Yield 1 second (for background tasks)
 >   <empty line>    Abort manual input
 > 
 > mountroot> 
 > 
 > >Release-Note:
 > >Audit-Trail:
 > >Unformatted:
 
 A little background that may or may not be helpful in investigating this
 problem...
 
 We have long had a problem with mysterious sdcard timeout errors on RPi
 that doesn't happen on other hardware with sdhci controllers.  Until
 now, it was thought that these timeouts always occurred shortly after
 the controller was initialized by the OS.  The timeouts would affect the
 early card-detection sequences; we worked around them by adding
 automatic retries to the mmc code that identifies and initializes cards.
 
 This error appears to be a timeout that occurs after the card init
 sequences are done (the errors are reported by mmcsd0, not mmc0).
 
 

From: =?ISO-8859-1?Q?Eddy_Beaupr=E9?= <eddy@beaupre.biz>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: arm/181601: Sporadic failure of root mount on ARM/Raspberry
Date: Sat, 12 Oct 2013 09:08:06 -0400

 I can confirm the same issue exist on FreeBSD-11, here's the boot log:
 
 U-Boot 2013.01-rc1-g6709570-dirty (Oct 11 2013 - 00:06:34)
 
 DRAM:  224 MiB
 WARNING: Caches not enabled
 MMC:   bcm2835_sdhci: 0
 Using default environment
 
 In:    serial
 Out:   lcd
 Err:   lcd
 mbox: Timeout waiting for response
 bcm2835: Could not set USB power state
 Net:   Net Initialization Skipped
 No ethernet found.
 Hit any key to stop autoboot:  0
 reading uEnv.txt
 89 bytes read in 9690 ms (0 Bytes/s)
 Importing environment from mmc ...
 reading ubldr
 238986 bytes read in 53873 ms (3.9 KiB/s)
 ## Starting application at 0x02000054 ...
 Consoles: U-Boot console
 Compatible API signature found @db682a8
 Number of U-Boot devices: 1
 
 FreeBSD/armv6 U-Boot loader, Revision 1.2
 (root@vfs.beaupre.biz, Sat Oct 12 08:46:38 EDT 2013)
 DRAM:    224MB
 
 Device: disk
 Loading /boot/defaults/loader.conf
 /boot/kernel/kernel data=0x495f64+0x47428 syms=[0x4+0x83b60+0x4+0x4edde]
 
 Hit [Enter] to boot immediately, or any other key for command prompt.
 Booting [/boot/kernel/kernel]...
 Using DTB provided by U-Boot.
 Kernel entry at 0x100100...
 Kernel args: (null)
 KDB: debugger backends: ddb
 KDB: current backend: ddb
 Copyright (c) 1992-2013 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 is a registered trademark of The FreeBSD Foundation.
 FreeBSD 11.0-CURRENT #0 r256372: Sat Oct 12 08:43:05 EDT 2013
 root@vfs.beaupre.biz:/root/crochet-freebsd/work/obj/arm.armv6/root/crochet-freebsd/src/sys/RPI-B 
 arm
 FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
 CPU: ARM1176JZ-S rev 7 (ARM11J core)
   Supported features: ARM_ISA THUMB2 JAZELLE ARMv4 Security_Ext
   WB enabled LABT branch prediction enabled
    16KB/32B 4-way instruction cache
    16KB/32B 4-way write-back-locking-C data cache
 real memory  = 268435456 (256 MB)
 avail memory = 221831168 (211 MB)
 random device not loaded; using insecure entropy
 kbd0 at kbdmux0
 random: <Software, Yarrow> initialized
 simplebus0: <Flattened device tree simple bus> mem 0x20000000-0x20ffffff 
 on fdtbus0
 intc0: <BCM2835 Interrupt Controller> mem 0x2000b200-0x2000b3ff on 
 simplebus0
 systimer0: <BCM2835 System Timer> mem 0x20003000-0x20003fff irq 
 8,9,10,11 on simplebus0
 Event timer "BCM2835 Event Timer 3" frequency 1000000 Hz quality 1000
 Timecounter "BCM2835 Timecounter" frequency 1000000 Hz quality 1000
 bcmwd0: <BCM2708/2835 Watchdog> mem 0x2010001c-0x20100027 on simplebus0
 gpio0: <BCM2708/2835 GPIO controller> mem 0x20200000-0x202000af irq 
 57,59,58,60 on simplebus0
 gpio0: read-only pins: 46,47,48,49,50,51,52,53.
 gpio0: reserved pins: 48,49,50,51,52,53.
 gpioc0: <GPIO controller> on gpio0
 gpiobus0: <GPIO bus> on gpio0
 bcm_dma0: <BCM2835 DMA Controller> mem 
 0x20007000-0x20007fff,0x20e05000-0x20e05fff irq 
 24,25,26,27,28,29,30,31,32,33,34,35,36 on simplebus0
 mbox0: <BCM2835 VideoCore Mailbox> mem 0x2000b880-0x2000b8bf irq 1 on 
 simplebus0
 sdhci_bcm0: <Broadcom 2708 SDHCI controller> mem 0x20300000-0x203000ff 
 irq 70 on simplebus0
 mmc0: <MMC/SD bus> on sdhci_bcm0
 uart0: <PrimeCell UART (PL011)> mem 0x20201000-0x20201fff irq 65 on 
 simplebus0
 uart0: console (115200,n,8,1)
 dwcotg0: <DWC OTG 2.0 integrated USB controller> mem 
 0x20980000-0x2099ffff irq 17 on simplebus0
 usbus0 on dwcotg0
 fb0: <BCM2835 framebuffer device> on fdtbus0
 sc0: Unknown <16 virtual consoles, flags=0x300>
 simplebus1: <Flattened device tree simple bus> on fdtbus0
 Timecounters tick every 10.000 msec
 usbus0: 480Mbps High Speed USB v2.0
 ugen0.1: <DWCOTG> at usbus0
 uhub0: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
 mmcsd0: 16GB <SDHC SD16G 3.0 SN 1213219557 MFG 02/2013 by 130 JT> at 
 mmc0 50.0MHz/4bit/65535-block
 mmcsd0: Error indicated: 1 Timeout
 mmcsd0: Error indicated: 1 Timeout
 fb0: 656x416(0x0@0,0) 16bpp
 fb0: pitch 1312, base 0x4e006000, screen_size 545792
 Root mount waiting for: usbus0
 uhub0: 1 port with 1 removable, self powered
 Root mount waiting for: usbus0
 ugen0.2: <vendor 0x0424> at usbus0
 uhub1: <vendor 0x0424 product 0x9512, class 9/0, rev 2.00/2.00, addr 2> 
 on usbus0
 uhub1: MTT enabled
 uhub1: 3 ports with 2 removable, self powered
 Root mount waiting for: usbus0
 ugen0.3: <vendor 0x0424> at usbus0
 smsc0: <vendor 0x0424 product 0xec00, rev 2.00/2.00, addr 3> on usbus0
 Trying to mount root from ufs:/dev/mmcsd0s2a [rw,noatime]...
 mountroot: waiting for device /dev/mmcsd0s2a ...
 smsc0: chip 0xec00, rev. 0002
 miibus0: <MII bus> on smsc0
 ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
 ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 ue0: <USB Ethernet> on smsc0
 ue0: Ethernet address: b8:27:eb:2d:c8:bf
 Mounting from ufs:/dev/mmcsd0s2a failed with error 19.
 
 Loader variables:
    vfs.root.mountfrom=ufs:/dev/mmcsd0s2a
    vfs.root.mountfrom.options=rw,noatime
 
 Manual root filesystem specification:
    <fstype>:<device> [options]
        Mount <device> using filesystem <fstype>
        and with the specified (optional) option list.
 
      eg. ufs:/dev/da0s1a
          zfs:tank
          cd9660:/dev/acd0 ro
            (which is equivalent to: mount -t cd9660 -o ro /dev/acd0 /)
 
    ?               List valid disk boot devices
    .               Yield 1 second (for background tasks)
    <empty line>    Abort manual input
 
 mountroot>
 
 
 

From: Peter Jeremy <peter@rulingia.com>
To: Ian Lepore <ian@freebsd.org>
Cc: freebsd-arm@freebsd.org, freebsd-gnats-submit@freebsd.org
Subject: Re: arm/181601: Sporadic failure of root mount on ARM/Raspberry
Date: Sat, 8 Feb 2014 09:27:15 +1100

 --x+6KMIRAuhnl3hBn
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On 2013-Aug-28 12:30:00 +0000, Ian Lepore <ian@freebsd.org> wrote:
 > On Wed, 2013-08-28 at 05:35 +0000, Martin Laabs wrote:
 > > Trying to mount root from ufs:/dev/mmcsd0s2a [rw,noatime]...
 > > mountroot: waiting for device /dev/mmcsd0s2a ...
 > > smsc0: chip 0xec00, rev. 0002
 > > miibus0: <MII bus> on smsc0
 > > ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
 > > ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 > > ue0: <USB Ethernet> on smsc0
 > > ue0: Ethernet address: b8:27:eb:1d:b7:5a
 > > Mounting from ufs:/dev/mmcsd0s2a failed with error 19.
 > >=20
 > > Loader variables:
 > >   vfs.root.mountfrom=3Dufs:/dev/mmcsd0s2a
 > >   vfs.root.mountfrom.options=3Drw,noatime
 
 > We have long had a problem with mysterious sdcard timeout errors on RPi
 > that doesn't happen on other hardware with sdhci controllers.  Until
 > now, it was thought that these timeouts always occurred shortly after
 > the controller was initialized by the OS.  The timeouts would affect the
 > early card-detection sequences; we worked around them by adding
 > automatic retries to the mmc code that identifies and initializes cards.
 >=20
 > This error appears to be a timeout that occurs after the card init
 > sequences are done (the errors are reported by mmcsd0, not mmc0).
 
 I am seeing this fairly consistently on every second boot - which is rather
 annoying because I would like that RPi to reliably boot unattended.
 
 Does anyone have any suggestions for a workaround?
 
 --=20
 Peter Jeremy
 
 --x+6KMIRAuhnl3hBn
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (FreeBSD)
 
 iKYEARECAGYFAlL1XcNfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl
 bnBncC5maWZ0aGhvcnNlbWFuLm5ldDBCRjc3QTcyNTg5NEVCRTY0RjREN0VFRUZF
 OEE0N0JGRjAwRkI4ODcACgkQ/opHv/APuIfsgACgrjubepqhBbphlk5FMaE/Zs8u
 dpAAoMEGJmwHGBTzDqREdu8NDVGAr1an
 =8SxC
 -----END PGP SIGNATURE-----
 
 --x+6KMIRAuhnl3hBn--

From: Mats Erik Andersson <nokkaslys@gmail.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: arm/181601: Sporadic failure of root mount on ARM/Raspberry
Date: Sat, 8 Mar 2014 23:48:56 +0100

 --f46d043bdf9ce8e17504f4202ca5
 Content-Type: multipart/alternative; boundary=f46d043bdf9ce8e17204f4202ca3
 
 --f46d043bdf9ce8e17204f4202ca3
 Content-Type: text/plain; charset=ISO-8859-1
 
 Most probably this issue is caused by the clock frequency chosen
 by mmcsd(4) during setup. Success happens only with 25.0 MHz,
 while timeouts and failures are legio happen with 50.0 MHz.
 The appended text gives more details.
 
 Regards,
    Mats Erik Andersson
 
 --f46d043bdf9ce8e17204f4202ca3
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 <div dir=3D"ltr"><div><div><div><div><div>Most probably this issue is cause=
 d by the clock frequency chosen<br></div>by mmcsd(4) during setup. Success =
 happens only with 25.0 MHz,<br></div>while timeouts and failures are legio =
 happen with 50.0 MHz.<br>
 The appended text gives more details.<br></div><br></div>Regards,<br></div>=
 =A0=A0 Mats Erik Andersson<br></div>
 
 --f46d043bdf9ce8e17204f4202ca3--
 --f46d043bdf9ce8e17504f4202ca5
 Content-Type: text/plain; charset=US-ASCII; name="arm_sdhc.txt"
 Content-Disposition: attachment; filename="arm_sdhc.txt"
 Content-Transfer-Encoding: base64
 X-Attachment-Id: f_hsjhkf4n0
 
 CkkgaGF2ZSBzb21lIHJlbGV2YW50IG9ic2VydmF0aW9ucyBvbiB0aGlzIGlzc3VlLgpUb2RheSBJ
 IGhhdmUgdHJpZWQgdG8gZ2V0IHRoZSBzbmFwc2hvdHMKCiAgIDExLjAtQ1VSUkVOVC1hcm0tYXJt
 djYtUlBJLUItMjAxNDAyMDktcjI2MTY0MgoKICAgMTEuMC1DVVJSRU5ULWFybS1hcm12Ni1SUEkt
 Qi0yMDE0MDIyMi1yMjYyMzM2Cgpnb2luZy4gQm90aCBmYWlsZWQgdG8gbW91bnQgdGhlIHJvb3Qg
 ZmlsZSBzeXN0ZW0sIGluc3BpdGUgb2YKcmVwZWF0ZWQgZWZmb3J0cy4gSG93ZXZlciwKCiAgIDEw
 LjAtU1RBQkxFLWFybS1hcm12Ni1SUEktQi0yMDE0MDMwMS1yMjYyNjU3CgppcyBzb21ldGltZXMg
 YWJsZSB0byBib290LCBidXQgbm90IGFsd2F5cy4gVW5mb3J0dW5hdGVseSB0aGUgbWFjaGluZQpu
 ZXZlciBzdWNjZWVkcyBhZnRlciByZWJvb3QuIChCeSB0aGUgd2F5LCBjb250cmFyeSB0byBteSBl
 eHBlY3RhdGlvbiwKdGhpcyAxMC4wLVNUQUJMRSBpbWFnZSBydW5zIGEgY3VycmVudCBrZXJuZWwg
 MTEuMC1DVVJSRU5ULCByMjYyMzM2LikKCkl0IGlzIHJlbGV2YW50IHRvIHJlY2FsbCB0aGUga2Vy
 bmVsIG1lc3NhZ2VzIGNvbnRhaW5lZCBpbiB0aGUgcHJldmlvdXNseQptZXNzYWdlcyB0byB0aGlz
 IFBSOgoKICBtbWNzZDA6IDhHQiA8U0RIQyBOQ2FyZCAxLjAgU04gMTA3NTgzOTM4NCBNRkcgMDUv
 MjAxMyBieSAxMzAgSlQ+CiAgICBhdCBtbWMwIDUwLjBNSHovNGJpdC82NTUzNS1ibG9jawoKICBt
 bWNzZDA6IDE2R0IgPFNESEMgU0QxNkcgMy4wIFNOIDEyMTMyMTk1NTcgTUZHIDAyLzIwMTMgYnkg
 MTMwIEpUPgogICAgYXQgbW1jMCA1MC4wTUh6LzRiaXQvNjU1MzUtYmxvY2sKClNpbWlsYXJseSwg
 bXkgY2FyZCwgYSBLaW5nc3RvbiBTREhDIDhHQiwgY2xhc3MgU0Q0LCBtb2RlbCBTRC1LMDhHLApn
 ZW5lcmF0ZXMgdGhlIGZvbGxvd2luZyBtZXNzYWdlIHdoZW4gdGhlIHJvb3QgbW91bnQgZmFpbHM6
 CgogIG1tY3NkMDogOEdCIDxTREhDIFNBMDhHIDEuMSBTTiAxMTI0MTE1NTgyIE1GRyAwNy8yMDEz
 IGJ5IDIgVE0+CiAgICBhdCBtbWMwIDUwLjBNSHovNGJpdC82NTUzNS1ibG9jawoKSW4gY29udHJh
 c3QsIHRoZSBtZXNzYWdlIG9uIHN1Y2Nlc3NmdWwgYm9vdCBpcyB0aGlzOgoKICBtbWNzZDA6IDhH
 QiA8U0RIQyBTQTA4RyAxLjEgU04gMTEyNDExNTU4MiBNRkcgMDcvMjAxMyBieSAyIFRNPgogICAg
 YXQgbW1jMCAyNS4wTUh6LzRiaXQvNjU1MzUtYmxvY2sKClRoZSBkaWZmZXJlbmNlIGlzIG1pbnV0
 ZTogMjUuME1IeiBpbnN0ZWFkIG9mIDUwLk1IeiEKCkkgaW50ZXJwcmV0IHRoaXMgaW4gdGhlIHdh
 eSB0aGF0IHRoZSBjYXJkIGlzIGZ1bmN0aW9uYWwsIGFzIGxvbmcKYXMgdGhlIGRyaXZlciBtbWNz
 ZCg0KSBzZWVzIGEgcmVhc29uIHRvIGFzc2lnbiB0aGUgU0QgZGVmYXVsdApzcGVlZCwgaS5lLiwg
 MjUuME1Ieiwgd2hpbGUgdGhlIGNhcmQgc2VlbWluZ2x5IGZhaWxzIGZyZXF1ZW50bHksCnNob3Vs
 ZCB0aGUgZHJpdmVyIHJlcXVlc3QgdGhlIG5leHQgcmF0ZSA1MC4wTUh6LiBQcm9iYWJseSB0aGUK
 aXNzdWUgY291bGQgYmUgcmVzb2x2ZWQgYnkgcmVmaW5pbmcgdGhlIGRldGVjdGlvbiBhbGdvcml0
 aG0KZm9yIGNhbGN1bGF0aW5nIGNsb2NrIGZyZXF1ZW5jeS4K
 --f46d043bdf9ce8e17504f4202ca5--

From: Harald Weppner <harald.weppner@tidalscale.com>
To: "bug-followup@FreeBSD.org" <bug-followup@FreeBSD.org>,
	"info@martinlaabs.de" <info@martinlaabs.de>
Cc:  
Subject: Re: arm/181601: Sporadic failure of root mount on ARM/Raspberry
Date: Mon, 21 Apr 2014 18:38:08 +0000

 --Apple-Mail=_79838C36-3AC2-44A1-89DC-2BB5E7BC29A7
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
 	charset=windows-1252
 
 Hi,
 
 I=92ve been able to work around it by disabling high speed in a device =
 hint (hw.bcm2835.sdhci.hs=3D0) but was wondering if any progress on this =
 issue was made?
 
 Thanks & cheerio, Harry.
 
 --Apple-Mail=_79838C36-3AC2-44A1-89DC-2BB5E7BC29A7
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename="signature.asc"
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: Message signed with OpenPGP using GPGMail
 
 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - https://gpgtools.org
 
 iQEcBAEBCgAGBQJTVWWXAAoJEAK2yI4LwMAXNYcIAKqr2Z2p2/OsPRx015kaA8a0
 NGahOiMwv0UBXlbqmFL5Ux0uNKR89Uo2615ptlfj0i9KhzkR6s/4kTFDTOJGtUX4
 oNGgVzHodXHk360JQBDZoTobUNga35/0jt78buWD8RdBE8SudlgRqr6hE2v29iuD
 LZ3Wsb6By5VQ5tlxotlI73fFwvCIap4xwn/5oKoHNPVP0n2AsfzVo+Bsub2phVG5
 2CTWphia4NEYDbjgJ29N53tRTfjx6Y05vd0uu6A2f9GuiyCDfObmbDChEP2iaxrF
 WENgH2AQSdLD1SeDIK8L1pnujiStBvuSTDRphdB7wQGwYMo3V4Cl4I7NfP4+GuQ=
 =//j+
 -----END PGP SIGNATURE-----
 
 --Apple-Mail=_79838C36-3AC2-44A1-89DC-2BB5E7BC29A7--
>Unformatted:
