Discussion:
ATA_CAM-ed mvsata(4) on OpenRD-client
(too old to reply)
Norikatsu Shigemura
2010-02-17 17:39:45 UTC
Permalink
Hi mav!

I got a OpenRD-client (Marvell 88F6281 SoC), and I'm tring to
make mvsata(4) ATA_CAM, like following:

based on sys/arm/conf/DB-88F6XXX
- - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# SATA
#device ata
#device atadisk
device atacore
device atamvsata
options ATA_CAM
- - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

But I got following panic, my I help you?
In this time, I attached no devices to SATA/eSATA port.
- - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sata0: <Marvell Integrated SATA Controller> at mem 0xf1080000-0xf1085fff irq 21 on mbus0
sata0: [MPSAFE]
sata0: [ITHREAD]
ata0: <Marvell Integrated SATA Channel> on sata0
ata0: [MPSAFE]
ata0: [ITHREAD]
ata1: <Marvell Integrated SATA Channel> on sata0
ata1: [MPSAFE]
ata1: [ITHREAD]
spin lock 0xc3766680 (fvH) held by 0xc3613b48 (tid -1061308344) too long
panic: spin lock held too long
KDB: enter: panic
[ thread pid 0 tid 100000 ]
Stopped at 0xc09dcb50 = kdb_enter+0x48: ldrb r15, [r15, r15, ror r15]!
db>
- - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

So I tried to get following information:
- - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
db> show locks
exclusive sleep mutex Giant (Giant) r = 0 (0xc0be3ad4) locked @ /usr/src/sys/kern/kern_module.c:117
db> show alllocks
Process 0 (kernel) thread 0xc0be1fa0 (100000)
exclusive sleep mutex Giant (Giant) r = 0 (0xc0be3ad4) locked @ /usr/src/sys/kern/kern_module.c:117
db> show lockedvnods
Locked vnodes
db> show pcpu
cpuid = 0
dynamic pcpu = 0x17fc00
curthread = 0xc0be1fa0: pid 0 "swapper"
curpcb = 0xc0d62ef8
fpcurthread = none
idlethread = 0xc357bd80: pid 10 "idle"
spin locks held:
db> bt
Tracing pid 0 tid 100000 td 0xc0be1fa0
kdb_enter() at 0xc09dcb18 = kdb_enter+0x10
scp=0xc09dcb18 rlv=0xc09b2cf0 (0xc09b2cf0 = panic+0xcc)
rsp=0xc0d62c1c rfp=0xc0d62c30
r4=0x00000100
panic() at 0xc09b2c38 = panic+0x14
scp=0xc09b2c38 rlv=0xc09a6fb8 (0xc09a6fb8 = _thread_lock_flags+0x170)
rsp=0xc0d62c44 rfp=0xc0d62c8c
_thread_lock_flags() at 0xc09a6e58 = _thread_lock_flags+0x10
scp=0xc09a6e58 rlv=0xc09e9e98 (0xc09e9e98 = turnstile_claim+0x174)
rsp=0xc0d62c90 rfp=0xc0d62cac
r10=0xc3556000 r9=0x00000000
r8=0xc3556000 r7=0x00000044 r6=0xc3556000 r5=0xc3766680
r4=0xc0b644c0
turnstile_claim() at 0xc09e9e40 = turnstile_claim+0x11c
scp=0xc09e9e40 rlv=0xc09ea17c (0xc09ea17c = turnstile_wait+0x208)
rsp=0xc0d62cb0 rfp=0xc0d62cdc
r7=0xc0be1fa0 r6=0xc0be8e40
r5=0xc0b644c0 r4=0x00000000
turnstile_wait() at 0xc09e9f84 = turnstile_wait+0x10
scp=0xc09e9f84 rlv=0xc09a6b30 (0xc09a6b30 = _mtx_lock_sleep+0x11c)
rsp=0xc0d62ce0 rfp=0xc0d62d10
r10=0xc0b47100 r9=0x00000000
r8=0x00000000 r7=0x00000000 r6=0xc0be1fa0 r5=0xc3556000
r4=0xc35dd974
_mtx_lock_sleep() at 0xc09a6a24 = _mtx_lock_sleep+0x10
scp=0xc09a6a24 rlv=0xc09a6c0c (0xc09a6c0c = _mtx_lock_flags+0x7c)
rsp=0xc0d62d14 rfp=0xc0d62d3c
r10=0xc0d62d70 r9=0xc09039a8
r8=0x00000000 r7=0x00000851 r6=0xc0b47100 r5=0x00000000
r4=0xc35dd974
_mtx_lock_flags() at 0xc09a6ba0 = _mtx_lock_flags+0x10
scp=0xc09a6ba0 rlv=0xc0903fac (0xc0903fac = xpt_sim_opened+0x17c)
rsp=0xc0d62d40 rfp=0xc0d62d68
r8=0xc0bde8f0 r7=0xc090d4a4
r6=0xc3765e00 r5=0xc0b47100 r4=0xc3766240
xpt_sim_opened() at 0xc0903f3c = xpt_sim_opened+0x10c
scp=0xc0903f3c rlv=0xc0904068 (0xc0904068 = xpt_sim_opened+0x238)
rsp=0xc0d62d6c rfp=0xc0d62d88
r10=0xc0bde904 r9=0xc0b47100
r8=0x00000000 r7=0xc090d4a4 r6=0x00000080 r5=0x00000000
r4=0x00000001
xpt_sim_opened() at 0xc0904048 = xpt_sim_opened+0x218
scp=0xc0904048 rlv=0xc0905940 (0xc0905940 = xpt_register_async+0xd0)
rsp=0xc0d62d8c rfp=0xc0d62e34
xpt_register_async() at 0xc0905880 = xpt_register_async+0x10
scp=0xc0905880 rlv=0xc090d484 (0xc090d484 = ata_get_xport+0x2198)
rsp=0xc0d62e38 rfp=0xc0d62e44
r10=0x00000000 r9=0x00000000
r8=0x005fffcc r7=0xc35593c0 r6=0xc0b62170 r5=0xc0be74d0
r4=0x0000001c
ata_get_xport() at 0xc090d474 = ata_get_xport+0x2188
scp=0xc090d474 rlv=0xc0900868 (0xc0900868 = periphdriver_init+0x60)
rsp=0xc0d62e48 rfp=0xc0d62e58
periphdriver_init() at 0xc0900818 = periphdriver_init+0x10
scp=0xc0900818 rlv=0xc0904584 (0xc0904584 = xpt_alloc_ccb+0x6c)
rsp=0xc0d62e5c rfp=0xc0d62e74
r4=0x00000000
xpt_alloc_ccb() at 0xc0904554 = xpt_alloc_ccb+0x3c
scp=0xc0904554 rlv=0xc09d2d9c (0xc09d2d9c = vaccess_acl_posix1e+0x628)
rsp=0xc0d62e78 rfp=0xc0d62ee0
r4=0x00000000
vaccess_acl_posix1e() at 0xc09d2d44 = vaccess_acl_posix1e+0x5d0
scp=0xc09d2d44 rlv=0xc097b0ec (0xc097b0ec = mi_startup+0xdc)
rsp=0xc0d62ee4 rfp=0xc0d62ef4
r7=0x00900040 r6=0x00000002
r5=0x0090004c r4=0xc0b7e88c
mi_startup() at 0xc097b020 = mi_startup+0x10
scp=0xc097b020 rlv=0xc09000e4 (0xc09000e4 = btext+0xe4)
rsp=0xc0d62ef8 rfp=0x00000000
r4=0x00900124
db> ps
pid ppid pgrp uid state wmesg wchan cmd
13 0 0 0 RL (threaded) [usb]
100021 RunQ [usbus0]
100020 RunQ [usbus0]
100019 RunQ [usbus0]
100018 RunQ [usbus0]
12 0 0 0 RL [yarrow]
4 0 0 0 RL [g_down]
3 0 0 0 RL [g_up]
2 0 0 0 RL [g_event]
11 0 0 0 WL (threaded) [intr]
100026 I [intr21: sata0]
100025 I [intr17: mge1]
100024 I [intr16: mge1]
100023 I [intr13: mge0]
100022 I [intr12: mge0]
100017 I [intr19: ehci0]
100016 I [swi0: uart uart]
100015 I [swi6: Giant taskq]
100013 I [swi5: +]
100011 I [swi2: cambio]
100010 I [swi6: task queue]
100005 I [swi1: netisr 0]
100004 I [swi4: clock]
100003 I [swi3: vm]
10 0 0 0 RL [idle]
1 0 0 0 ?L [kernel]
0 0 0 0 RLs (threaded) [kernel]
100014 RunQ [thread taskq]
100012 RunQ [kqueue taskq]
100000 L *fvH 0xc3556000 [swapper]
db> alltrace

