Re: [PATCH] MIPS: Octeon: don't mark octeon_pci_pcibios_map_irq() __init

From: Thomas Bogendoerfer

Date: Sat Dec 05 2026 - 05:23:47 EST


On Thu, Dec 03, 2026 at 11:19:14AM +0100, Imre Kaloz wrote:
> The function is called through pcibios_map_irq(), the host bridge
> map_irq hook, from pci_assign_irq() when a driver binds to a device.
> A PCI driver that probes after init memory is freed, such as a module,
> jumps into freed memory and crashes.
>
> Commit 19a8d6b7604d ("MIPS: PCI: Move map_irq() hooks out of initdata")
> removed __init from pcibios_map_irq() and octeon_pcie_pcibios_map_irq()
> for the same reason, but not from this function.
>
> Fixes: 04c81c7293df ("MIPS: PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Imre Kaloz <kaloz@xxxxxxxxxx>
> ---
> arch/mips/pci/pci-octeon.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/mips/pci/pci-octeon.c b/arch/mips/pci/pci-octeon.c
> index 36d12cea3512..9f117c63b608 100644
> --- a/arch/mips/pci/pci-octeon.c
> +++ b/arch/mips/pci/pci-octeon.c
> @@ -231,8 +231,8 @@ const char *octeon_get_pci_interrupts(void)
> * as it goes through each bridge.
> * Returns Interrupt number for the device
> */
> -int __init octeon_pci_pcibios_map_irq(const struct pci_dev *dev,
> - u8 slot, u8 pin)
> +int octeon_pci_pcibios_map_irq(const struct pci_dev *dev,
> + u8 slot, u8 pin)
> {
> int irq_num;
> const char *interrupts;
>
> base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244

applied to mips-next

Thomas.

--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]