Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Feb 2007 12:13:02 -0500
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        Luigi Rizzo <luigi@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/arm/xscale/ixp425 ixp425_npe.c src/sys/dev/ipw if_ipw.c if_ipwvar.h src/sys/dev/isp isp_freebsd.h src/sys/dev/iwi if_iwi.c if_iwivar.h src/sys/dev/mxge if_mxge.c src/sys/kern subr_firmware.c src/sys/sys firmware.h src/sys/tools fw_stub.awk
Message-ID:  <20070221121302.A20229@grasshopper.cs.duke.edu>
In-Reply-To: <200702151721.l1FHLWno019525@repoman.freebsd.org>; from luigi@FreeBSD.org on Thu, Feb 15, 2007 at 05:21:31PM %2B0000
References:  <200702151721.l1FHLWno019525@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Luigi Rizzo [luigi@FreeBSD.org] wrote:

>   Cleanup and document the implementation of firmware(9) based on
>   a version that i posted earlier on the -current mailing list,
>   and subsequent feedback received.
>   

At least for me, firmware(9) has been broken ever since the kld_mtx
was replaced with an sx lock last June.  The problem is that there is
an exclusive lock of kld_sx taken when loading a driver, and then
firmware_get() triggers another xlock of it, leading to a deadlock:

db> tr 707
Tracing pid 707 tid 100087 td 0xffffff001871bcd0
sched_switch() at sched_switch+0xec
mi_switch() at mi_switch+0x14d
sleepq_wait() at sleepq_wait+0x58
cv_wait_unlock() at cv_wait_unlock+0x131
cv_wait() at cv_wait+0x2c
_sx_xlock() at _sx_xlock+0x51
linker_reference_module() at linker_reference_module+0x2d
firmware_get() at firmware_get+0xda
mxge_attach() at mxge_attach+0x787
device_attach() at device_attach+0x292
pci_driver_added() at pci_driver_added+0xe0
devclass_add_driver() at devclass_add_driver+0xc8
driver_module_handler() at driver_module_handler+0xad
module_register_init() at module_register_init+0x84
linker_load_module() at linker_load_module+0xaf5
kern_kldload() at kern_kldload+0xa2
kldload() at kldload+0x84
syscall() at syscall+0x266
Xfast_syscall() at Xfast_syscall+0xab


I've been using a patch
(http://people.freebsd.org/~gallatin/firmware_sx_recurse.diff)
which works around the problem.  Do you think it would be 
possible to commit this?

Thanks,

Drew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070221121302.A20229>