Date: Fri, 9 Dec 2011 08:01:37 -0500 From: John Baldwin <jhb@freebsd.org> To: freebsd-drivers@freebsd.org Cc: lixin.pang@emc.com Subject: Re: pci_alloc_msi error Message-ID: <201112090801.37711.jhb@freebsd.org> In-Reply-To: <04C45E3CCE5E1B46AE8A29F585F6743A0221EE4B19@MX32A.corp.emc.com> References: <04C45E3CCE5E1B46AE8A29F585F6743A0221EE4B19@MX32A.corp.emc.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, December 08, 2011 8:56:39 pm lixin.pang@emc.com wrote: > I'm writing a PCI device driver for freebsd 7.3. In the driver attach function, > > pci_enable_busmaster(dev) returns 0, > > pci_msi_count(dev) returns 1, > > however, error = pci_alloc_msi(dev, &msi) failed with error == 6 (device not configured). I assume you set msi to 1 before you called it? (It is both an input and output parameter.) > Am I missing any steps before calling pci_alloc_msi? I don't believe so. The reasons I see that pci_alloc_msi() will fail with ENXIO are: - the driver has allocated its INTx IRQ via bus_alloc_resource() of rid 0 of the SYS_RES_IRQ type - the driver has already allocated MSI or MSI-X IRQs - MSI is blacklisted for the system or for a parent PCI-PCI bridge - APIC mode is disabled or your system has an unsupported CPU (only Intel, AMD, and certain VIA CPUs are known to work, other CPUs might work, we just haven't heard of it). - The system is completely out of MSI IRQ tokens (there are 512 of these, so this is doubtful) -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201112090801.37711.jhb>