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
105105 };
106106 };
107107
108+#define MSI_MAX_INDEX ((unsigned int)USHRT_MAX)
109+
108110 /**
109111 * struct msi_desc - Descriptor structure for MSI based interrupts
110112 * @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
248250 #endif /* CONFIG_PCI_MSI */
249251
250252 int msi_add_msi_desc(struct device *dev, struct msi_desc *init_desc);
253+void 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+ */
260+static 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+}
251264
252265 struct msi_desc *alloc_msi_entry(struct device *dev, int nvec,
253266 const struct irq_affinity_desc *affinity);
@@ -408,6 +421,10 @@ enum { · 154 unmodified lines
408421 MSI_FLAG_DEV_SYSFS = (1 << 7),
409422 /* MSI-X entries must be contiguous */
410423 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),
411428 };
412429
413430 int 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