From owner-freebsd-current@FreeBSD.ORG Tue Aug 16 19:09:11 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 750C1106564A; Tue, 16 Aug 2011 19:09:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 484E28FC16; Tue, 16 Aug 2011 19:09:11 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D3B0C46B06; Tue, 16 Aug 2011 15:09:10 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6D7148A02E; Tue, 16 Aug 2011 15:09:10 -0400 (EDT) From: John Baldwin To: Andriy Gapon Date: Tue, 16 Aug 2011 15:09:09 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: <75E1A2A7D185F841A975979B0906BBA67BCC877062@AVEXMB1.qlogic.org> <201108161145.02733.jhb@freebsd.org> <4E4A9A23.7060807@FreeBSD.org> In-Reply-To: <4E4A9A23.7060807@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201108161509.09939.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 16 Aug 2011 15:09:10 -0400 (EDT) Cc: "freebsd-current@freebsd.org" , David Somayajulu Subject: Re: Loading drivers via kldload X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 16 Aug 2011 19:09:11 -0000 On Tuesday, August 16, 2011 12:26:11 pm Andriy Gapon wrote: > > The following are pure speculations, I'd rather let David speak, but just in case; > > on 16/08/2011 18:45 John Baldwin said the following: > > Well, that would seem odd, still. It only returns BUS_PROBE_GENERIC (not 0), so > > David's driver's probe routine should still be called to get a chance to attach to > > the device. > > Maybe it doesn't do that exactly because device and vendor ID are zeroes as David > described earlier. Eh? device_probe_and_attach()'s loop to probe drivers is not PCI-specific, it has no idea if a given device is PCI device or not let alone if it has non-zero subvendor IDs. Also, ata_pci_probe() doesn't look at the subvendor IDs at all. > > Also, the ATA driver only allocates its BAR once, so it shouldn't > > trigger the panic in question in that case (the panic is only triggered when you > > try to double-allocate a BAR). > > This makes only if the BAR has sane values. Not sure what happens if the BAR has > some junk that duplicates other PCI device, or something like that. The panic in question is due to a resource that was reserved by the parent bus (i.e. either ACPI or PCI) using resource_list_reserve(), then a driver called resource_list_alloc() on it once successfully, and resource_list_alloc() is being called a second time to allocate an already- allocated resource. That won't happen due to junk in a BAR (and BARs are all standard config header registers anyway). -- John Baldwin