[PATCH] Add MSI support to puc(9)
John Baldwin
jhb at freebsd.org
Tue Mar 11 21:22:45 UTC 2014
On Tuesday, March 11, 2014 5:12:09 pm Ryan Stone wrote:
> On Thu, Feb 27, 2014 at 1:30 PM, John Baldwin <jhb at freebsd.org> wrote:
> > I would suggest reworking this so that you try MSI for all PCI devices.
> > I would do this by removing the 'sc_irid = 0' from puc_bfe_attach() so
> > that it can be set by callers. You could then add attach/detach routines in
> > puc_pci.c that use pci_alloc_msi() and set sc_irid to 1 if MSI works. The
> > sc_irid value would also work as a flag for knowing if detach needs to call
> > pci_release_msi() (or puc_pci_attach() handling failure in puc_bfe_attach())
> > (though I wouldn't be opposed to keeping sc_msi as a separate flag).
>
> Thanks for the review. I have reworked the patch as requested. The
> new version can be found at the same path:
> http://people.freebsd.org/~rstone/patches/puc_msi.diff
This generally looks good, but I don't really like abusing sc_irid as the
count parameter. I would use a standalone count and only set sc_irid to 1 if
it works:
count = 1;
if (pci_alloc_msi(dev, &count) == 0) {
sc->sc_msi = 1;
sc->sc_irid = 1;
}
--
John Baldwin
More information about the freebsd-hackers
mailing list