powerpc/pseries/pci: Add a msi_free() handler to clear XIVE data
authorCédric Le Goater <clg@kaod.org>
Thu, 1 Jul 2021 13:27:27 +0000 (15:27 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 10 Aug 2021 13:14:58 +0000 (23:14 +1000)
commit9a014f456881e947bf8cdd8c984a207097e6c096
tree445a0619a6b4d8d61852494073e8785a3a5a2656
parent07817a578a7a79638537480b8847dc7a12f293c5
powerpc/pseries/pci: Add a msi_free() handler to clear XIVE data

The MSI domain clears the IRQ with msi_domain_free(), which calls
irq_domain_free_irqs_top(), which clears the handler data. This is a
problem for the XIVE controller since we need to unmap MMIO pages and
free a specific XIVE structure.

The 'msi_free()' handler is called before irq_domain_free_irqs_top()
when the handler data is still available. Use that to clear the XIVE
controller data.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210701132750.1475580-10-clg@kaod.org
arch/powerpc/include/asm/xive.h
arch/powerpc/platforms/pseries/msi.c
arch/powerpc/sysdev/xive/common.c