From owner-freebsd-scsi@FreeBSD.ORG Fri Oct 4 15:57:05 2013 Return-Path: Delivered-To: FreeBSD-scsi@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 ESMTP id 22D0C344 for ; Fri, 4 Oct 2013 15:57:05 +0000 (UTC) (envelope-from sean_bruno@yahoo.com) Received: from nm26-vm0.bullet.mail.bf1.yahoo.com (nm26-vm0.bullet.mail.bf1.yahoo.com [98.139.213.74]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C97B25AC for ; Fri, 4 Oct 2013 15:57:04 +0000 (UTC) Received: from [98.139.212.149] by nm26.bullet.mail.bf1.yahoo.com with NNFMP; 04 Oct 2013 15:56:57 -0000 Received: from [98.139.213.10] by tm6.bullet.mail.bf1.yahoo.com with NNFMP; 04 Oct 2013 15:56:57 -0000 Received: from [127.0.0.1] by smtp110.mail.bf1.yahoo.com with NNFMP; 04 Oct 2013 15:56:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1380902217; bh=Fyz1HTE7PuE5qRBAtttrflycSOlMBQSXbND+eSr0jfo=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Subject:From:Reply-To:To:In-Reply-To:References:Content-Type:Date:Message-ID:Mime-Version:X-Mailer; b=w1ARcjG5Lo7G/BJ6P9TLHgv1NyJQwuY8nu/4P/LfPlmiWidfjmLtGPr47veLXQXum0qf3yIAQLhotXdWxNJLPr4NZEBY1xGY7Dva9F88Jwu1WG+2vJX7vavTDC/k8sPGivnjqlEzmedZ3iZ6PMaJ7JvH0daRyWjOuwYvUzD/+HA= X-Yahoo-Newman-Id: 106223.43477.bm@smtp110.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 24kh.WEVM1l.rV1ELHc6GvkzRjgnTwoA3VVBABCsvUH5XJs u0DIDjUT2HCJ0ItMmL9svf2v7.VwEL8jm3KITN96DAg0YVLjInmewVRtTuGS LfPYVBpFXMfqnWsHXCHpilqr0hpV46dBJYEdfRTOCup5QW0JxMamYcOuCC1V _e55f6Il5vxrp9EsHHJ9FGeJLWEGV2psbr.ifdM.yoAe.AexjHxZdxRezmhG UORDEmo9ibulMpJyMBGTXAQMIUWcxO1bpD1XlA6RXJtUHVGuPWAA9D5Lh29P 5Pj9B7jadI0qHZNhdGfeGF2lIsgug9_yDo6vhqxrSrKph.B_z1.pn5r79kUH PYPwO0AjzJ5wu3x4WJlLU5iMEwHuzRir0ZN0XVQxHhKZTVWYeiVUU5RM3DHW Yy8f7n3p60RoN.BFHNPF_Rq_puwunJcGsG_ljrHB.7b49N1zjVN8CvDNYHIt MqITs.ffblsKalVl2ggiW_1zFaRsE1UeHspvm7Vgk8nOWi4bY742xk14gizZ xD0jCFlgyjIL0uX_vL5Q0xjkyAnQK1I9UcEhi1e0phNCqm0QOFAo- X-Yahoo-SMTP: u5BKR6OswBC_iZJVfGRoMkTIpc8pEA4- X-Rocket-Received: from [192.168.43.121] (sean_bruno@70.197.5.217 with ) by smtp110.mail.bf1.yahoo.com with SMTP; 04 Oct 2013 08:56:57 -0700 PDT Subject: pci_alloc_msi is always called, is this bad? From: Sean Bruno To: "FreeBSD-scsi@freebsd.org" In-Reply-To: <20131003194704.GG41229@kib.kiev.ua> References: <20131003194704.GG41229@kib.kiev.ua> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-Y0dMsK0bGNdzLsQSS1c9" Date: Fri, 04 Oct 2013 08:56:49 -0700 Message-ID: <1380902209.2621.11.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: sbruno@freebsd.org List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 15:57:05 -0000 --=-Y0dMsK0bGNdzLsQSS1c9 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I was looking at the recent thread on -stable about mfi(4) and I noted that it appears, if I'm not mistaken, mfi_pci.c::pci_alloc_msi() is *always* invoked regardless of the mfi_msi tuneable. We just ignore the allocated MSI by not setting sc->mfi_irq_rid. Is that harmful? ------------------------------------------------------------------------ 240 /* Allocate IRQ resource. */ 241 sc->mfi_irq_rid =3D 0; 242 count =3D 1; 243 if (mfi_msi && pci_alloc_msi(sc->mfi_dev, &count) =3D=3D 0) { 244 device_printf(sc->mfi_dev, "Using MSI\n"); 245 sc->mfi_irq_rid =3D 1; 246 } ------------------------------------------------------------------------ I would have thought that this would be more correct, avoid calling pci_alloc_msi() if mfi_msi isn't set in the first place. ------------------------------------------------------------------------ sc->mfi_irq_ird =3D 0; count =3D 1; ret =3D 0 if(mfi_msi) ret =3D pci_alloc_msi(sc->mfi_dev, &count); if (!ret) { device_printf(sc->mfi_dev, "Using MSI\n"); sc->mfi_irq_rid =3D 1; } ------------------------------------------------------------------------ Sean --=-Y0dMsK0bGNdzLsQSS1c9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (FreeBSD) iQEcBAABAgAGBQJSTuVBAAoJEBkJRdwI6BaHbJMH/jrKGb60hQFcmTC/ETEPeSWx fCoxeT+TsICKXycUAXNyc+0ThndqOwUBBDEN+yEMRn1YwbT4jk4WaM2w6yxLXFf3 0Zixb9K3IMNKIrlNZfVgqvEXty56PHRML/kvvlj0GXmEndKRcgQCEaLr/yEc79lK 4XGrk1oJUoZtXljCZr5OEuRM9TYMkxBDRZZuaIxZigqUO0bVOP2gCna4Q7/ixY2p qH5mtYAoq20YSrnSF71MwerO624TVjrusVMUpVkEoZ9+8Fnd2xO/xy1CzhPgZDwE xeTRINRNTXN8NRdAvwHJHova1DcZdzmF5NOyaXGjc1otmZAqHRvAPHfNJbf5XvU= =6UmQ -----END PGP SIGNATURE----- --=-Y0dMsK0bGNdzLsQSS1c9--