Lines Matching full:msi
15 #include <linux/msi.h>
73 * msi_add_msi_desc - Allocate and initialize a MSI descriptor
75 * @init_desc: Pointer to an MSI descriptor to initialize the new descriptor
83 lockdep_assert_held(&dev->msi.data->mutex); in msi_add_msi_desc()
91 return msi_insert_desc(dev->msi.data, desc, init_desc->msi_index); in msi_add_msi_desc()
95 * msi_add_simple_msi_descs - Allocate and initialize MSI descriptors
97 * @index: Index for the first MSI descriptor
108 lockdep_assert_held(&dev->msi.data->mutex); in msi_add_simple_msi_descs()
114 ret = msi_insert_desc(dev->msi.data, desc, idx); in msi_add_simple_msi_descs()
142 * msi_free_msi_descs_range - Free MSI descriptors of a device
151 struct xarray *xa = &dev->msi.data->__store; in msi_free_msi_descs_range()
155 lockdep_assert_held(&dev->msi.data->mutex); in msi_free_msi_descs_range()
184 dev->msi.data = NULL; in msi_device_data_release()
188 * msi_setup_device_data - Setup MSI device data
189 * @dev: Device for which MSI device data should be set up
193 * This can be called more than once for @dev. If the MSI device data is
202 if (dev->msi.data) in msi_setup_device_data()
217 dev->msi.data = md; in msi_setup_device_data()
223 * msi_lock_descs - Lock the MSI descriptor storage of a device
228 mutex_lock(&dev->msi.data->mutex); in msi_lock_descs()
233 * msi_unlock_descs - Unlock the MSI descriptor storage of a device
239 dev->msi.data->__iter_idx = MSI_MAX_INDEX; in msi_unlock_descs()
240 mutex_unlock(&dev->msi.data->mutex); in msi_unlock_descs()
257 * msi_first_desc - Get the first MSI descriptor of a device
261 * Must be called with the MSI descriptor mutex held, i.e. msi_lock_descs()
264 * Return: Pointer to the first MSI descriptor matching the search
269 struct msi_device_data *md = dev->msi.data; in msi_first_desc()
282 * msi_next_desc - Get the next MSI descriptor of a device
288 * to be done within the same MSI mutex held region.
290 * Return: Pointer to the next MSI descriptor matching the search
295 struct msi_device_data *md = dev->msi.data; in msi_next_desc()
311 * msi_get_virq - Return Linux interrupt number of a MSI interrupt
313 * @index: MSI interrupt index to look for (0-based)
323 if (!dev->msi.data) in msi_get_virq()
329 desc = xa_load(&dev->msi.data->__store, pcimsi ? 0 : index); in msi_get_virq()
332 * PCI-MSI has only one descriptor for multiple interrupts. in msi_get_virq()
333 * PCI-MSIX and platform MSI use a descriptor per in msi_get_virq()
366 /* MSI vs. MSIX is per device not per interrupt */ in msi_mode_show()
369 return sysfs_emit(buf, "%s\n", is_msix ? "msix" : "msi"); in msi_mode_show()
474 * If the MSI provider has messed with the second message and in msi_check_level()
483 * msi_domain_set_affinity - Generic affinity setter function for MSI domains
488 * Intended to be used by MSI interrupt controllers which are
672 * msi_create_irq_domain - Create an MSI interrupt domain
674 * @info: MSI domain info
726 desc = xa_load(&dev->msi.data->__store, virq); in msi_domain_populate_irqs()
751 * dummy vector to the device. If the PCI/MSI device does not support
757 * used. For now reservation mode is restricted to PCI/MSI.
780 * Checking the first MSI descriptor is sufficient. MSIX supports in msi_check_reservation_mode()
781 * masking and MSI does so when the can_mask attribute is set. in msi_check_reservation_mode()
800 /* Let a failed PCI multi MSI allocation retry */ in msi_handle_pci_fail()
870 * the MSI entries before the PCI layer enables MSI in the in __msi_domain_alloc_irqs()
871 * card. Otherwise the card latches a random msi message. in __msi_domain_alloc_irqs()
883 * MSI affinity setting requires a special quirk (X86) when in __msi_domain_alloc_irqs()
927 * msi_domain_alloc_irqs_descs_locked - Allocate interrupts from a MSI interrupt domain
934 * pair. Use this for MSI irqdomains which implement their own vector
946 lockdep_assert_held(&dev->msi.data->mutex); in msi_domain_alloc_irqs_descs_locked()
959 * msi_domain_alloc_irqs - Allocate interrupts from a MSI interrupt domain
984 /* Only handle MSI entries which have an interrupt associated */ in __msi_domain_free_irqs()
1008 …* msi_domain_free_irqs_descs_locked - Free interrupts from a MSI interrupt @domain associated to @…
1014 * pair. Use this for MSI irqdomains which implement their own vector
1022 lockdep_assert_held(&dev->msi.data->mutex); in msi_domain_free_irqs_descs_locked()
1029 * msi_domain_free_irqs - Free interrupts from a MSI interrupt @domain associated to @dev
1042 * msi_get_domain_info - Get the MSI interrupt domain info for @domain