Tracing command usb pid 13 tid 100021 td 0xc35ff480

Tracing command usb pid 13 tid 100020 td 0xc35ff6c0

Tracing command usb pid 13 tid 100019 td 0xc35ff900

Tracing command usb pid 13 tid 100018 td 0xc35ffb40

Tracing command yarrow pid 12 tid 100009 td 0xc35c2480

Tracing command g_down pid 4 tid 100008 td 0xc357b000

Tracing command g_up pid 3 tid 100007 td 0xc357b240

Tracing command g_event pid 2 tid 100006 td 0xc357b480

Tracing command intr pid 11 tid 100026 td 0xc35c2900

Tracing command intr pid 11 tid 100025 td 0xc35c2b40

Tracing command intr pid 11 tid 100024 td 0xc35c2d80

Tracing command intr pid 11 tid 100023 td 0xc35ff000

Tracing command intr pid 11 tid 100022 td 0xc35ff240

Tracing command intr pid 11 tid 100017 td 0xc357c240

Tracing command intr pid 11 tid 100016 td 0xc357c480

Tracing command intr pid 11 tid 100015 td 0xc357c6c0

Tracing command intr pid 11 tid 100013 td 0xc357cb40

Tracing command intr pid 11 tid 100011 td 0xc35c2000

Tracing command intr pid 11 tid 100010 td 0xc35c2240

Tracing command intr pid 11 tid 100005 td 0xc357b6c0

Tracing command intr pid 11 tid 100004 td 0xc357b900

Tracing command intr pid 11 tid 100003 td 0xc357bb40

Tracing command idle pid 10 tid 100002 td 0xc357bd80

Tracing command kernel pid 1 tid 100001 td 0xc357c000

Tracing command kernel pid 0 tid 100014 td 0xc357c900

Tracing command kernel pid 0 tid 100012 td 0xc357cd80

Tracing command kernel pid 0 tid 100000 td 0xc0be1fa0
kdb_enter() at 0xc09dcb18 = kdb_enter+0x10
scp=0xc09dcb18 rlv=0xc09b2cf0 (0xc09b2cf0 = panic+0xcc)
rsp=0xc0d62c1c rfp=0xc0d62c30
r4=0x00000100
panic() at 0xc09b2c38 = panic+0x14
scp=0xc09b2c38 rlv=0xc09a6fb8 (0xc09a6fb8 = _thread_lock_flags+0x170)
rsp=0xc0d62c44 rfp=0xc0d62c8c
_thread_lock_flags() at 0xc09a6e58 = _thread_lock_flags+0x10
scp=0xc09a6e58 rlv=0xc09e9e98 (0xc09e9e98 = turnstile_claim+0x174)
rsp=0xc0d62c90 rfp=0xc0d62cac
r10=0xc3556000 r9=0x00000000
r8=0xc3556000 r7=0x00000044 r6=0xc3556000 r5=0xc3766680
r4=0xc0b644c0
turnstile_claim() at 0xc09e9e40 = turnstile_claim+0x11c
scp=0xc09e9e40 rlv=0xc09ea17c (0xc09ea17c = turnstile_wait+0x208)
rsp=0xc0d62cb0 rfp=0xc0d62cdc
r7=0xc0be1fa0 r6=0xc0be8e40
r5=0xc0b644c0 r4=0x00000000
turnstile_wait() at 0xc09e9f84 = turnstile_wait+0x10
scp=0xc09e9f84 rlv=0xc09a6b30 (0xc09a6b30 = _mtx_lock_sleep+0x11c)
rsp=0xc0d62ce0 rfp=0xc0d62d10
r10=0xc0b47100 r9=0x00000000
r8=0x00000000 r7=0x00000000 r6=0xc0be1fa0 r5=0xc3556000
r4=0xc35dd974
_mtx_lock_sleep() at 0xc09a6a24 = _mtx_lock_sleep+0x10
scp=0xc09a6a24 rlv=0xc09a6c0c (0xc09a6c0c = _mtx_lock_flags+0x7c)
rsp=0xc0d62d14 rfp=0xc0d62d3c
r10=0xc0d62d70 r9=0xc09039a8
r8=0x00000000 r7=0x00000851 r6=0xc0b47100 r5=0x00000000
r4=0xc35dd974
_mtx_lock_flags() at 0xc09a6ba0 = _mtx_lock_flags+0x10
scp=0xc09a6ba0 rlv=0xc0903fac (0xc0903fac = xpt_sim_opened+0x17c)
rsp=0xc0d62d40 rfp=0xc0d62d68
r8=0xc0bde8f0 r7=0xc090d4a4
r6=0xc3765e00 r5=0xc0b47100 r4=0xc3766240
xpt_sim_opened() at 0xc0903f3c = xpt_sim_opened+0x10c
scp=0xc0903f3c rlv=0xc0904068 (0xc0904068 = xpt_sim_opened+0x238)
rsp=0xc0d62d6c rfp=0xc0d62d88
r10=0xc0bde904 r9=0xc0b47100
r8=0x00000000 r7=0xc090d4a4 r6=0x00000080 r5=0x00000000
r4=0x00000001
xpt_sim_opened() at 0xc0904048 = xpt_sim_opened+0x218
scp=0xc0904048 rlv=0xc0905940 (0xc0905940 = xpt_register_async+0xd0)
rsp=0xc0d62d8c rfp=0xc0d62e34
xpt_register_async() at 0xc0905880 = xpt_register_async+0x10
scp=0xc0905880 rlv=0xc090d484 (0xc090d484 = ata_get_xport+0x2198)
rsp=0xc0d62e38 rfp=0xc0d62e44
r10=0x00000000 r9=0x00000000
r8=0x005fffcc r7=0xc35593c0 r6=0xc0b62170 r5=0xc0be74d0
r4=0x0000001c
ata_get_xport() at 0xc090d474 = ata_get_xport+0x2188
scp=0xc090d474 rlv=0xc0900868 (0xc0900868 = periphdriver_init+0x60)
rsp=0xc0d62e48 rfp=0xc0d62e58
periphdriver_init() at 0xc0900818 = periphdriver_init+0x10
scp=0xc0900818 rlv=0xc0904584 (0xc0904584 = xpt_alloc_ccb+0x6c)
rsp=0xc0d62e5c rfp=0xc0d62e74
r4=0x00000000
xpt_alloc_ccb() at 0xc0904554 = xpt_alloc_ccb+0x3c
scp=0xc0904554 rlv=0xc09d2d9c (0xc09d2d9c = vaccess_acl_posix1e+0x628)
rsp=0xc0d62e78 rfp=0xc0d62ee0
r4=0x00000000
vaccess_acl_posix1e() at 0xc09d2d44 = vaccess_acl_posix1e+0x5d0
scp=0xc09d2d44 rlv=0xc097b0ec (0xc097b0ec = mi_startup+0xdc)
rsp=0xc0d62ee4 rfp=0xc0d62ef4
r7=0x00900040 r6=0x00000002
r5=0x0090004c r4=0xc0b7e88c
mi_startup() at 0xc097b020 = mi_startup+0x10
scp=0xc097b020 rlv=0xc09000e4 (0xc09000e4 = btext+0xe4)
rsp=0xc0d62ef8 rfp=0x00000000
r4=0x00900124
db> show lock 0xc0be3ad4
class: sleep mutex
name: Giant
flags: {DEF, RECURSE}
state: {OWNED}
owner: 0xc0be1fa0 (tid 100000, pid 0, "swapper")
db >
- - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

