Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Oct 2013 08:56:49 -0700
From:      Sean Bruno <sean_bruno@yahoo.com>
To:        "FreeBSD-scsi@freebsd.org" <FreeBSD-scsi@freebsd.org>
Subject:   pci_alloc_msi is always called, is this bad?
Message-ID:  <1380902209.2621.11.camel@localhost>
In-Reply-To: <20131003194704.GG41229@kib.kiev.ua>
References:  <CAFMmRNzWwxe=YVJcC7Lkjqru5eugciwzEQHjgE-Bh-ctOykVNQ@mail.gmail.com> <20131003194704.GG41229@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-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--




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