MSI: arch should connect the irq and the msi_desc desc when it's ready
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines · Michael Ellerman
set_irq_msi()currently connects anirq_descto anmsi_desc. The archs call it at some point in their setup routine, and then the generic code sets up the reverse mapping from themsi_descback to the irq.
set_irq_msi()should really do both connections, making it the one and only call required to connect an irq with it's MSI desc.
Hmm. This comment should be a little more forceful than a suggestion to make ti clear you have made that change somewhere in this patch.
Quoted 6 lines
It should be the arch code that calls
set_irq_msi(), and it should do so only once it's sure it's not going to fail the irq allocation.Given that there's no need for the arch to return the irq anymore, the return value from the arch setup routine just becomes 0 for success and !0 for failure.
Call it negative for failure, or possibly nonzero. !0 == 1 Which isn't what you meant, and is confusing comparing it to the code.
Ok. This is likely me limit of picking on your patches for tonight.
Quoted 13 lines
Index:
msi-new/arch/ia64/kernel/msi_ia64.c
===================================================================arch/ia64/kernel/msi_ia64.c +0
-1@@ -74,7 +74,6 @@ int ia64_setup_msi_irq(struct pci_dev *pif (irq <0 )return irq; -set_irq_msi (irq, desc); dest_phys_id =cpu_physical_id (first_cpu (cpu_online_map)); vector = irq;
arch/ia64/kernel/msi_ia64.c int ia64_setup_msi_irq(struct pci_dev *p · line 93
Quoted 4 lines
arch/ia64/kernel/msi_ia64.c +1
-0@@ -91,11 +90,13 @@ int ia64_setup_msi_irq(struct pci_dev *pMSI_DATA_DELIVERY_FIXED |MSI_DATA_VECTOR (vector); + desc->irq = irq;
Setting desc->irq just before set_irq_msi appears redundant here.
arch/ia64/kernel/msi_ia64.c int ia64_setup_msi_irq(struct pci_dev *p · line 102
Quoted 10 lines
arch/ia64/kernel/msi_ia64.c +2
-1+set_irq_msi (irq, desc);set_irq_chip_and_handler (irq, &ia64_msi_chip, handle_edge_irq);get_irq_chip (irq)->mask (irq);write_msi_msg (irq, &msg); -return irq; +return 0 ; }void ia64_teardown_msi_irq (unsigned int irq)
Eric