What you want to know? Plase teach me, I'll dump what you want.
Alexander Motin
2010-02-19 20:36:12 UTC
Permalink
Hi.
Post by Norikatsu Shigemura
I got a OpenRD-client (Marvell 88F6281 SoC), and I'm tring to
But I got following panic, my I help you?
In this time, I attached no devices to SATA/eSATA port.
- - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sata0: <Marvell Integrated SATA Controller> at mem 0xf1080000-0xf1085fff irq 21 on mbus0
sata0: [MPSAFE]
sata0: [ITHREAD]
ata0: <Marvell Integrated SATA Channel> on sata0
ata0: [MPSAFE]
ata0: [ITHREAD]
ata1: <Marvell Integrated SATA Channel> on sata0
ata1: [MPSAFE]
ata1: [ITHREAD]
spin lock 0xc3766680 (fvH) held by 0xc3613b48 (tid -1061308344) too long
panic: spin lock held too long
KDB: enter: panic
[ thread pid 0 tid 100000 ]
Stopped at 0xc09dcb50 = kdb_enter+0x48: ldrb r15, [r15, r15, ror r15]!
db>
A bit unexpected.
Post by Norikatsu Shigemura
- - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_mtx_lock_sleep() at 0xc09a6a24 = _mtx_lock_sleep+0x10
scp=0xc09a6a24 rlv=0xc09a6c0c (0xc09a6c0c = _mtx_lock_flags+0x7c)
rsp=0xc0d62d14 rfp=0xc0d62d3c
r10=0xc0d62d70 r9=0xc09039a8
r8=0x00000000 r7=0x00000851 r6=0xc0b47100 r5=0x00000000
r4=0xc35dd974
_mtx_lock_flags() at 0xc09a6ba0 = _mtx_lock_flags+0x10
scp=0xc09a6ba0 rlv=0xc0903fac (0xc0903fac = xpt_sim_opened+0x17c)
rsp=0xc0d62d40 rfp=0xc0d62d68
r8=0xc0bde8f0 r7=0xc090d4a4
r6=0xc3765e00 r5=0xc0b47100 r4=0xc3766240
xpt_sim_opened() at 0xc0903f3c = xpt_sim_opened+0x10c
scp=0xc0903f3c rlv=0xc0904068 (0xc0904068 = xpt_sim_opened+0x238)
rsp=0xc0d62d6c rfp=0xc0d62d88
r10=0xc0bde904 r9=0xc0b47100
r8=0x00000000 r7=0xc090d4a4 r6=0x00000080 r5=0x00000000
r4=0x00000001
xpt_sim_opened() at 0xc0904048 = xpt_sim_opened+0x218
scp=0xc0904048 rlv=0xc0905940 (0xc0905940 = xpt_register_async+0xd0)
rsp=0xc0d62d8c rfp=0xc0d62e34
xpt_register_async() at 0xc0905880 = xpt_register_async+0x10
scp=0xc0905880 rlv=0xc090d484 (0xc090d484 = ata_get_xport+0x2198)
rsp=0xc0d62e38 rfp=0xc0d62e44
r10=0x00000000 r9=0x00000000
r8=0x005fffcc r7=0xc35593c0 r6=0xc0b62170 r5=0xc0be74d0
r4=0x0000001c
Even more unexpected. I've searched all sources for xpt_sim_opened()
call and found only one place - in atapi-cam.c, which shouldn't be used
in your case. You are using different sources, or there is a garbage in
stack?
--
Alexander Motin
M. Warner Losh
2010-02-19 21:43:19 UTC
Permalink
In message: <***@FreeBSD.org>
Alexander Motin <***@FreeBSD.org> writes:
: Hi.
:
: Norikatsu Shigemura wrote:
: > I got a OpenRD-client (Marvell 88F6281 SoC), and I'm tring to
: > make mvsata(4) ATA_CAM, like following:
: >
: > But I got following panic, my I help you?
: > In this time, I attached no devices to SATA/eSATA port.
: > - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
: > sata0: <Marvell Integrated SATA Controller> at mem 0xf1080000-0xf1085fff irq 21 on mbus0
: > sata0: [MPSAFE]
: > sata0: [ITHREAD]
: > ata0: <Marvell Integrated SATA Channel> on sata0
: > ata0: [MPSAFE]
: > ata0: [ITHREAD]
: > ata1: <Marvell Integrated SATA Channel> on sata0
: > ata1: [MPSAFE]
: > ata1: [ITHREAD]
: > spin lock 0xc3766680 (fvH) held by 0xc3613b48 (tid -1061308344) too long
: > panic: spin lock held too long
: > KDB: enter: panic
: > [ thread pid 0 tid 100000 ]
: > Stopped at 0xc09dcb50 = kdb_enter+0x48: ldrb r15, [r15, r15, ror r15]!
: > db>
:
: A bit unexpected.
:
: > - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
: >
: > So I tried to get following information:
: > - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
: > _mtx_lock_sleep() at 0xc09a6a24 = _mtx_lock_sleep+0x10
: > scp=0xc09a6a24 rlv=0xc09a6c0c (0xc09a6c0c = _mtx_lock_flags+0x7c)
: > rsp=0xc0d62d14 rfp=0xc0d62d3c
: > r10=0xc0d62d70 r9=0xc09039a8
: > r8=0x00000000 r7=0x00000851 r6=0xc0b47100 r5=0x00000000
: > r4=0xc35dd974
: > _mtx_lock_flags() at 0xc09a6ba0 = _mtx_lock_flags+0x10
: > scp=0xc09a6ba0 rlv=0xc0903fac (0xc0903fac = xpt_sim_opened+0x17c)
: > rsp=0xc0d62d40 rfp=0xc0d62d68
: > r8=0xc0bde8f0 r7=0xc090d4a4
: > r6=0xc3765e00 r5=0xc0b47100 r4=0xc3766240
: > xpt_sim_opened() at 0xc0903f3c = xpt_sim_opened+0x10c
: > scp=0xc0903f3c rlv=0xc0904068 (0xc0904068 = xpt_sim_opened+0x238)
: > rsp=0xc0d62d6c rfp=0xc0d62d88
: > r10=0xc0bde904 r9=0xc0b47100
: > r8=0x00000000 r7=0xc090d4a4 r6=0x00000080 r5=0x00000000
: > r4=0x00000001
: > xpt_sim_opened() at 0xc0904048 = xpt_sim_opened+0x218
: > scp=0xc0904048 rlv=0xc0905940 (0xc0905940 = xpt_register_async+0xd0)
: > rsp=0xc0d62d8c rfp=0xc0d62e34
: > xpt_register_async() at 0xc0905880 = xpt_register_async+0x10
: > scp=0xc0905880 rlv=0xc090d484 (0xc090d484 = ata_get_xport+0x2198)
: > rsp=0xc0d62e38 rfp=0xc0d62e44
: > r10=0x00000000 r9=0x00000000
: > r8=0x005fffcc r7=0xc35593c0 r6=0xc0b62170 r5=0xc0be74d0
: > r4=0x0000001c
:
: Even more unexpected. I've searched all sources for xpt_sim_opened()
: call and found only one place - in atapi-cam.c, which shouldn't be used
: in your case. You are using different sources, or there is a garbage in
: stack?

