From owner-freebsd-drivers@FreeBSD.ORG Tue Mar 18 09:11:27 2008 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D17D21065684 for ; Tue, 18 Mar 2008 09:11:27 +0000 (UTC) (envelope-from shase@andrew.cmu.edu) Received: from smtp.andrew.cmu.edu (SMTP.andrew.cmu.edu [128.2.10.212]) by mx1.freebsd.org (Postfix) with ESMTP id 985548FC36 for ; Tue, 18 Mar 2008 09:11:27 +0000 (UTC) (envelope-from shase@andrew.cmu.edu) Received: from [128.237.238.177] ([128.237.238.177]) (user=shase mech=PLAIN (0 bits)) by smtp.andrew.cmu.edu (8.13.8/8.13.8) with ESMTP id m2I8qd6m002238 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 18 Mar 2008 04:52:43 -0400 Message-ID: <47DF82DB.5020302@andrew.cmu.edu> Date: Tue, 18 Mar 2008 04:52:43 -0400 From: sanket hase User-Agent: Thunderbird 2.0.0.6 (X11/20070801) MIME-Version: 1.0 To: freebsd-drivers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.60 on 128.2.10.212 Cc: Sanket Somnath Hase Subject: Freebsd/Xen: pcifront: IRQ resource allocation failed: Query X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2008 09:11:27 -0000 Hi , I am a Masters student at Carnegie Mellon Univ. working on xen/freebsd opensource project. I have been working on pci-passtrhough support for freebsd domU. I am testing pcifront on freebsd domU using following sound card [ Cirrus Logic CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator] Following sound driver is used for this sound card on Freebsd: *snd_csa*-- Crystal Semiconductor CS461x/462x/4280 PCI bridge device driver I am able to detect the card. pci3: on pcib3 csa0: mem 0xfafff000-0xfaffffff,0xfae00000-0xfaefffff irq 16 at device 5.0 on pci3 csa: card is Turtle Beach Santa Cruz But going ahead IRQ resource allocations fails, before interrupt handler can be setup. I found that it fails in "rman_reserve_resource_bound" Because: r = TAILQ_FIRST(&rm->rm_list) = is still NULL , as it was initialized. Here is the stacktrace: (gdb) where #0 rman_reserve_resource_bound (rm=0xc07b3de0, start=16, end=16, count=1, bound=0, flags=4, dev=0xc0d8f700) at ../../../kern/subr_rman.c:282 #1 0xc01747bc in rman_reserve_resource (rm=0xc07b3de0, start=16, end=16, count=1, flags=4, dev=0xc0d8f700) at ../../../kern/subr_rman.c:491 #2 0xc035cb75 in nexus_alloc_resource (bus=0xc0db3000, child=0xc0d8f700, type=1, rid=0xc0d8f994, start=16, end=16, count=1, flags=6) at ../../../i386/i386/nexus.c:367 #3 0xc016adae in bus_generic_alloc_resource (dev=0xc0d8f800, child=0xc0d8f700, type=1, rid=0xc0d8f994, start=16, end=16, count=1, flags=6) at bus_if.h:263 #4 0xc016adae in bus_generic_alloc_resource (dev=0xc0d8f500, child=0xc0d8f700, type=1, rid=0xc0d8f994, start=16, end=16, count=1, flags=6) at bus_if.h:263 #5 0xc016af34 in resource_list_alloc (rl=0xc0e03604, bus=0xc0e04b00, child=0xc0d8f700, type=1, rid=0xc0d8f994, start=16, end=16, count=1, flags=6) at bus_if.h:263 #6 0xc00ab3d5 in pci_alloc_resource (dev=0xc0e04b00, child=0xc0d8f700, type=1, rid=0xc0d8f994, start=0, end=4294967295, count=1, flags=6) at ../../../dev/pci/pci.c:3488 #7 0xc016ad1c in bus_alloc_resource (dev=0xc0d8f700, type=1, rid=0xc0d8f994, start=0, end=4294967295, count=1, flags=6) at bus_if.h:263 #8 0xc00b54e6 in csa_attach (dev=0xc0d8f700) at bus.h:376 #9 0xc0169ecf in device_attach (dev=0xc0d8f700) at device_if.h:178 #10 0xc016a9f0 in device_probe_and_attach (dev=0xc0d8f700) at ../../../kern/subr_bus.c:2369 #11 0xc016aad9 in bus_generic_attach (dev=0xc0e04b00) at ../../../kern/subr_bus.c:2907 #12 0xc00ae8bf in pci_attach (dev=0xc0e04b00) at ../../../dev/pci/pci.c:2611 #13 0xc0169ecf in device_attach (dev=0xc0e04b00) at device_if.h:178 #14 0xc016a9f0 in device_probe_and_attach (dev=0xc0e04b00) at ../../../kern/subr_bus.c:2369 #15 0xc016aad9 in bus_generic_attach (dev=0xc0d8f500) at ../../../kern/subr_bus.c:2907 #16 0xc033811b in xpcib_attach (dev=0xc0d8f500) at ../../../dev/xen/pcifront/pcifront.c:702 #17 0xc0169ecf in device_attach (dev=0xc0d8f500) at device_if.h:178 #18 0xc016a9f0 in device_probe_and_attach (dev=0xc0d8f500) at ../../../kern/subr_bus.c:2369 #19 0xc016aad9 in bus_generic_attach (dev=0xc0d8f800) at ../../../kern/subr_bus.c:2907 #20 0xc03383ab in xpcife_attach (dev=0xc0d8f800) at ../../../dev/xen/pcifront/pcifront.c:640 #21 0xc0169ecf in device_attach (dev=0xc0d8f800) at device_if.h:178 #22 0xc016a9f0 in device_probe_and_attach (dev=0xc0d8f800) at ../../../kern/subr_bus.c:2369 #23 0xc033792a in pcifront_backend_changed (xdev=0xc0e05000, be_state=XenbusStateConnected) at ../../../dev/xen/pcifront/pcifront.c:346 #24 0xc032fea8 in otherend_changed (watch=0xc0e05000, vec=0xc0defa00, len=2) at ../../../xen/xenbus/xenbus_probe.c:330 #25 0xc0330aec in xenwatch_thread (unused=0x0) at ../../../xen/xenbus/xenbus_xs.c:741 #26 0xc0129968 in fork_exit (callout=0xc0330980 , arg=0x0, frame=0xc588bd38) at ../../../kern/kern_fork.c:795 #27 0xc0350e84 in fork_trampoline () at ../../../i386/xen/exception.s:240 (gdb) p rm->rm_list $4 = {tqh_first = 0x0, tqh_last = 0xc07b3de0} (gdb) tqh_first is still 0 ( as it was initialzed ) which ultimately causes the IRQ resource allocation to fail. Am I missing anything ? Looking forward to hearing from you,Thanks for the help in advance. Thanks, Sanket Hase