Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Feb 2014 13:30:02 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        Ryan Stone <rysto32@gmail.com>
Subject:   Re: [PATCH] Add MSI support to puc(9)
Message-ID:  <201402271330.02699.jhb@freebsd.org>
In-Reply-To: <CAFMmRNy9EG3byRV1b=4W5MejMiAz8yV6UnnEMjcJmY-FyMj2sg@mail.gmail.com>
References:  <CAFMmRNy9EG3byRV1b=4W5MejMiAz8yV6UnnEMjcJmY-FyMj2sg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, February 26, 2014 2:22:48 pm Ryan Stone wrote:
> The Exar XR17V358 is a PCIe device and it supports a single MSI
> interrupt.  This patch will make puc(9) use an MSI interrupt on
> devices that declare that they support it:
> 
> http://people.freebsd.org/~rstone/patches/puc_msi.diff
> 
> This patch may be overly paranoid; I was worried that it's wasn't
> guaranteed that I could always call pci_alloc_msi() (forgetting that
> the P in puc stands for PCI) so I added a new puc_cfg_cmd that
> individual device config methods could implement to advertise support
> rather than depending on pci_alloc_msi() to behave sanely.
> 
> I have tested the patch on both a XR17V358 and a XR17V258 (which is a
> legacy PCI device that does not support PCI)

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).

-- 
John Baldwin



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