IIRC, I got better stack traces when I used the kernel.tramp kernel...

Warner
Norikatsu Shigemura
2010-02-20 17:23:40 UTC
Permalink
Hi Warner-san.

On Fri, 19 Feb 2010 14:43:19 -0700 (MST)
Post by M. Warner Losh
: Even more unexpected. I've searched all sources for xpt_sim_opened()
: call and found only one place - in atapi-cam.c, which shouldn't be used
: in your case. You are using different sources, or there is a garbage in
: stack?
IIRC, I got better stack traces when I used the kernel.tramp kernel...
How do I use kernel.tramp?
I did 'tftpboot 0x900000 kernel.tramp.bin' on uboot, but it's
freeze after 'go 0x900000'.
Norikatsu Shigemura
2010-02-25 16:47:18 UTC
Permalink
Hi mav.

On Fri, 19 Feb 2010 22:36:12 +0200
Post by Alexander Motin
Post by Norikatsu Shigemura
xpt_sim_opened() at 0xc0904048 = xpt_sim_opened+0x218
scp=0xc0904048 rlv=0xc0905940 (0xc0905940 = xpt_register_async+0xd0)
rsp=0xc0d62d8c rfp=0xc0d62e34
xpt_register_async() at 0xc0905880 = xpt_register_async+0x10
scp=0xc0905880 rlv=0xc090d484 (0xc090d484 = ata_get_xport+0x2198)
rsp=0xc0d62e38 rfp=0xc0d62e44
r10=0x00000000 r9=0x00000000
r8=0x005fffcc r7=0xc35593c0 r6=0xc0b62170 r5=0xc0be74d0
r4=0x0000001c
Even more unexpected. I've searched all sources for xpt_sim_opened()
call and found only one place - in atapi-cam.c, which shouldn't be used
in your case. You are using different sources, or there is a garbage in
stack?
I tried to printf-debug, so I got what's happen.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
module_register_init: MOD_LOAD(elf32) called in
module_register_init: MOD_LOAD(elf32 on elf kernel/elf kernel) called out
module_register_init: MOD_LOAD(shell) called in
module_register_init: MOD_LOAD(shell on elf kernel/elf kernel) called out
module_register_init: MOD_LOAD(if_lo) called in
module_register_init: MOD_LOAD(if_lo on elf kernel/elf kernel) called out
lo0: bpf attached
[DEBUG] xpt_config called #4501@/usr/src/sys/cam/cam_xpt.c
[DEBUG] xpt_config #4532@/usr/src/sys/cam/cam_xpt.c
[DEBUG] xpt_config #4538@/usr/src/sys/cam/cam_xpt.c
[DEBUG] periphdriver_init(1), init = 1 #132@/usr/src/sys/cam/cam_periph.c
[DEBUG] periphdriver_init:, i = 0, driver_name = ada
[DEBUG] periphdriver_init:, i = 1, driver_name = probe
[DEBUG] periphdriver_init:, i = 2, driver_name = pmp
spin lock 0xc3789100 () held by 0xc3632348 (tid 0) too long
panic: spin lock held too long
KDB: enter: panic
[ thread pid 0 tid 100000 ]
Stopped at 0xc09dede0 = kdb_enter+0x48: ldrb r15, [r15, r15, ror r15]!
db> show lock 0xc3789100
class: spin mutex
name:
flags: {SPIN, RECURSE}
state: {OWNED}
owner: 0xc3632348 (tid 0, pid 0, "")
recursed: -251133952
db> bt
Tracing pid 0 tid 100000 td 0xc0be6ab0
kdb_enter() at 0xc09deda8 = kdb_enter+0x10
scp=0xc09deda8 rlv=0xc09b572c (0xc09b572c = panic+0xcc)
rsp=0xc0d6ec10 rfp=0xc0d6ec24
r4=0x00000100
panic() at 0xc09b5674 = panic+0x14
scp=0xc09b5674 rlv=0xc09a99fc (0xc09a99fc = _thread_lock_flags+0x170)
rsp=0xc0d6ec38 rfp=0xc0d6ec80
_thread_lock_flags() at 0xc09a989c = _thread_lock_flags+0x10
scp=0xc09a989c rlv=0xc09ec7c0 (0xc09ec7c0 = turnstile_claim+0x16c)
rsp=0xc0d6ec84 rfp=0xc0d6eca0
r10=0xc0bf244c r9=0x00000000
r8=0xc3562000 r7=0x00000044 r6=0xc3562000 r5=0xc3789100
r4=0xc0b68548
turnstile_claim() at 0xc09ec768 = turnstile_claim+0x114
scp=0xc09ec768 rlv=0xc09ecad8 (0xc09ecad8 = turnstile_wait+0x23c)
rsp=0xc0d6eca4 rfp=0xc0d6eccc
r7=0xc0be6ab0 r6=0xc3789100
r5=0xc0b68548 r4=0x00000000
turnstile_wait() at 0xc09ec8ac = turnstile_wait+0x10
scp=0xc09ec8ac rlv=0xc09a9568 (0xc09a9568 = _mtx_lock_sleep+0x11c)
rsp=0xc0d6ecd0 rfp=0xc0d6ed00
r10=0xc0b4aa58 r9=0x00000000
r8=0x00000000 r7=0x00000000 r6=0xc0be6ab0 r5=0xc3562000
r4=0xc35fe974
_mtx_lock_sleep() at 0xc09a945c = _mtx_lock_sleep+0x10
scp=0xc09a945c rlv=0xc09a9650 (0xc09a9650 = _mtx_lock_flags+0x88)
rsp=0xc0d6ed04 rfp=0xc0d6ed2c
r10=0xc0d6ed60 r9=0xc0903a68
r8=0x00000000 r7=0x000007c7 r6=0xc0b4aa58 r5=0x00000000
r4=0xc35fe974
_mtx_lock_flags() at 0xc09a95d8 = _mtx_lock_flags+0x10
scp=0xc09a95d8 rlv=0xc0903e98 (0xc0903e98 = xpt_unlock_buses+0x148)
rsp=0xc0d6ed30 rfp=0xc0d6ed58
r8=0xc0be33fc r7=0xc090e838
r6=0xc3788880 r5=0xc0b4aa58 r4=0xc3788b80
xpt_unlock_buses() at 0xc0903e28 = xpt_unlock_buses+0xd8
scp=0xc0903e28 rlv=0xc0903f54 (0xc0903f54 = xpt_unlock_buses+0x204)
rsp=0xc0d6ed5c rfp=0xc0d6ed78
r10=0xc0be3410 r9=0xc0b4aa58
r8=0x00000000 r7=0xc090e838 r6=0x00000080 r5=0x00000000
r4=0x00000001
xpt_unlock_buses() at 0xc0903f34 = xpt_unlock_buses+0x1e4
scp=0xc0903f34 rlv=0xc0905d5c (0xc0905d5c = xpt_register_async+0xd0)
rsp=0xc0d6ed7c rfp=0xc0d6ee24
xpt_register_async() at 0xc0905c9c = xpt_register_async+0x10
scp=0xc0905c9c rlv=0xc090e818 (0xc090e818 = ata_get_xport+0x2d54)
rsp=0xc0d6ee28 rfp=0xc0d6ee34
r10=0x00000000 r9=0x00000000
r8=0x005fffcc r7=0xc3584460 r6=0xc0b4aa58 r5=0x00000002
r4=0x00000008
ata_get_xport() at 0xc090e808 = ata_get_xport+0x2d44
scp=0xc090e808 rlv=0xc09008a4 (0xc09008a4 = periphdriver_init+0x9c)
rsp=0xc0d6ee38 rfp=0xc0d6ee50
periphdriver_init() at 0xc0900818 = periphdriver_init+0x10
scp=0xc0900818 rlv=0xc0904620 (0xc0904620 = xpt_alloc_ccb+0xbc)
rsp=0xc0d6ee54 rfp=0xc0d6ee74
r5=0xc0b4ab9c r4=0x00000000
xpt_alloc_ccb() at 0xc09045a0 = xpt_alloc_ccb+0x3c
scp=0xc09045a0 rlv=0xc09d4e84 (0xc09d4e84 = vaccess_acl_posix1e+0x628)
rsp=0xc0d6ee78 rfp=0xc0d6eee0
r6=0xc0b660a4 r5=0xc0bebfe0
r4=0x00000000
vaccess_acl_posix1e() at 0xc09d4e2c = vaccess_acl_posix1e+0x5d0
scp=0xc09d4e2c rlv=0xc097dac4 (0xc097dac4 = mi_startup+0xdc)
rsp=0xc0d6eee4 rfp=0xc0d6eef4
r7=0x00900040 r6=0x00000002
r5=0x0090004c r4=0xc0b82d94
mi_startup() at 0xc097d9f8 = mi_startup+0x10
scp=0xc097d9f8 rlv=0xc09000e4 (0xc09000e4 = btext+0xe4)
rsp=0xc0d6eef8 rfp=0x00000000
r4=0x00900124
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

