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.
Showing the changes to include (1 of 2 files). Show all
Unified · Split
| @@ -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 | 111 | * struct msi_desc - Descriptor structure for MSI based interrupts |
| 110 | 112 | * @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 | 250 | #endif /* CONFIG_PCI_MSI */ |
| 249 | 251 | |
| 250 | 252 | 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 | +} | |
| 251 | 264 | |
| 252 | 265 | struct msi_desc *alloc_msi_entry(struct device *dev, int nvec, |
| 253 | 266 | const struct irq_affinity_desc *affinity); |
| @@ -408,6 +421,10 @@ enum { · 154 unmodified lines | ||
| 408 | 421 | MSI_FLAG_DEV_SYSFS = (1 << 7), |
| 409 | 422 | /* MSI-X entries must be contiguous */ |
| 410 | 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 | |
| 413 | 430 | int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask, |