From owner-freebsd-current@FreeBSD.ORG Fri May 23 14:08:30 2014 Return-Path: Delivered-To: freebsd-current@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 ESMTPS id 4B900964; Fri, 23 May 2014 14:08:30 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22ED42058; Fri, 23 May 2014 14:08:30 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 32614B97D; Fri, 23 May 2014 10:08:29 -0400 (EDT) From: John Baldwin To: Hans Petter Selasky Subject: Re: panic: resource_list_add: resource entry is busy Date: Fri, 23 May 2014 10:07:58 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <53763B0F.4040003@selasky.org> <5379200E.8080602@selasky.org> <537A65C2.6060203@selasky.org> In-Reply-To: <537A65C2.6060203@selasky.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201405231007.58608.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 23 May 2014 10:08:29 -0400 (EDT) Cc: freebsd-current , Warner Losh X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 14:08:30 -0000 On Monday, May 19, 2014 4:12:50 pm Hans Petter Selasky wrote: > On 05/18/14 23:03, Hans Petter Selasky wrote: > > Hi, > > > > First call: > > > > resource_list_add: > > Hi, > > It appears that the /dev/pccard.X is opened and reading some CIS data > from the device before any driver has been attached. The attached patch > solves the panic I've seen. Not sure if the patch is correct. Oops, your patch was dropped in my reply, but it just disables pccard_scan_cis() while a device is probing. Warner, the issue here is that pccard_scan_cis() can do a bus_alloc_resource() for SYS_RES_MEMORY rid 0 of a pccard device concurrently with pccard_function_init(). Hans patch might be along the right track, though we might want to make /dev/pccard.X block until pccard_function_init() finishes rather than causing pccard_scan_cis() to fail. What do you think? -- John Baldwin