I disabled all Giant lock, and added printf-debug code to
cam/cam_xpt.c, cam/cam_periph.c. As result, varnished on pmp
driver. I'll try to research where varnish point on pmp.

Thank you.
Norikatsu Shigemura
2010-02-28 04:59:47 UTC
Permalink
Hi mav.

On Sun, 28 Feb 2010 13:31:45 +0900
I didn't know what's happen. So I'll report code trace and
cam related struct dump with ddb which I made.
Code trace with printf debug:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
periphdriver_init() @sys/cam/cam_periph.c
-> adainit() @sys/cam/ata/ata_da.c OK
-> probe_periph_init() @sys/cam/scsi/scsi_xpt.c OK
-> pmpinit() @sys/cam/ata/ata_pmp.c FREEZE
-> xpt_register_async() @sys/cam/cam_xpt.c
-> xpt_for_all_devices() @sys/cam/cam_xpt.c
-> xptbustraverse() @sys/cam/cam_xpt.c

- - - - - in xptbustraverse() - - - - -
for (bus = (start_bus ? start_bus : TAILQ_FIRST(&xsoftc.xpt_busses));
bus != NULL;
bus = next_bus) {
next_bus = TAILQ_NEXT(bus, links);

mtx_unlock(&xsoftc.xpt_topo_lock);
-> CAM_SIM_LOCK(bus->sim);
freeze at this point, because of not catch lock, in the first loop.
retval = tr_func(bus, arg);
CAM_SIM_UNLOCK(bus->sim);
if (retval == 0)
return(retval);
mtx_lock(&xsoftc.xpt_topo_lock);
}
- - - - - in xptbustraverse() - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

So I dumped following mtx, cam_eb IN (0xc36c88c0, 0xc3770840,
0xc35df5c0)->sim.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
db> show lock 0xc35e5974
class: spin mutex
name:
flags: {SPIN}
state: {OWNED, CONTESTED}
owner: 0xc36c8d00 (tid 0, pid -1062090240, "")
db> show lock 0xc35e5774
class: sleep mutex
name: ATA state lock
flags: {DEF}
state: {UNOWNED}
db> show lock 0xc0be5204
class: sleep mutex
name: XPT lock
flags: {DEF}
state: {UNOWNED}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Norikatsu Shigemura
2010-02-28 04:31:45 UTC
Permalink
Hi mav.

I didn't know what's happen. So I'll report code trace and
cam related struct dump with ddb which I made.

The first, cam ddb patch:
show cam
show cam_eb <struct cam_eb *>
show cam_et <struct cam_et *>
show cam_ed <struct cam_ed *>
show cam_sim <struct cam_sim *>
show cam_periph <struct cam_periph *>
I saw gibbs'd document, and made it. If not enough, please tell me!

(*) http://people.freebsd.org/~gibbs/ARTICLE-0001.html

