@@ -49,96 +49,6 @@ static void pci_msi_domain_write_msg(struct irq_data *irq_data, struct msi_msg *
4949 __pci_write_msi_msg (desc , msg );
5050}
5151
52- /**
53- * pci_msi_domain_calc_hwirq - Generate a unique ID for an MSI source
54- * @desc: Pointer to the MSI descriptor
55- *
56- * The ID number is only used within the irqdomain.
57- */
58- static irq_hw_number_t pci_msi_domain_calc_hwirq (struct msi_desc * desc )
59- {
60- struct pci_dev * dev = msi_desc_to_pci_dev (desc );
61-
62- return (irq_hw_number_t )desc -> msi_index |
63- pci_dev_id (dev ) << 11 |
64- ((irq_hw_number_t )(pci_domain_nr (dev -> bus ) & 0xFFFFFFFF )) << 27 ;
65- }
66-
67- static void pci_msi_domain_set_desc (msi_alloc_info_t * arg ,
68- struct msi_desc * desc )
69- {
70- arg -> desc = desc ;
71- arg -> hwirq = pci_msi_domain_calc_hwirq (desc );
72- }
73-
74- static struct msi_domain_ops pci_msi_domain_ops_default = {
75- .set_desc = pci_msi_domain_set_desc ,
76- };
77-
78- static void pci_msi_domain_update_dom_ops (struct msi_domain_info * info )
79- {
80- struct msi_domain_ops * ops = info -> ops ;
81-
82- if (ops == NULL ) {
83- info -> ops = & pci_msi_domain_ops_default ;
84- } else {
85- if (ops -> set_desc == NULL )
86- ops -> set_desc = pci_msi_domain_set_desc ;
87- }
88- }
89-
90- static void pci_msi_domain_update_chip_ops (struct msi_domain_info * info )
91- {
92- struct irq_chip * chip = info -> chip ;
93-
94- BUG_ON (!chip );
95- if (!chip -> irq_write_msi_msg )
96- chip -> irq_write_msi_msg = pci_msi_domain_write_msg ;
97- if (!chip -> irq_mask )
98- chip -> irq_mask = pci_msi_mask_irq ;
99- if (!chip -> irq_unmask )
100- chip -> irq_unmask = pci_msi_unmask_irq ;
101- }
102-
103- /**
104- * pci_msi_create_irq_domain - Create a MSI interrupt domain
105- * @fwnode: Optional fwnode of the interrupt controller
106- * @info: MSI domain info
107- * @parent: Parent irq domain
108- *
109- * Updates the domain and chip ops and creates a MSI interrupt domain.
110- *
111- * Returns:
112- * A domain pointer or NULL in case of failure.
113- */
114- struct irq_domain * pci_msi_create_irq_domain (struct fwnode_handle * fwnode ,
115- struct msi_domain_info * info ,
116- struct irq_domain * parent )
117- {
118- if (WARN_ON (info -> flags & MSI_FLAG_LEVEL_CAPABLE ))
119- info -> flags &= ~MSI_FLAG_LEVEL_CAPABLE ;
120-
121- if (info -> flags & MSI_FLAG_USE_DEF_DOM_OPS )
122- pci_msi_domain_update_dom_ops (info );
123- if (info -> flags & MSI_FLAG_USE_DEF_CHIP_OPS )
124- pci_msi_domain_update_chip_ops (info );
125-
126- /* Let the core code free MSI descriptors when freeing interrupts */
127- info -> flags |= MSI_FLAG_FREE_MSI_DESCS ;
128-
129- info -> flags |= MSI_FLAG_ACTIVATE_EARLY | MSI_FLAG_DEV_SYSFS ;
130- if (IS_ENABLED (CONFIG_GENERIC_IRQ_RESERVATION_MODE ))
131- info -> flags |= MSI_FLAG_MUST_REACTIVATE ;
132-
133- /* PCI-MSI is oneshot-safe */
134- info -> chip -> flags |= IRQCHIP_ONESHOT_SAFE ;
135- /* Let the core update the bus token */
136- info -> bus_token = DOMAIN_BUS_PCI_MSI ;
137-
138- return msi_create_irq_domain (fwnode , info , parent );
139- }
140- EXPORT_SYMBOL_GPL (pci_msi_create_irq_domain );
141-
14252/*
14353 * Per device MSI[-X] domain functionality
14454 */
0 commit comments