From owner-freebsd-current@FreeBSD.ORG Tue May 15 17:08:18 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 10FA816A405 for ; Tue, 15 May 2007 17:08:18 +0000 (UTC) (envelope-from davidch@broadcom.com) Received: from MMS3.broadcom.com (mms3.broadcom.com [216.31.210.19]) by mx1.freebsd.org (Postfix) with ESMTP id DAAAD13C489 for ; Tue, 15 May 2007 17:08:17 +0000 (UTC) (envelope-from davidch@broadcom.com) Received: from [10.10.64.154] by MMS3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.1)); Tue, 15 May 2007 10:08:03 -0700 X-Server-Uuid: 20144BB6-FB76-4F11-80B6-E6B2900CA0D7 Received: by mail-irva-10.broadcom.com (Postfix, from userid 47) id B8F612B0; Tue, 15 May 2007 10:08:03 -0700 (PDT) Received: from mail-irva-8.broadcom.com (mail-irva-8 [10.10.64.221]) by mail-irva-10.broadcom.com (Postfix) with ESMTP id 92CF52AF; Tue, 15 May 2007 10:08:03 -0700 (PDT) Received: from mail-irva-12.broadcom.com (mail-irva-12.broadcom.com [10.10.64.146]) by mail-irva-8.broadcom.com (MOS 3.7.5a-GA) with ESMTP id FHI94137; Tue, 15 May 2007 10:08:00 -0700 (PDT) Received: from NT-IRVA-0750.brcm.ad.broadcom.com (nt-irva-0750 [10.8.194.64]) by mail-irva-12.broadcom.com (Postfix) with ESMTP id D610869CA3; Tue, 15 May 2007 10:07:59 -0700 (PDT) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Tue, 15 May 2007 10:07:29 -0700 Message-ID: <09BFF2FA5EAB4A45B6655E151BBDD90303ECF0B1@NT-IRVA-0750.brcm.ad.broadcom.com> In-Reply-To: <20070515045821.GA13350@cdnetworks.co.kr> Thread-Topic: Releasing MSI Resources in a Module Causes Kernel Panic on -CURRENT Thread-Index: AceWraWVHkmpvowxSw60jAZoNIThsQAZTYHg References: <09BFF2FA5EAB4A45B6655E151BBDD90303DE3A51@NT-IRVA-0750.brcm.ad.broadcom.com> <20070515045821.GA13350@cdnetworks.co.kr> From: "David Christensen" To: pyunyh@gmail.com, freebsd-current@freebsd.org X-WSS-ID: 6A57377938G29003458-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Cc: Subject: RE: Releasing MSI Resources in a Module Causes Kernel Panic on -CURRENT 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, 15 May 2007 17:08:18 -0000 > > What is going wrong?=20 > >=20 >=20 > I don't know any 5708 hardware details but pci_alloc_msi() may have > failed. AFAIK just checking pci_alloc_msi() =3D=3D 0 is not enough > and you may have to check count is 1 before proceeding to use MSI. > I've also noted that MSIX supports needs additional resource to > enable MSIX table/PBA on nfe(4) hardware. I'm not sure it's applicable > to you, though. The 5708 is a PCI-X controller behind a PCIe to PCI-X bridge. There are no known problems with MSI on the device and it works correctly when=20 configured under Linx (and apparently under FreeBSD too). There's just this problem with releasing the MSI resource. MSI-X is not supported on this controller. =20 >=20 > I guess the following code could be changed from > if (count =3D=3D 1 && pci_alloc_msi(dev, &count) =3D=3D 0) { > rid =3D 1; > sc->bce_flags |=3D BCE_USING_MSI_FLAG; > } else > rid =3D 0; >=20 > To: > if (count =3D=3D 1 && pci_alloc_msi(dev, &count) =3D=3D 0 &&=20 > count =3D=3D 1) { > =20 > ^^^^^^^^^^ > rid =3D 1; > sc->bce_flags |=3D BCE_USING_MSI_FLAG; > } else > rid =3D 0; >=20 > It would be even better if you can provide a=20 > tunable(hw.bce.msi_disable) > to disable MSI capability for bce(4). Thanks Pyun but that doesn't appear to be the problem. The call to pci_alloc_msi() is returning correctly with a count of 1. I can=20 certainly add a sysctl to disable MSI but that just masks the problem without getting to the root cause. Dave