I got following results:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
sata0: <Marvell Integrated SATA Controller> at mem 0xf1080000-0xf1085fff irq 21 on mbus0
sata0: [MPSAFE]
sata0: [ITHREAD]
ata0: <Marvell Integrated SATA Channel> on sata0
ata0: [MPSAFE]
ata0: [ITHREAD]
ata1: <Marvell Integrated SATA Channel> on sata0
ata1: [MPSAFE]
ata1: [ITHREAD]
pcib0: <Marvell 88F6281 PCI-Express host controller> at mem 0xf1040000-0xf1041fff on mbus0
pcib0: PCI IO/Memory space exhausted
device_attach: pcib0 attach returned 12
Timecounter "CPU Timer" frequency 200000000 Hz quality 1000
Timecounters tick every 10.000 msec
lo0: bpf attached
spin lock 0xc36c8d00 () held by 0xc361bb08 (tid -1061281488) too long
panic: spin lock held too long
KDB: enter: panic
[ thread pid 0 tid 100000 ]
Stopped at 0xc09e1d04 = kdb_enter+0x48: ldrb r15, [r15, r15, ror r15]!
db> show cam
Transport layer configuration information:
cam_eb = 0xc36c88c0: path_id = 0, sim_name = ata
cam_et = 0xc36c8880: target_id = 4294967295
cam_ed = 0xc376e000: lun_id = 4294967295
cam_eb = 0xc3770840: path_id = 1, sim_name = ata
cam_et = 0xc3770800: target_id = 4294967295
cam_ed = 0xc376e800: lun_id = 4294967295
cam_eb = 0xc35df5c0: path_id = 4294967295, sim_name = xpt
cam_et = 0xc35df540: target_id = 4294967295
cam_ed = 0xc356d800: lun_id = 4294967295
cam_periph = 0xc3574b80: unit_number = 0, periph_name = xpt
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -




[cam_eb = 0xc36c88c0] OK line
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
db> show cam_eb 0xc36c88c0
CAM Existing Bus information:
et_entries = -> 0xc36c8880 (struct cam_et *)
links = -> 0xc3770840 (struct cam_eb *)
path_id = 0
sim = 0xc3604780 (struct cam_sim *)
last_reset = 0.0[s]
flags = 0x0
refcount = 4
generation = 1
parent_dev = 0 (device_t)
xport = 0xc0bbfe80 (struct xpt_xport *)
db> show cam_sim 0xc3604780
SIM(SCSI Interface Module) information:
sim_action = 0xc0929c38
sim_poll = 0xc09294e8
sim_name = ata
softc = 0xc35e5800 (void *)
mtx = 0xc35e5974 (struct mtx *)
sim_doneq = -> 0 (struct ccb_hdr *)
links = -> 0 (struct cam_sim *)
path_id = 0
unit_number = 0
bus_id = 0
max_tagged_dev_openings = 0
max_dev_openings = 1
flags = 0x2
callout = 0xc36047bc (struct callout)
devq = 0xc3604800 (struct cam_devq)
refcount = 2
ccb_freeq = -> 0 (struct ccb_hdr *)
max_ccbs = 9
ccb_count = 0
db> show cam_et 0xc36c8880
CAM Existing Target information:
ed_entries = -> 0xc376e000 (struct cam_ed *)
links = -> 0 (struct cam_et *)
bus = 0xc36c88c0 (struct cam_eb *)
target_id = 4294967295
refcount = 3
generation = 1
last_reset = 0.0[s]
db> show cam_ed 0xc376e000
CAM Existing Device information:
links = -> 0 (struct cam_ed *)
alloc_ccb_entry
send_ccb_entry
target = 0xc36c8880 (struct cam_et *)
sim = 0xc3604780 (struct cam_sim *)
lun_id = 4294967295
drvq
ccbq
asyncs
periphs = -> 0 (struct cam_periph *)
generation = 0
owner = 0 (struct cam_periph *)
quirk = 0 (void *)
maxtags = 1
mintags = 1
protocol
protocol_version = 0
transport
transport_version = 0
inq_data
ident_data
inq_flags = 0x0
queue_flags = 0x0
serial_num_len = 0
serial_num = 0 (u_int8_t *)
flags = 0x1
tag_delay_count = 0
tag_saved_openings = 0
refcount = 2
callout = 0xc376e3d0 (struct callout)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -




[cam_eb = 0xc35df5c0] Freeze Line
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
db> show cam_eb 0xc35df5c0
CAM Existing Bus information:
et_entries = -> 0xc35df540 (struct cam_et *)
links = -> 0 (struct cam_eb *)
path_id = 4294967295
sim = 0xc3574c00 (struct cam_sim *)
last_reset = 0.0[s]
flags = 0x0
refcount = 3
generation = 3
parent_dev = 0 (device_t)
xport = 0xc0bbfc6c (struct xpt_xport *)
db> show cam_sim 0xc3574c00
SIM(SCSI Interface Module) information:
sim_action = 0xc0906df8
sim_poll = 0xc0904018
sim_name = xpt
softc = 0xc3574b80 (void *)
mtx = 0xc0be5204 (struct mtx *)
sim_doneq = -> 0 (struct ccb_hdr *)
links = -> 0 (struct cam_sim *)
path_id = 4294967295
unit_number = 0
bus_id = 0
max_tagged_dev_openings = 0
max_dev_openings = 0
flags = 0x2
callout = 0xc3574c3c (struct callout)
devq = 0xc3574c80 (struct cam_devq)
refcount = 2
ccb_freeq = -> 0 (struct ccb_hdr *)
max_ccbs = 8
ccb_count = 0
db> show cam_et 0xc35df540
CAM Existing Target information:
ed_entries = -> 0xc356d800 (struct cam_ed *)
links = -> 0 (struct cam_et *)
bus = 0xc35df5c0 (struct cam_eb *)
target_id = 4294967295
refcount = 2
generation = 1
last_reset = 0.0[s]
db> show cam_ed 0xc356d800
CAM Existing Device information:
links = -> 0 (struct cam_ed *)
alloc_ccb_entry
send_ccb_entry
target = 0xc35df540 (struct cam_et *)
sim = 0xc3574c00 (struct cam_sim *)
lun_id = 4294967295
drvq
ccbq
asyncs
periphs = -> 0xc3574b80 (struct cam_periph *)
generation = 1
owner = 0 (struct cam_periph *)
quirk = 0 (void *)
maxtags = 1
mintags = 1
protocol
protocol_version = 0
transport
transport_version = 0
inq_data
ident_data
inq_flags = 0x0
queue_flags = 0x0
serial_num_len = 0
serial_num = 0 (u_int8_t *)
flags = 0x1
tag_delay_count = 0
tag_saved_openings = 0
refcount = 2
callout = 0xc356dbd0 (struct callout)
db> show cam_periph 0xc3574b80
CAM Peripheral information:
pinfo
periph_start = 0 (periph_start_t *)
periph_oninval = 0 (periph_oninval *)
periph_dtor = 0 (periph_dtor_t *)
periph_name = xpt
path = 0xc35613b0 (struct cam_path *)
softc = 0 (void *)
sim = 0xc3574c00 (struct cam_sim *)
unit_number = 0
type = 0x0
flags = 0x0
immediate_priority = 4294967295
refcount = 0
ccb_list = -> 0 (struct ccb_hdr *)
periph_links = -> 0 (struct cam_periph *)
unit_links = -> 0 (struct cam_periph *)
deferred_callback = 0 (ac_callback_t *)
deferred_ac
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -




