History

genirq/msi: Provide domain flags to allocate/free MSI descriptors automatically

Provide domain info flags which tell the core to allocate simple descriptors or to free descriptors when the interrupts are freed and implement the required functionality.

Thomas Gleixner committed 4 years ago

Commit 645474e1 parent 60290522 files · +65 −0Browse files

Showing the changes to include (1 of 2 files). Show all

Unified · Split

include/linux/msi.h+17−0
@@ -105,6 +105,8 @@ struct pci_msi_desc { · 104 unmodified lines
105 };105 };
106};106};
107 107
108#define MSI_MAX_INDEX ((unsigned int)USHRT_MAX)
109
108/**110/**
109 * struct msi_desc - Descriptor structure for MSI based interrupts111 * struct msi_desc - Descriptor structure for MSI based interrupts
110 * @list: List head for management112 * @list: List head for management
@@ -248,6 +250,17 @@ static inline void pci_write_msi_msg(unsigned int irq, struct msi_msg *msg) · 137 unmodified lines
248#endif /* CONFIG_PCI_MSI */250#endif /* CONFIG_PCI_MSI */
249 251
250int msi_add_msi_desc(struct device *dev, struct msi_desc *init_desc);252int msi_add_msi_desc(struct device *dev, struct msi_desc *init_desc);
253void msi_free_msi_descs_range(struct device *dev, enum msi_desc_filter filter,
254 unsigned int first_index, unsigned int last_index);
255
256/**
257 * msi_free_msi_descs - Free MSI descriptors of a device
258 * @dev: Device to free the descriptors
259 */
260static inline void msi_free_msi_descs(struct device *dev)
261{
262 msi_free_msi_descs_range(dev, MSI_DESC_ALL, 0, MSI_MAX_INDEX);
263}
251 264
252struct msi_desc *alloc_msi_entry(struct device *dev, int nvec,265struct msi_desc *alloc_msi_entry(struct device *dev, int nvec,
253 const struct irq_affinity_desc *affinity);266 const struct irq_affinity_desc *affinity);
@@ -408,6 +421,10 @@ enum { · 154 unmodified lines
408 MSI_FLAG_DEV_SYSFS = (1 << 7),421 MSI_FLAG_DEV_SYSFS = (1 << 7),
409 /* MSI-X entries must be contiguous */422 /* MSI-X entries must be contiguous */
410 MSI_FLAG_MSIX_CONTIGUOUS = (1 << 8),423 MSI_FLAG_MSIX_CONTIGUOUS = (1 << 8),
424 /* Allocate simple MSI descriptors */
425 MSI_FLAG_ALLOC_SIMPLE_MSI_DESCS = (1 << 9),
426 /* Free MSI descriptors */
427 MSI_FLAG_FREE_MSI_DESCS = (1 << 10),
411};428};
412 429
413int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask,430int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t