NetBSD Problem Report #43341
From christos@bulky.astron.com Sun May 23 05:17:02 2010
Return-Path: <christos@bulky.astron.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by www.NetBSD.org (Postfix) with ESMTP id 01DA963B873
for <gnats-bugs@gnats.NetBSD.org>; Sun, 23 May 2010 05:17:01 +0000 (UTC)
Message-Id: <20100523032910.279702193C@bulky.astron.com>
Date: Sun, 23 May 2010 03:29:09 +0000 (UTC)
From: christos@netbsd.org
Reply-To: christos@netbsd.org
To: gnats-bugs@gnats.NetBSD.org
Subject: firewire code is broken from the kmem_alloc changes.
X-Send-Pr-Version: 3.95
>Number: 43341
>Category: kern
>Synopsis: firewire code is broken from the kmem_alloc changes.
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun May 23 05:20:01 +0000 2010
>Last-Modified: Sun May 23 19:00:04 +0000 2010
>Originator: Christos Zoulas
>Release: NetBSD 5.99.28
>Organization:
Broken Kernels
>Environment:
System: NetBSD bulky.astron.com 5.99.28 NetBSD 5.99.28 (BULKY) #36: Sat May 1 21:52:04 EDT 2010 christos@bulky.astron.com:/usr/src/sys/arch/amd64/compile/BULKY amd64
Architecture: x86_64
Machine: amd64
>Description:
Whoever changed the firewire code to use kmem_alloc() did not
test the kernel with DIAGNOSTIC because there are kmem_alloc()
calls from an interrupt context all over the place.
I fixed the first two I found, but I am stopping here.
>How-To-Repeat:
Compile a DIAGNOSTIC kernel and boot.
fwohci0: BUS reset
fwohci0: node_id=0xc800ffc0, gen=1, CYCLEMASTER mode
ieee1394if0: 1 nodes, maxhop <= 0 cable IRM irm(0) (me)
ieee1394if0: bus manager 0
panic: kernel diagnostic assertion "!cpu_intr_p()" failed: file "../../../../ker
n/subr_kmem.c", line 195
fatal breakpoint trap in supervisor mode
trap type 1 code 0 rip ffffffff8022db1d cs 8 rflags 246 cr2 0 cpl 6 rsp fffffff
f80faf628
breakpoint() at netbsd:breakpoint+0x5
panic() at netbsd:panic+0x2ba
kern_assert() at netbsd:kern_assert+0x2d
kmem_alloc() at netbsd:kmem_alloc+0x18a
kmem_zalloc() at netbsd:kmem_zalloc+0xf
fw_xfer_alloc() at netbsd:fw_xfer_alloc+0x19
fw_bmr() at netbsd:fw_bmr+0x174
fw_sidrcv() at netbsd:fw_sidrcv+0x5e7
fwohci_intr() at netbsd:fwohci_intr+0xc52
intr_biglock_wrapper() at netbsd:intr_biglock_wrapper+0x1d
Xintr_ioapic_level5() at netbsd:Xintr_ioapic_level5+0xf4
--- interrupt ---
Xspllower() at netbsd:Xspllower+0xe
main() at netbsd:main+0x216
>Fix:
Perhaps allocate a pool of transfers, or back the whole thing out.
>Audit-Trail:
From: Christos Zoulas <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/43341 CVS commit: src/sys/dev/ieee1394
Date: Sun, 23 May 2010 14:56:59 -0400
Module Name: src
Committed By: christos
Date: Sun May 23 18:56:59 UTC 2010
Modified Files:
src/sys/dev/ieee1394: firewire.c firewirereg.h fwdev.c fwdma.c fwmem.c
fwohci.c fwohcivar.h if_fwip.c sbp.c
Log Message:
Revert all previous kmem_ commits. This needs to be done in a different way
because we cannot call kmem_ from an interrupt context. I opened PR/43341 for
it.
To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/ieee1394/firewire.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/ieee1394/firewirereg.h
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/ieee1394/fwdev.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/ieee1394/fwdma.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ieee1394/fwmem.c
cvs rdiff -u -r1.127 -r1.128 src/sys/dev/ieee1394/fwohci.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/ieee1394/fwohcivar.h \
src/sys/dev/ieee1394/sbp.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ieee1394/if_fwip.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.