patch:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
--- sys/cam/cam_periph.c.orig 2010-01-28 17:41:30.000000000 +0900
+++ sys/cam/cam_periph.c 2010-02-28 11:09:19.984247259 +0900
@@ -58,6 +58,12 @@
#include <cam/scsi/scsi_message.h>
#include <cam/scsi/scsi_pass.h>

+#include "opt_ddb.h"
+
+#ifdef DDB
+#include <ddb/ddb.h>
+#endif
+
static u_int camperiphnextunit(struct periph_driver *p_drv,
u_int newunit, int wired,
path_id_t pathid, target_id_t target,
@@ -1859,3 +1865,42 @@

return (error);
}
+
+#ifdef DDB
+static void
+cam_show_cam_periph(struct cam_periph *periph)
+{
+ if (periph == NULL)
+ return;
+
+ db_printf("CAM Peripheral information:\n");
+
+ db_printf(" pinfo\n");
+ db_printf(" periph_start = %p (periph_start_t *)\n", periph->periph_start);
+ db_printf(" periph_oninval = %p (periph_oninval *)\n", periph->periph_oninval);
+ db_printf(" periph_dtor = %p (periph_dtor_t *)\n", periph->periph_dtor);
+ db_printf(" periph_name = %s\n", periph->periph_name);
+ db_printf(" path = %p (struct cam_path *)\n", periph->path);
+ db_printf(" softc = %p (void *)\n", periph->softc);
+ db_printf(" sim = %p (struct cam_sim *)\n", periph->sim);
+ db_printf(" unit_number = %u\n", periph->unit_number);
+ db_printf(" type = 0x%x\n", periph->type);
+ db_printf(" flags = 0x%x\n", periph->flags);
+ db_printf(" immediate_priority = %u\n", periph->immediate_priority);
+ db_printf(" refcount = %u\n", periph->refcount);
+ db_printf(" ccb_list = -> %p (struct ccb_hdr *)\n", SLIST_FIRST(&periph->ccb_list));
+ db_printf(" periph_links = -> %p (struct cam_periph *)\n", SLIST_NEXT(periph, periph_links));
+ db_printf(" unit_links = -> %p (struct cam_periph *)\n", TAILQ_NEXT(periph, unit_links)); db_printf(" deferred_callback = %p (ac_callback_t *)\n", periph->deferred_callback);
+ db_printf(" deferred_ac\n");
+}
+
+DB_SHOW_COMMAND(cam_periph, db_show_cam_periph)
+{
+ if (!have_addr) {
+ db_printf("usage: show cam_periph <struct cam_periph *>\n");
+ return;
+ }
+
+ cam_show_cam_periph((struct cam_periph*)addr);
+}
+#endif
--- sys/cam/cam_sim.c.orig 2010-01-28 22:45:23.512540000 +0900
+++ sys/cam/cam_sim.c 2010-02-28 11:10:17.866613899 +0900
@@ -41,6 +41,12 @@
#include <cam/cam_sim.h>
#include <cam/cam_queue.h>

+#include "opt_ddb.h"
+
+#ifdef DDB
+#include <ddb/ddb.h>
+#endif
+
#define CAM_PATH_ANY (u_int32_t)-1

MALLOC_DEFINE(M_CAMSIM, "CAM SIM", "CAM SIM buffers");
@@ -145,3 +151,43 @@
{
sim->path_id = path_id;
}
+
+#ifdef DDB
+static void
+cam_show_cam_sim(struct cam_sim *sim)
+{
+ if (sim == NULL)
+ return;
+
+ db_printf("SIM(SCSI Interface Module) information:\n");
+ db_printf(" sim_action = %p\n", sim->sim_action);
+ db_printf(" sim_poll = %p\n", sim->sim_poll);
+ db_printf(" sim_name = %s\n", sim->sim_name);
+ db_printf(" softc = %p (void *)\n", sim->softc);
+ db_printf(" mtx = %p (struct mtx *)\n", sim->mtx);
+ db_printf(" sim_doneq = -> %p (struct ccb_hdr *)\n", TAILQ_FIRST(&sim->sim_doneq));
+ db_printf(" links = -> %p (struct cam_sim *)\n", TAILQ_NEXT(sim, links));
+ db_printf(" path_id = %u\n", sim->path_id);
+ db_printf(" unit_number = %u\n", sim->unit_number);
+ db_printf(" bus_id = %u\n", sim->bus_id);
+ db_printf(" max_tagged_dev_openings = %d\n", sim->max_tagged_dev_openings);
+ db_printf(" max_dev_openings = %d\n", sim->max_dev_openings);
+ db_printf(" flags = 0x%x\n", sim->flags);
+ db_printf(" callout = %p (struct callout)\n", &sim->callout);
+ db_printf(" devq = %p (struct cam_devq)\n", sim->devq);
+ db_printf(" refcount = %d\n", sim->refcount);
+ db_printf(" ccb_freeq = -> %p (struct ccb_hdr *)\n", SLIST_FIRST(&sim->ccb_freeq));
+ db_printf(" max_ccbs = %u\n", sim->max_ccbs);
+ db_printf(" ccb_count = %u\n", sim->ccb_count);
+}
+
+DB_SHOW_COMMAND(cam_sim, db_show_cam_sim)
+{
+ if (!have_addr) {
+ db_printf("usage: show cam_sim <struct cam_sim *>\n");
+ return;
+ }
+
+ cam_show_cam_sim((struct cam_sim*)addr);
+}
+#endif
--- sys/cam/cam_xpt.c.orig 2010-02-26 19:33:48.000000000 +0900
+++ sys/cam/cam_xpt.c 2010-02-28 11:24:55.338945930 +0900
@@ -69,6 +69,11 @@
#include <cam/scsi/scsi_pass.h>
#include <machine/stdarg.h> /* for xpt_print below */
#include "opt_cam.h"
+#include "opt_ddb.h"
+
+#ifdef DDB
+#include <ddb/ddb.h>
+#endif

