Skip to content

Commit

Permalink
MIPS: PCI: Move map_irq() hooks out of initdata
Browse files Browse the repository at this point in the history
04c81c7 ("MIPS: PCI: Replace pci_fixup_irqs() call with host bridge
IRQ mapping hooks") moved the PCI IRQ fixup to the new host bridge
map/swizzle_irq() hooks mechanism. Those hooks can also be called after
boot, when all the __init/__initdata/__initconst sections have been freed.
Therefore, functions called by them (and the data they refer to) must not
be marked as __init/__initdata/__initconst lest compilation trigger section
mismatch warnings.

Fix all the board files map_irq() hooks by simply removing the respective
__init/__initdata/__initconst section markers and by adding another
persistent hook IRQ map for the txx9 board files.

Fixes: 04c81c7 ("MIPS: PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks")
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Steve French <smfrench@gmail.com>
  • Loading branch information
Lorenzo Pieralisi authored and Bjorn Helgaas committed Sep 19, 2017
1 parent 2bd6bf0 commit 19a8d6b
Show file tree
Hide file tree
Showing 32 changed files with 62 additions and 60 deletions.
12 changes: 6 additions & 6 deletions arch/mips/ath79/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
#include "pci.h"

static int (*ath79_pci_plat_dev_init)(struct pci_dev *dev);
static const struct ath79_pci_irq *ath79_pci_irq_map __initdata;
static unsigned ath79_pci_nr_irqs __initdata;
static const struct ath79_pci_irq *ath79_pci_irq_map;
static unsigned ath79_pci_nr_irqs;

static const struct ath79_pci_irq ar71xx_pci_irq_map[] __initconst = {
static const struct ath79_pci_irq ar71xx_pci_irq_map[] = {
{
.slot = 17,
.pin = 1,
Expand All @@ -41,15 +41,15 @@ static const struct ath79_pci_irq ar71xx_pci_irq_map[] __initconst = {
}
};

static const struct ath79_pci_irq ar724x_pci_irq_map[] __initconst = {
static const struct ath79_pci_irq ar724x_pci_irq_map[] = {
{
.slot = 0,
.pin = 1,
.irq = ATH79_PCI_IRQ(0),
}
};

static const struct ath79_pci_irq qca955x_pci_irq_map[] __initconst = {
static const struct ath79_pci_irq qca955x_pci_irq_map[] = {
{
.bus = 0,
.slot = 0,
Expand All @@ -64,7 +64,7 @@ static const struct ath79_pci_irq qca955x_pci_irq_map[] __initconst = {
},
};

int __init pcibios_map_irq(const struct pci_dev *dev, uint8_t slot, uint8_t pin)
int pcibios_map_irq(const struct pci_dev *dev, uint8_t slot, uint8_t pin)
{
int irq = -1;
int i;
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/pci/fixup-capcella.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
#define INTC PC104PLUS_INTC_IRQ
#define INTD PC104PLUS_INTD_IRQ

static char irq_tab_capcella[][5] __initdata = {
static char irq_tab_capcella[][5] = {
[11] = { -1, INT1, INT1, INT1, INT1 },
[12] = { -1, INT2, INT2, INT2, INT2 },
[14] = { -1, INTA, INTB, INTC, INTD }
};

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
return irq_tab_capcella[slot][pin];
}
Expand Down
8 changes: 4 additions & 4 deletions arch/mips/pci/fixup-cobalt.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static void qube_raq_via_board_id_fixup(struct pci_dev *dev)
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0,
qube_raq_via_board_id_fixup);

static char irq_tab_qube1[] __initdata = {
static char irq_tab_qube1[] = {
[COBALT_PCICONF_CPU] = 0,
[COBALT_PCICONF_ETH0] = QUBE1_ETH0_IRQ,
[COBALT_PCICONF_RAQSCSI] = SCSI_IRQ,
Expand All @@ -156,7 +156,7 @@ static char irq_tab_qube1[] __initdata = {
[COBALT_PCICONF_ETH1] = 0
};

static char irq_tab_cobalt[] __initdata = {
static char irq_tab_cobalt[] = {
[COBALT_PCICONF_CPU] = 0,
[COBALT_PCICONF_ETH0] = ETH0_IRQ,
[COBALT_PCICONF_RAQSCSI] = SCSI_IRQ,
Expand All @@ -165,7 +165,7 @@ static char irq_tab_cobalt[] __initdata = {
[COBALT_PCICONF_ETH1] = ETH1_IRQ
};

static char irq_tab_raq2[] __initdata = {
static char irq_tab_raq2[] = {
[COBALT_PCICONF_CPU] = 0,
[COBALT_PCICONF_ETH0] = ETH0_IRQ,
[COBALT_PCICONF_RAQSCSI] = RAQ2_SCSI_IRQ,
Expand All @@ -174,7 +174,7 @@ static char irq_tab_raq2[] __initdata = {
[COBALT_PCICONF_ETH1] = ETH1_IRQ
};

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
if (cobalt_board_id <= COBALT_BRD_ID_QUBE1)
return irq_tab_qube1[slot];
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/pci/fixup-emma2rh.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*/

#define MAX_SLOT_NUM 10
static unsigned char irq_map[][5] __initdata = {
static unsigned char irq_map[][5] = {
[3] = {0, MARKEINS_PCI_IRQ_INTB, MARKEINS_PCI_IRQ_INTC,
MARKEINS_PCI_IRQ_INTD, 0,},
[4] = {0, MARKEINS_PCI_IRQ_INTA, 0, 0, 0,},
Expand Down Expand Up @@ -85,7 +85,7 @@ static void emma2rh_pci_host_fixup(struct pci_dev *dev)
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_EMMA2RH,
emma2rh_pci_host_fixup);

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
return irq_map[slot][pin];
}
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pci/fixup-fuloong2e.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/* South bridge slot number is set by the pci probe process */
static u8 sb_slot = 5;

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
int irq = 0;

Expand Down
4 changes: 2 additions & 2 deletions arch/mips/pci/fixup-ip32.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define INTB MACEPCI_SHARED0_IRQ
#define INTC MACEPCI_SHARED1_IRQ
#define INTD MACEPCI_SHARED2_IRQ
static char irq_tab_mace[][5] __initdata = {
static char irq_tab_mace[][5] = {
/* Dummy INT#A INT#B INT#C INT#D */
{0, 0, 0, 0, 0}, /* This is placeholder row - never used */
{0, SCSI0, SCSI0, SCSI0, SCSI0},
Expand All @@ -39,7 +39,7 @@ static char irq_tab_mace[][5] __initdata = {
* irqs. I suppose a device without a pin A will thank us for doing it
* right if there exists such a broken piece of crap.
*/
int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
return irq_tab_mace[slot][pin];
}
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pci/fixup-jmr3927.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <asm/txx9/pci.h>
#include <asm/txx9/jmr3927.h>

int __init jmr3927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int jmr3927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
unsigned char irq = pin;

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pci/fixup-lantiq.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
return 0;
}

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
return of_irq_parse_and_map_pci(dev, slot, pin);
}
4 changes: 2 additions & 2 deletions arch/mips/pci/fixup-lemote2f.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define PCID 7

/* all the pci device has the PCIA pin, check the datasheet. */
static char irq_tab[][5] __initdata = {
static char irq_tab[][5] = {
/* INTA INTB INTC INTD */
{0, 0, 0, 0, 0}, /* 11: Unused */
{0, 0, 0, 0, 0}, /* 12: Unused */
Expand All @@ -51,7 +51,7 @@ static char irq_tab[][5] __initdata = {
{0, 0, 0, 0, 0}, /* 27: Unused */
};

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
int virq;

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pci/fixup-loongson3.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static void print_fixup_info(const struct pci_dev *pdev)
pdev->vendor, pdev->device, pdev->irq);
}

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
print_fixup_info(dev);
return dev->irq;
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/pci/fixup-malta.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
static char pci_irq[5] = {
};

static char irq_tab[][5] __initdata = {
static char irq_tab[][5] = {
/* INTA INTB INTC INTD */
{0, 0, 0, 0, 0 }, /* 0: GT64120 PCI bridge */
{0, 0, 0, 0, 0 }, /* 1: Unused */
Expand All @@ -38,7 +38,7 @@ static char irq_tab[][5] __initdata = {
{0, PCID, PCIA, PCIB, PCIC } /* 21: PCI Slot 4 */
};

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
int virq;
virq = irq_tab[slot][pin];
Expand Down
6 changes: 3 additions & 3 deletions arch/mips/pci/fixup-mpc30x.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@

#include <asm/vr41xx/mpc30x.h>

static const int internal_func_irqs[] __initconst = {
static const int internal_func_irqs[] = {
VRC4173_CASCADE_IRQ,
VRC4173_AC97_IRQ,
VRC4173_USB_IRQ,
};

static const int irq_tab_mpc30x[] __initconst = {
static const int irq_tab_mpc30x[] = {
[12] = VRC4173_PCMCIA1_IRQ,
[13] = VRC4173_PCMCIA2_IRQ,
[29] = MQ200_IRQ,
};

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
if (slot == 30)
return internal_func_irqs[PCI_FUNC(dev->devfn)];
Expand Down
8 changes: 4 additions & 4 deletions arch/mips/pci/fixup-pmcmsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

#if defined(CONFIG_PMC_MSP7120_GW)
/* Garibaldi Board IRQ wiring to PCI slots */
static char irq_tab[][5] __initdata = {
static char irq_tab[][5] = {
/* INTA INTB INTC INTD */
{0, 0, 0, 0, 0 }, /* (AD[0]): Unused */
{0, 0, 0, 0, 0 }, /* (AD[1]): Unused */
Expand Down Expand Up @@ -86,7 +86,7 @@ static char irq_tab[][5] __initdata = {
#elif defined(CONFIG_PMC_MSP7120_EVAL)

/* MSP7120 Eval Board IRQ wiring to PCI slots */
static char irq_tab[][5] __initdata = {
static char irq_tab[][5] = {
/* INTA INTB INTC INTD */
{0, 0, 0, 0, 0 }, /* (AD[0]): Unused */
{0, 0, 0, 0, 0 }, /* (AD[1]): Unused */
Expand Down Expand Up @@ -125,7 +125,7 @@ static char irq_tab[][5] __initdata = {
#else

/* Unknown board -- don't assign any IRQs */
static char irq_tab[][5] __initdata = {
static char irq_tab[][5] = {
/* INTA INTB INTC INTD */
{0, 0, 0, 0, 0 }, /* (AD[0]): Unused */
{0, 0, 0, 0, 0 }, /* (AD[1]): Unused */
Expand Down Expand Up @@ -202,7 +202,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
* RETURNS: IRQ number
*
****************************************************************************/
int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
#if !defined(CONFIG_PMC_MSP7120_GW) && !defined(CONFIG_PMC_MSP7120_EVAL)
printk(KERN_WARNING "PCI: unknown board, no PCI IRQs assigned.\n");
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pci/fixup-rbtx4927.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <asm/txx9/pci.h>
#include <asm/txx9/rbtx4927.h>

int __init rbtx4927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int rbtx4927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
unsigned char irq = pin;

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pci/fixup-rbtx4938.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <asm/txx9/pci.h>
#include <asm/txx9/rbtx4938.h>

int __init rbtx4938_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int rbtx4938_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
int irq = tx4938_pcic1_map_irq(dev, slot);

Expand Down
12 changes: 6 additions & 6 deletions arch/mips/pci/fixup-sni.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* seem to be a documentation error. At least on my RM200C the Cirrus
* Logic CL-GD5434 VGA is device 3.
*/
static char irq_tab_rm200[8][5] __initdata = {
static char irq_tab_rm200[8][5] = {
/* INTA INTB INTC INTD */
{ 0, 0, 0, 0, 0 }, /* EISA bridge */
{ SCSI, SCSI, SCSI, SCSI, SCSI }, /* SCSI */
Expand All @@ -57,7 +57,7 @@ static char irq_tab_rm200[8][5] __initdata = {
*
* The VGA card is optional for RM300 systems.
*/
static char irq_tab_rm300d[8][5] __initdata = {
static char irq_tab_rm300d[8][5] = {
/* INTA INTB INTC INTD */
{ 0, 0, 0, 0, 0 }, /* EISA bridge */
{ SCSI, SCSI, SCSI, SCSI, SCSI }, /* SCSI */
Expand All @@ -69,7 +69,7 @@ static char irq_tab_rm300d[8][5] __initdata = {
{ 0, INTD, INTA, INTB, INTC }, /* Slot 4 */
};

static char irq_tab_rm300e[5][5] __initdata = {
static char irq_tab_rm300e[5][5] = {
/* INTA INTB INTC INTD */
{ 0, 0, 0, 0, 0 }, /* HOST bridge */
{ SCSI, SCSI, SCSI, SCSI, SCSI }, /* SCSI */
Expand All @@ -96,7 +96,7 @@ static char irq_tab_rm300e[5][5] __initdata = {
#define INTC PCIT_IRQ_INTC
#define INTD PCIT_IRQ_INTD

static char irq_tab_pcit[13][5] __initdata = {
static char irq_tab_pcit[13][5] = {
/* INTA INTB INTC INTD */
{ 0, 0, 0, 0, 0 }, /* HOST bridge */
{ SCSI0, SCSI0, SCSI0, SCSI0, SCSI0 }, /* SCSI */
Expand All @@ -113,7 +113,7 @@ static char irq_tab_pcit[13][5] __initdata = {
{ 0, INTA, INTB, INTC, INTD }, /* Slot 5 */
};

static char irq_tab_pcit_cplus[13][5] __initdata = {
static char irq_tab_pcit_cplus[13][5] = {
/* INTA INTB INTC INTD */
{ 0, 0, 0, 0, 0 }, /* HOST bridge */
{ 0, INTB, INTC, INTD, INTA }, /* PCI Slot 9 */
Expand All @@ -130,7 +130,7 @@ static inline int is_rm300_revd(void)
return (csmsr & 0xa0) == 0x20;
}

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
switch (sni_brd_type) {
case SNI_BRD_PCI_TOWER_CPLUS:
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pci/fixup-tb0219.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include <asm/vr41xx/tb0219.h>

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
int irq = -1;

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pci/fixup-tb0226.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <asm/vr41xx/giu.h>
#include <asm/vr41xx/tb0226.h>

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
int irq = -1;

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pci/fixup-tb0287.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <asm/vr41xx/tb0287.h>

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
unsigned char bus;
int irq = -1;
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pci/pci-alchemy.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ static int __init alchemy_pci_init(void)
arch_initcall(alchemy_pci_init);


int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
struct alchemy_pci_context *ctx = dev->sysdata;
if (ctx && ctx->board_map_irq)
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pci/pci-bcm47xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <linux/bcma/bcma.h>
#include <bcm47xx.h>

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pci/pci-lasat.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ arch_initcall(lasat_pci_setup);
#define LASAT_IRQ_PCIC (LASAT_IRQ_BASE + 7)
#define LASAT_IRQ_PCID (LASAT_IRQ_BASE + 8)

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
switch (slot) {
case 1:
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pci/pci-mt7620.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ static int mt7620_pci_probe(struct platform_device *pdev)
return 0;
}

int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
u16 cmd;
u32 val;
Expand Down
Loading

0 comments on commit 19a8d6b

Please sign in to comment.