/*
* This is the maximum number of high powered commands (e.g. start unit)
@@ -4920,3 +4925,135 @@
}
}

+#ifdef DDB
+static void
+cam_show_cam_eb(struct cam_eb *bus)
+{
+ if (bus == NULL)
+ return;
+
+ db_printf("CAM Existing Bus information:\n");
+ db_printf(" et_entries = -> %p (struct cam_et *)\n", TAILQ_FIRST(&bus->et_entries));
+ db_printf(" links = -> %p (struct cam_eb *)\n", TAILQ_NEXT(bus, links));
+ db_printf(" path_id = %u\n", bus->path_id);
+ db_printf(" sim = %p (struct cam_sim *)\n", bus->sim);
+ db_printf(" last_reset = %lu.%ld[s]\n", (long)bus->last_reset.tv_sec, bus->last_reset.tv_usec/1000);
+ db_printf(" flags = 0x%x\n", bus->flags);
+ db_printf(" refcount = %u\n", bus->refcount);
+ db_printf(" generation = %u\n", bus->generation);
+ db_printf(" parent_dev = %p (device_t)\n", bus->parent_dev);
+ db_printf(" xport = %p (struct xpt_xport *)\n", bus->xport);
+}
+
+static void
+cam_show_cam_et(struct cam_et *tar)
+{
+ if (tar == NULL)
+ return;
+
+ db_printf("CAM Existing Target information:\n");
+ db_printf(" ed_entries = -> %p (struct cam_ed *)\n", TAILQ_FIRST(&tar->ed_entries));
+ db_printf(" links = -> %p (struct cam_et *)\n", TAILQ_NEXT(tar, links));
+ db_printf(" bus = %p (struct cam_eb *)\n", tar->bus);
+ db_printf(" target_id = %u\n", tar->target_id);
+ db_printf(" refcount = %u\n", tar->refcount);
+ db_printf(" generation = %u\n", tar->generation);
+ db_printf(" last_reset = %lu.%ld[s]\n", (long)tar->last_reset.tv_sec, tar->last_reset.tv_usec/1000);
+}
+
+static void
+cam_show_cam_ed(struct cam_ed *dev)
+{
+ if (dev == NULL)
+ return;
+
+ db_printf("CAM Existing Device information:\n");
+ db_printf(" links = -> %p (struct cam_ed *)\n", TAILQ_NEXT(dev, links));
+ db_printf(" alloc_ccb_entry\n");
+ db_printf(" send_ccb_entry\n");
+ db_printf(" target = %p (struct cam_et *)\n", dev->target);
+ db_printf(" sim = %p (struct cam_sim *)\n", dev->sim);
+ db_printf(" lun_id = %u\n", dev->lun_id);
+ db_printf(" drvq\n");
+ db_printf(" ccbq\n");
+ db_printf(" asyncs\n");
+ db_printf(" periphs = -> %p (struct cam_periph *)\n", SLIST_FIRST(&dev->periphs));
+ db_printf(" generation = %u\n", dev->generation);
+ db_printf(" owner = %p (struct cam_periph *)\n", dev->owner);
+ db_printf(" quirk = %p (void *)\n", dev->quirk);
+ db_printf(" maxtags = %u\n", dev->maxtags);
+ db_printf(" mintags = %u\n", dev->mintags);
+ db_printf(" protocol\n");
+ db_printf(" protocol_version = %u\n", dev->protocol_version);
+ db_printf(" transport\n");
+ db_printf(" transport_version = %u\n", dev->transport_version);
+ db_printf(" inq_data\n");
+ db_printf(" ident_data\n");
+ db_printf(" inq_flags = 0x%x\n", dev->inq_flags);
+ db_printf(" queue_flags = 0x%x\n", dev->queue_flags);
+ db_printf(" serial_num_len = %u\n", dev->serial_num_len);
+ db_printf(" serial_num = %p (u_int8_t *)\n", dev->serial_num);
+ db_printf(" flags = 0x%x\n", dev->flags);
+ db_printf(" tag_delay_count = %u\n", dev->tag_delay_count);
+ db_printf(" tag_saved_openings = %u\n", dev->tag_saved_openings);
+ db_printf(" refcount = %u\n", dev->refcount);
+ db_printf(" callout = %p (struct callout)\n", &dev->callout);
+}
+
+DB_SHOW_COMMAND(cam_eb, db_show_cam_eb)
+{
+ if (!have_addr) {
+ db_printf("usage: show cam_eb <struct cam_eb *>\n");
+ return;
+ }
+
+ cam_show_cam_eb((struct cam_eb*)addr);
+}
+
+DB_SHOW_COMMAND(cam_et, db_show_cam_et)
+{
+ if (!have_addr) {
+ db_printf("usage: show cam_et <struct cam_et *>\n");
+ return;
+ }
+
+ cam_show_cam_et((struct cam_et*)addr);
+}
+
+DB_SHOW_COMMAND(cam_ed, db_show_cam_ed)
+{
+ if (!have_addr) {
+ db_printf("usage: show cam_ed <struct cam_ed *>\n");
+ return;
+ }
+
+ cam_show_cam_ed((struct cam_ed*)addr);
+}
+
+DB_SHOW_COMMAND(cam, db_show_cam)
+{
+ struct cam_eb *bus, *next_bus;
+ struct cam_et *tar;
+ struct cam_ed *dev;
+ struct cam_periph *periph;
+
+ db_printf("Transport layer configuration information:\n");
+ for (bus = TAILQ_FIRST(&xsoftc.xpt_busses);
+ bus != NULL; bus = next_bus) {
+ next_bus = TAILQ_NEXT(bus, links);
+ db_printf(" cam_eb = %p: path_id = %u, sim_name = %s\n", bus, bus->path_id, bus->sim->sim_name);
+ TAILQ_FOREACH(tar, &bus->et_entries, links) {
+ db_printf(" cam_et = %p: target_id = %u\n", tar, tar->target_id);
+ TAILQ_FOREACH(dev, &tar->ed_entries, links) {
+ db_printf(" cam_ed = %p: lun_id = %u\n", dev, dev->lun_id);
+ SLIST_FOREACH(periph, &dev->periphs, periph_links) {
+ db_printf(" cam_periph = %p: unit_number = %u, periph_name = %s\n", periph, periph->unit_number, periph->periph_name);
+ }
+ }
+ }
+ if (db_pager_quit)
+ break;
+ }
+}
+
+#endif
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Alexander Motin
2010-03-31 07:25:38 UTC
Permalink
Hi.
Post by Norikatsu Shigemura
I got a OpenRD-client (Marvell 88F6281 SoC), and I'm tring to
But I got following panic, my I help you?
In this time, I attached no devices to SATA/eSATA port.
- - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ata1: <Marvell Integrated SATA Channel> on sata0
ata1: [MPSAFE]
ata1: [ITHREAD]
spin lock 0xc3766680 (fvH) held by 0xc3613b48 (tid -1061308344) too long
panic: spin lock held too long
KDB: enter: panic
[ thread pid 0 tid 100000 ]
Stopped at 0xc09dcb50 = kdb_enter+0x48: ldrb r15, [r15, r15, ror r15]!
db>
Fixed at SVN r205967.
--
Alexander Motin
Norikatsu Shigemura
2010-04-04 16:22:48 UTC
Permalink
Hi mav.

On Wed, 31 Mar 2010 10:25:38 +0300
Post by Alexander Motin
Post by Norikatsu Shigemura
spin lock 0xc3766680 (fvH) held by 0xc3613b48 (tid -1061308344) too long
panic: spin lock held too long
KDB: enter: panic
[ thread pid 0 tid 100000 ]
Stopped at 0xc09dcb50 = kdb_enter+0x48: ldrb r15, [r15, r15, ror r15]!
db>
Fixed at SVN r205967.
Oops, sorry! That's great news! I'll retry.

Loading...